bump product version to 4.1.6.2
[LibreOffice.git] / sw / inc / dbgoutsw.hxx
blobbd01dad8751261dda5674ebb67d9424cb25e48e7
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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
22 #ifdef DBG_UTIL
24 #include <boost/unordered_map.hpp>
25 #include <tox.hxx>
26 #include <cstdio>
27 class String;
29 class SwNode;
30 class SwTxtAttr;
31 class SwpHints;
32 class SfxPoolItem;
33 class SfxItemSet;
34 struct SwPosition;
35 class SwPaM;
36 class SwNodeNum;
37 class SwUndo;
38 class SwRect;
39 class SwFrmFmt;
40 class SwFrmFmts;
41 class SwNodes;
42 class SwRewriter;
43 class SwNumRuleTbl;
44 class SwNumRule;
45 class SwOutlineNodes;
46 class SwTxtFmtColl;
47 class SwNodeRange;
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;
89 char sBuffer[256];
90 sprintf(sBuffer, "(%p)", aIt->second);
91 aResult += String(sBuffer, RTL_TEXTENCODING_ASCII_US);
94 aResult += String("]", RTL_TEXTENCODING_ASCII_US);
96 return aResult;
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);
106 #endif // DBG_UTIL
107 #endif // __DBGOUTSW_HXX
109 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */