1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_comphelper.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir //_______________________________________________
32*cdf0e10cSrcweir // includes
33*cdf0e10cSrcweir #include <comphelper/sequenceashashmap.hxx>
34*cdf0e10cSrcweir 
35*cdf0e10cSrcweir //_______________________________________________
36*cdf0e10cSrcweir // namespace
37*cdf0e10cSrcweir 
38*cdf0e10cSrcweir namespace comphelper{
39*cdf0e10cSrcweir 
40*cdf0e10cSrcweir namespace css = ::com::sun::star;
41*cdf0e10cSrcweir 
42*cdf0e10cSrcweir //_______________________________________________
43*cdf0e10cSrcweir // definitions
44*cdf0e10cSrcweir 
45*cdf0e10cSrcweir /*-----------------------------------------------
46*cdf0e10cSrcweir     04.11.2003 09:29
47*cdf0e10cSrcweir -----------------------------------------------*/
48*cdf0e10cSrcweir SequenceAsHashMap::SequenceAsHashMap()
49*cdf0e10cSrcweir     : SequenceAsHashMapBase()
50*cdf0e10cSrcweir {
51*cdf0e10cSrcweir }
52*cdf0e10cSrcweir 
53*cdf0e10cSrcweir /*-----------------------------------------------
54*cdf0e10cSrcweir     04.11.2003 08:30
55*cdf0e10cSrcweir -----------------------------------------------*/
56*cdf0e10cSrcweir SequenceAsHashMap::SequenceAsHashMap(const css::uno::Any& aSource)
57*cdf0e10cSrcweir {
58*cdf0e10cSrcweir     (*this) << aSource;
59*cdf0e10cSrcweir }
60*cdf0e10cSrcweir 
61*cdf0e10cSrcweir //-----------------------------------------------
62*cdf0e10cSrcweir SequenceAsHashMap::SequenceAsHashMap(const css::uno::Sequence< css::uno::Any >& lSource)
63*cdf0e10cSrcweir {
64*cdf0e10cSrcweir     (*this) << lSource;
65*cdf0e10cSrcweir }
66*cdf0e10cSrcweir 
67*cdf0e10cSrcweir /*-----------------------------------------------
68*cdf0e10cSrcweir     04.11.2003 08:30
69*cdf0e10cSrcweir -----------------------------------------------*/
70*cdf0e10cSrcweir SequenceAsHashMap::SequenceAsHashMap(const css::uno::Sequence< css::beans::PropertyValue >& lSource)
71*cdf0e10cSrcweir {
72*cdf0e10cSrcweir     (*this) << lSource;
73*cdf0e10cSrcweir }
74*cdf0e10cSrcweir 
75*cdf0e10cSrcweir /*-----------------------------------------------
76*cdf0e10cSrcweir     04.11.2003 08:30
77*cdf0e10cSrcweir -----------------------------------------------*/
78*cdf0e10cSrcweir SequenceAsHashMap::SequenceAsHashMap(const css::uno::Sequence< css::beans::NamedValue >& lSource)
79*cdf0e10cSrcweir {
80*cdf0e10cSrcweir     (*this) << lSource;
81*cdf0e10cSrcweir }
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir /*-----------------------------------------------
84*cdf0e10cSrcweir     04.11.2003 09:04
85*cdf0e10cSrcweir -----------------------------------------------*/
86*cdf0e10cSrcweir SequenceAsHashMap::~SequenceAsHashMap()
87*cdf0e10cSrcweir {
88*cdf0e10cSrcweir }
89*cdf0e10cSrcweir 
90*cdf0e10cSrcweir /*-----------------------------------------------
91*cdf0e10cSrcweir     04.11.2003 10:21
92*cdf0e10cSrcweir -----------------------------------------------*/
93*cdf0e10cSrcweir void SequenceAsHashMap::operator<<(const css::uno::Any& aSource)
94*cdf0e10cSrcweir {
95*cdf0e10cSrcweir     // An empty Any reset this instance!
96*cdf0e10cSrcweir     if (!aSource.hasValue())
97*cdf0e10cSrcweir     {
98*cdf0e10cSrcweir         clear();
99*cdf0e10cSrcweir         return;
100*cdf0e10cSrcweir     }
101*cdf0e10cSrcweir 
102*cdf0e10cSrcweir     css::uno::Sequence< css::beans::NamedValue > lN;
103*cdf0e10cSrcweir     if (aSource >>= lN)
104*cdf0e10cSrcweir     {
105*cdf0e10cSrcweir         (*this) << lN;
106*cdf0e10cSrcweir         return;
107*cdf0e10cSrcweir     }
108*cdf0e10cSrcweir 
109*cdf0e10cSrcweir     css::uno::Sequence< css::beans::PropertyValue > lP;
110*cdf0e10cSrcweir     if (aSource >>= lP)
111*cdf0e10cSrcweir     {
112*cdf0e10cSrcweir         (*this) << lP;
113*cdf0e10cSrcweir         return;
114*cdf0e10cSrcweir     }
115*cdf0e10cSrcweir 
116*cdf0e10cSrcweir     throw css::beans::IllegalTypeException(
117*cdf0e10cSrcweir             ::rtl::OUString::createFromAscii("Any contains wrong type."),
118*cdf0e10cSrcweir             css::uno::Reference< css::uno::XInterface >());
119*cdf0e10cSrcweir }
120*cdf0e10cSrcweir 
121*cdf0e10cSrcweir //-----------------------------------------------
122*cdf0e10cSrcweir void SequenceAsHashMap::operator<<(const css::uno::Sequence< css::uno::Any >& lSource)
123*cdf0e10cSrcweir {
124*cdf0e10cSrcweir     sal_Int32 c = lSource.getLength();
125*cdf0e10cSrcweir     sal_Int32 i = 0;
126*cdf0e10cSrcweir 
127*cdf0e10cSrcweir     for (i=0; i<c; ++i)
128*cdf0e10cSrcweir     {
129*cdf0e10cSrcweir         css::beans::PropertyValue lP;
130*cdf0e10cSrcweir         if (lSource[i] >>= lP)
131*cdf0e10cSrcweir         {
132*cdf0e10cSrcweir             if (
133*cdf0e10cSrcweir                 (!lP.Name.getLength()) ||
134*cdf0e10cSrcweir                 (!lP.Value.hasValue())
135*cdf0e10cSrcweir                )
136*cdf0e10cSrcweir                 throw css::beans::IllegalTypeException(
137*cdf0e10cSrcweir                         ::rtl::OUString::createFromAscii("PropertyValue struct contains no usefull informations."),
138*cdf0e10cSrcweir                         css::uno::Reference< css::uno::XInterface >());
139*cdf0e10cSrcweir             (*this)[lP.Name] = lP.Value;
140*cdf0e10cSrcweir             continue;
141*cdf0e10cSrcweir         }
142*cdf0e10cSrcweir 
143*cdf0e10cSrcweir         css::beans::NamedValue lN;
144*cdf0e10cSrcweir         if (lSource[i] >>= lN)
145*cdf0e10cSrcweir         {
146*cdf0e10cSrcweir             if (
147*cdf0e10cSrcweir                 (!lN.Name.getLength()) ||
148*cdf0e10cSrcweir                 (!lN.Value.hasValue())
149*cdf0e10cSrcweir                )
150*cdf0e10cSrcweir                 throw css::beans::IllegalTypeException(
151*cdf0e10cSrcweir                         ::rtl::OUString::createFromAscii("NamedValue struct contains no usefull informations."),
152*cdf0e10cSrcweir                         css::uno::Reference< css::uno::XInterface >());
153*cdf0e10cSrcweir             (*this)[lN.Name] = lN.Value;
154*cdf0e10cSrcweir             continue;
155*cdf0e10cSrcweir         }
156*cdf0e10cSrcweir 
157*cdf0e10cSrcweir         // ignore VOID Any ... but reject wrong filled ones!
158*cdf0e10cSrcweir         if (lSource[i].hasValue())
159*cdf0e10cSrcweir             throw css::beans::IllegalTypeException(
160*cdf0e10cSrcweir                     ::rtl::OUString::createFromAscii("Any contains wrong type."),
161*cdf0e10cSrcweir                     css::uno::Reference< css::uno::XInterface >());
162*cdf0e10cSrcweir     }
163*cdf0e10cSrcweir }
164*cdf0e10cSrcweir 
165*cdf0e10cSrcweir /*-----------------------------------------------
166*cdf0e10cSrcweir     04.11.2003 08:30
167*cdf0e10cSrcweir -----------------------------------------------*/
168*cdf0e10cSrcweir void SequenceAsHashMap::operator<<(const css::uno::Sequence< css::beans::PropertyValue >& lSource)
169*cdf0e10cSrcweir {
170*cdf0e10cSrcweir     clear();
171*cdf0e10cSrcweir 
172*cdf0e10cSrcweir           sal_Int32                  c       = lSource.getLength();
173*cdf0e10cSrcweir     const css::beans::PropertyValue* pSource = lSource.getConstArray();
174*cdf0e10cSrcweir 
175*cdf0e10cSrcweir     for (sal_Int32 i=0; i<c; ++i)
176*cdf0e10cSrcweir         (*this)[pSource[i].Name] = pSource[i].Value;
177*cdf0e10cSrcweir }
178*cdf0e10cSrcweir 
179*cdf0e10cSrcweir /*-----------------------------------------------
180*cdf0e10cSrcweir     04.11.2003 08:30
181*cdf0e10cSrcweir -----------------------------------------------*/
182*cdf0e10cSrcweir void SequenceAsHashMap::operator<<(const css::uno::Sequence< css::beans::NamedValue >& lSource)
183*cdf0e10cSrcweir {
184*cdf0e10cSrcweir     clear();
185*cdf0e10cSrcweir 
186*cdf0e10cSrcweir           sal_Int32               c       = lSource.getLength();
187*cdf0e10cSrcweir     const css::beans::NamedValue* pSource = lSource.getConstArray();
188*cdf0e10cSrcweir 
189*cdf0e10cSrcweir     for (sal_Int32 i=0; i<c; ++i)
190*cdf0e10cSrcweir         (*this)[pSource[i].Name] = pSource[i].Value;
191*cdf0e10cSrcweir }
192*cdf0e10cSrcweir 
193*cdf0e10cSrcweir /*-----------------------------------------------
194*cdf0e10cSrcweir     04.11.2003 08:30
195*cdf0e10cSrcweir -----------------------------------------------*/
196*cdf0e10cSrcweir void SequenceAsHashMap::operator>>(css::uno::Sequence< css::beans::PropertyValue >& lDestination) const
197*cdf0e10cSrcweir {
198*cdf0e10cSrcweir     sal_Int32 c = (sal_Int32)size();
199*cdf0e10cSrcweir     lDestination.realloc(c);
200*cdf0e10cSrcweir     css::beans::PropertyValue* pDestination = lDestination.getArray();
201*cdf0e10cSrcweir 
202*cdf0e10cSrcweir     sal_Int32 i = 0;
203*cdf0e10cSrcweir     for (const_iterator pThis  = begin();
204*cdf0e10cSrcweir                         pThis != end()  ;
205*cdf0e10cSrcweir                       ++pThis           )
206*cdf0e10cSrcweir     {
207*cdf0e10cSrcweir         pDestination[i].Name  = pThis->first ;
208*cdf0e10cSrcweir         pDestination[i].Value = pThis->second;
209*cdf0e10cSrcweir         ++i;
210*cdf0e10cSrcweir     }
211*cdf0e10cSrcweir }
212*cdf0e10cSrcweir 
213*cdf0e10cSrcweir /*-----------------------------------------------
214*cdf0e10cSrcweir     04.11.2003 08:30
215*cdf0e10cSrcweir -----------------------------------------------*/
216*cdf0e10cSrcweir void SequenceAsHashMap::operator>>(css::uno::Sequence< css::beans::NamedValue >& lDestination) const
217*cdf0e10cSrcweir {
218*cdf0e10cSrcweir     sal_Int32 c = (sal_Int32)size();
219*cdf0e10cSrcweir     lDestination.realloc(c);
220*cdf0e10cSrcweir     css::beans::NamedValue* pDestination = lDestination.getArray();
221*cdf0e10cSrcweir 
222*cdf0e10cSrcweir     sal_Int32 i = 0;
223*cdf0e10cSrcweir     for (const_iterator pThis  = begin();
224*cdf0e10cSrcweir                         pThis != end()  ;
225*cdf0e10cSrcweir                       ++pThis           )
226*cdf0e10cSrcweir     {
227*cdf0e10cSrcweir         pDestination[i].Name  = pThis->first ;
228*cdf0e10cSrcweir         pDestination[i].Value = pThis->second;
229*cdf0e10cSrcweir         ++i;
230*cdf0e10cSrcweir     }
231*cdf0e10cSrcweir }
232*cdf0e10cSrcweir 
233*cdf0e10cSrcweir /*-----------------------------------------------
234*cdf0e10cSrcweir     30.07.2007 14:10
235*cdf0e10cSrcweir -----------------------------------------------*/
236*cdf0e10cSrcweir const css::uno::Any SequenceAsHashMap::getAsConstAny(::sal_Bool bAsPropertyValueList) const
237*cdf0e10cSrcweir {
238*cdf0e10cSrcweir     css::uno::Any aDestination;
239*cdf0e10cSrcweir     if (bAsPropertyValueList)
240*cdf0e10cSrcweir         aDestination = css::uno::makeAny(getAsConstPropertyValueList());
241*cdf0e10cSrcweir     else
242*cdf0e10cSrcweir         aDestination = css::uno::makeAny(getAsConstNamedValueList());
243*cdf0e10cSrcweir     return aDestination;
244*cdf0e10cSrcweir }
245*cdf0e10cSrcweir 
246*cdf0e10cSrcweir /*-----------------------------------------------
247*cdf0e10cSrcweir     30.07.2007 14:10
248*cdf0e10cSrcweir -----------------------------------------------*/
249*cdf0e10cSrcweir const css::uno::Sequence< css::uno::Any > SequenceAsHashMap::getAsConstAnyList(::sal_Bool bAsPropertyValueList) const
250*cdf0e10cSrcweir {
251*cdf0e10cSrcweir     ::sal_Int32                         i            = 0;
252*cdf0e10cSrcweir     ::sal_Int32                         c            = (::sal_Int32)size();
253*cdf0e10cSrcweir     css::uno::Sequence< css::uno::Any > lDestination(c);
254*cdf0e10cSrcweir     css::uno::Any*                      pDestination = lDestination.getArray();
255*cdf0e10cSrcweir 
256*cdf0e10cSrcweir     for (const_iterator pThis  = begin();
257*cdf0e10cSrcweir                         pThis != end()  ;
258*cdf0e10cSrcweir                       ++pThis           )
259*cdf0e10cSrcweir     {
260*cdf0e10cSrcweir         if (bAsPropertyValueList)
261*cdf0e10cSrcweir         {
262*cdf0e10cSrcweir             css::beans::PropertyValue aProp;
263*cdf0e10cSrcweir             aProp.Name      = pThis->first;
264*cdf0e10cSrcweir             aProp.Value     = pThis->second;
265*cdf0e10cSrcweir             pDestination[i] = css::uno::makeAny(aProp);
266*cdf0e10cSrcweir         }
267*cdf0e10cSrcweir         else
268*cdf0e10cSrcweir         {
269*cdf0e10cSrcweir             css::beans::NamedValue aProp;
270*cdf0e10cSrcweir             aProp.Name      = pThis->first;
271*cdf0e10cSrcweir             aProp.Value     = pThis->second;
272*cdf0e10cSrcweir             pDestination[i] = css::uno::makeAny(aProp);
273*cdf0e10cSrcweir         }
274*cdf0e10cSrcweir 
275*cdf0e10cSrcweir         ++i;
276*cdf0e10cSrcweir     }
277*cdf0e10cSrcweir 
278*cdf0e10cSrcweir     return lDestination;
279*cdf0e10cSrcweir }
280*cdf0e10cSrcweir 
281*cdf0e10cSrcweir /*-----------------------------------------------
282*cdf0e10cSrcweir     04.11.2003 08:30
283*cdf0e10cSrcweir -----------------------------------------------*/
284*cdf0e10cSrcweir const css::uno::Sequence< css::beans::NamedValue > SequenceAsHashMap::getAsConstNamedValueList() const
285*cdf0e10cSrcweir {
286*cdf0e10cSrcweir     css::uno::Sequence< css::beans::NamedValue > lReturn;
287*cdf0e10cSrcweir     (*this) >> lReturn;
288*cdf0e10cSrcweir     return lReturn;
289*cdf0e10cSrcweir }
290*cdf0e10cSrcweir 
291*cdf0e10cSrcweir /*-----------------------------------------------
292*cdf0e10cSrcweir     04.11.2003 08:30
293*cdf0e10cSrcweir -----------------------------------------------*/
294*cdf0e10cSrcweir const css::uno::Sequence< css::beans::PropertyValue > SequenceAsHashMap::getAsConstPropertyValueList() const
295*cdf0e10cSrcweir {
296*cdf0e10cSrcweir     css::uno::Sequence< css::beans::PropertyValue > lReturn;
297*cdf0e10cSrcweir     (*this) >> lReturn;
298*cdf0e10cSrcweir     return lReturn;
299*cdf0e10cSrcweir }
300*cdf0e10cSrcweir 
301*cdf0e10cSrcweir /*-----------------------------------------------
302*cdf0e10cSrcweir     07.03.2007 12:45
303*cdf0e10cSrcweir -----------------------------------------------*/
304*cdf0e10cSrcweir sal_Bool SequenceAsHashMap::match(const SequenceAsHashMap& rCheck) const
305*cdf0e10cSrcweir {
306*cdf0e10cSrcweir     const_iterator pCheck;
307*cdf0e10cSrcweir     for (  pCheck  = rCheck.begin();
308*cdf0e10cSrcweir            pCheck != rCheck.end()  ;
309*cdf0e10cSrcweir          ++pCheck                  )
310*cdf0e10cSrcweir     {
311*cdf0e10cSrcweir         const ::rtl::OUString& sCheckName  = pCheck->first;
312*cdf0e10cSrcweir         const css::uno::Any&   aCheckValue = pCheck->second;
313*cdf0e10cSrcweir               const_iterator   pFound      = find(sCheckName);
314*cdf0e10cSrcweir 
315*cdf0e10cSrcweir         if (pFound == end())
316*cdf0e10cSrcweir             return sal_False;
317*cdf0e10cSrcweir 
318*cdf0e10cSrcweir         const css::uno::Any& aFoundValue = pFound->second;
319*cdf0e10cSrcweir         if (aFoundValue != aCheckValue)
320*cdf0e10cSrcweir             return sal_False;
321*cdf0e10cSrcweir     }
322*cdf0e10cSrcweir 
323*cdf0e10cSrcweir     return sal_True;
324*cdf0e10cSrcweir }
325*cdf0e10cSrcweir 
326*cdf0e10cSrcweir /*-----------------------------------------------
327*cdf0e10cSrcweir     30.07.2007 14:30
328*cdf0e10cSrcweir -----------------------------------------------*/
329*cdf0e10cSrcweir void SequenceAsHashMap::update(const SequenceAsHashMap& rUpdate)
330*cdf0e10cSrcweir {
331*cdf0e10cSrcweir     const_iterator pUpdate;
332*cdf0e10cSrcweir     for (  pUpdate  = rUpdate.begin();
333*cdf0e10cSrcweir            pUpdate != rUpdate.end()  ;
334*cdf0e10cSrcweir          ++pUpdate                   )
335*cdf0e10cSrcweir     {
336*cdf0e10cSrcweir         const ::rtl::OUString& sName  = pUpdate->first;
337*cdf0e10cSrcweir         const css::uno::Any&   aValue = pUpdate->second;
338*cdf0e10cSrcweir 
339*cdf0e10cSrcweir         (*this)[sName] = aValue;
340*cdf0e10cSrcweir     }
341*cdf0e10cSrcweir }
342*cdf0e10cSrcweir 
343*cdf0e10cSrcweir /*-----------------------------------------------
344*cdf0e10cSrcweir     04.11.2003 08:30
345*cdf0e10cSrcweir -----------------------------------------------*/
346*cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1
347*cdf0e10cSrcweir void SequenceAsHashMap::dbg_dumpToFile(const char* pFileName,
348*cdf0e10cSrcweir                                        const char* pComment ) const
349*cdf0e10cSrcweir {
350*cdf0e10cSrcweir     if (!pFileName || !pComment)
351*cdf0e10cSrcweir         return;
352*cdf0e10cSrcweir 
353*cdf0e10cSrcweir     FILE* pFile = fopen(pFileName, "a");
354*cdf0e10cSrcweir     if (!pFile)
355*cdf0e10cSrcweir         return;
356*cdf0e10cSrcweir 
357*cdf0e10cSrcweir     ::rtl::OUStringBuffer sBuffer(1000);
358*cdf0e10cSrcweir     sBuffer.appendAscii("\n----------------------------------------\n");
359*cdf0e10cSrcweir     sBuffer.appendAscii(pComment                                      );
360*cdf0e10cSrcweir     sBuffer.appendAscii("\n----------------------------------------\n");
361*cdf0e10cSrcweir     sal_Int32 i = 0;
362*cdf0e10cSrcweir     for (const_iterator pIt  = begin();
363*cdf0e10cSrcweir                         pIt != end()  ;
364*cdf0e10cSrcweir                       ++pIt           )
365*cdf0e10cSrcweir     {
366*cdf0e10cSrcweir         sBuffer.appendAscii("["       );
367*cdf0e10cSrcweir         sBuffer.append     (i++       );
368*cdf0e10cSrcweir         sBuffer.appendAscii("] "      );
369*cdf0e10cSrcweir         sBuffer.appendAscii("\""      );
370*cdf0e10cSrcweir         sBuffer.append     (pIt->first);
371*cdf0e10cSrcweir         sBuffer.appendAscii("\" = \"" );
372*cdf0e10cSrcweir 
373*cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xv;
374*cdf0e10cSrcweir         ::rtl::OUString                                                       sv;
375*cdf0e10cSrcweir         sal_Int32                                                             nv;
376*cdf0e10cSrcweir         sal_Bool                                                              bv;
377*cdf0e10cSrcweir 
378*cdf0e10cSrcweir         if (pIt->second >>= sv)
379*cdf0e10cSrcweir             sBuffer.append(sv);
380*cdf0e10cSrcweir         else
381*cdf0e10cSrcweir         if (pIt->second >>= nv)
382*cdf0e10cSrcweir             sBuffer.append(nv);
383*cdf0e10cSrcweir         else
384*cdf0e10cSrcweir         if (pIt->second >>= bv)
385*cdf0e10cSrcweir             sBuffer.appendAscii(bv ? "true" : "false");
386*cdf0e10cSrcweir         else
387*cdf0e10cSrcweir         if (pIt->second >>= xv)
388*cdf0e10cSrcweir             sBuffer.appendAscii(xv.is() ? "object" : "null");
389*cdf0e10cSrcweir         else
390*cdf0e10cSrcweir             sBuffer.appendAscii("???");
391*cdf0e10cSrcweir 
392*cdf0e10cSrcweir         sBuffer.appendAscii("\"\n");
393*cdf0e10cSrcweir     }
394*cdf0e10cSrcweir 
395*cdf0e10cSrcweir     fprintf(pFile, ::rtl::OUStringToOString(sBuffer.makeStringAndClear(), RTL_TEXTENCODING_UTF8).getStr());
396*cdf0e10cSrcweir     fclose(pFile);
397*cdf0e10cSrcweir }
398*cdf0e10cSrcweir #endif // OSL_DEBUG_LEVEL > 1
399*cdf0e10cSrcweir 
400*cdf0e10cSrcweir } // namespace comphelper
401