1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef __DBGOUTSW_HXX
20 #define __DBGOUTSW_HXX
24 #include <boost/unordered_map.hpp>
49 extern bool bDbgOutStdErr
;
50 extern bool bDbgOutPrintAttrSet
;
52 SW_DLLPUBLIC
const char * dbg_out(const void * pVoid
);
53 SW_DLLPUBLIC
const char * dbg_out(const String
& aStr
);
54 SW_DLLPUBLIC
const char * dbg_out(const OUString
& aStr
);
55 SW_DLLPUBLIC
const char * dbg_out(const SwRect
& rRect
);
56 SW_DLLPUBLIC
const char * dbg_out(const SwFrmFmt
& rFrmFmt
);
57 SW_DLLPUBLIC
const char * dbg_out(const SwNode
& rNode
);
58 SW_DLLPUBLIC
const char * dbg_out(const SwTxtAttr
& rAttr
);
59 SW_DLLPUBLIC
const char * dbg_out(const SwpHints
&rHints
);
60 SW_DLLPUBLIC
const char * dbg_out(const SfxPoolItem
& rItem
);
61 SW_DLLPUBLIC
const char * dbg_out(const SfxPoolItem
* pItem
);
62 SW_DLLPUBLIC
const char * dbg_out(const SfxItemSet
& rSet
);
63 SW_DLLPUBLIC
const char * dbg_out(SwNodes
& rNodes
);
64 SW_DLLPUBLIC
const char * dbg_out(const SwPosition
& rPos
);
65 SW_DLLPUBLIC
const char * dbg_out(const SwPaM
& rPam
);
66 SW_DLLPUBLIC
const char * dbg_out(const SwNodeNum
& rNum
);
67 SW_DLLPUBLIC
const char * dbg_out(const SwUndo
& rUndo
);
68 SW_DLLPUBLIC
const char * dbg_out(const SwRewriter
& rRewriter
);
69 SW_DLLPUBLIC
const char * dbg_out(const SwNumRule
& rRule
);
70 SW_DLLPUBLIC
const char * dbg_out(const SwTxtFmtColl
& rFmt
);
71 SW_DLLPUBLIC
const char * dbg_out(const SwFrmFmts
& rFrmFmts
);
72 SW_DLLPUBLIC
const char * dbg_out(const SwNumRuleTbl
& rTbl
);
73 SW_DLLPUBLIC
const char * dbg_out(const SwNodeRange
& rRange
);
75 template<typename tKey
, typename tMember
, typename fHashFunction
>
76 String
lcl_dbg_out(const boost::unordered_map
<tKey
, tMember
, fHashFunction
> & rMap
)
78 String
aResult("[", RTL_TEXTENCODING_ASCII_US
);
80 typename
boost::unordered_map
<tKey
, tMember
, fHashFunction
>::const_iterator aIt
;
82 for (aIt
= rMap
.begin(); aIt
!= rMap
.end(); aIt
++)
84 if (aIt
!= rMap
.begin())
85 aResult
+= String(", ", RTL_TEXTENCODING_ASCII_US
);
87 aResult
+= aIt
->first
;
90 sprintf(sBuffer
, "(%p)", aIt
->second
);
91 aResult
+= String(sBuffer
, RTL_TEXTENCODING_ASCII_US
);
94 aResult
+= String("]", RTL_TEXTENCODING_ASCII_US
);
99 template<typename tKey
, typename tMember
, typename fHashFunction
>
100 const char * dbg_out(const boost::unordered_map
<tKey
, tMember
, fHashFunction
> & rMap
)
102 return dbg_out(lcl_dbg_out(rMap
));
104 SW_DLLPUBLIC
const char * dbg_out(const SwFormToken
& rToken
);
105 SW_DLLPUBLIC
const char * dbg_out(const SwFormTokens
& rTokens
);
107 #endif // __DBGOUTSW_HXX
109 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */