diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-07-13 21:05:35 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-07-14 15:26:04 +0100 |
commit | 3e6685165995d25ea6028d569c68714a02ee9ca3 (patch) | |
tree | 5ab49e814fd13993957892a8a7c5536806b44aec /l10ntools | |
parent | 0206aafdb9b9076b58b46eaeaecccbff832a8182 (diff) |
set Dump methods to ultra-verbose debug-mode
Diffstat (limited to 'l10ntools')
-rw-r--r-- | l10ntools/inc/helpmerge.hxx | 12 | ||||
-rw-r--r-- | l10ntools/source/helpmerge.cxx | 27 |
2 files changed, 22 insertions, 17 deletions
diff --git a/l10ntools/inc/helpmerge.hxx b/l10ntools/inc/helpmerge.hxx index e2ec54daa637..40ca25dac877 100644 --- a/l10ntools/inc/helpmerge.hxx +++ b/l10ntools/inc/helpmerge.hxx @@ -48,13 +48,13 @@ private: /// @PRECOND 0 < langIdx_in < MAX_IDX static void FillInFallbacks( LangHashMap& rElem_out, ByteString sLangIdx_in ); -/// Debugmethod, prints the content of the map to stdout - static void Dump( LangHashMap* rElem_in , const ByteString sKey_in ); - -/// Debugmethod, prints the content of the map to stdout - static void Dump( XMLHashMap* rElem_in ) ; - +#if OSL_DEBUG_LEVEL > 2 + /// Debugmethod, prints the content of the map to stdout + static void Dump(LangHashMap* rElem_in , const ByteString sKey_in); + /// Debugmethod, prints the content of the map to stdout + static void Dump(XMLHashMap* rElem_in); +#endif public: HelpParser( const ByteString &rHelpFile, bool bUTF8 , bool bHasInputList ); diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx index 5a0ffa193edd..b576e1fb8781 100644 --- a/l10ntools/source/helpmerge.cxx +++ b/l10ntools/source/helpmerge.cxx @@ -88,26 +88,29 @@ void HelpParser::FillInFallbacks( LangHashMap& rElem_out, ByteString sLangIdx_in } } -/*****************************************************************************/ -void HelpParser::Dump(XMLHashMap* rElem_in) { -/*****************************************************************************/ - for(XMLHashMap::iterator pos = rElem_in->begin();pos != rElem_in->end(); ++pos){ +#if OSL_DEBUG_LEVEL > 2 +void HelpParser::Dump(XMLHashMap* rElem_in) +{ + for(XMLHashMap::iterator pos = rElem_in->begin();pos != rElem_in->end(); ++pos) + { Dump(pos->second,pos->first); } } -/*****************************************************************************/ -void HelpParser::Dump(LangHashMap* rElem_in,const ByteString sKey_in) { -/*****************************************************************************/ + +void HelpParser::Dump(LangHashMap* rElem_in,const ByteString sKey_in) +{ ByteString x; OString y; fprintf(stdout,"+------------%s-----------+\n",sKey_in.GetBuffer() ); - for(LangHashMap::iterator posn=rElem_in->begin();posn!=rElem_in->end();++posn){ + for(LangHashMap::iterator posn=rElem_in->begin();posn!=rElem_in->end();++posn) + { x=posn->first; y=posn->second->ToOString(); fprintf(stdout,"key=%s value=%s\n",x.GetBuffer(),y.getStr()); } fprintf(stdout,"+--------------------------+\n"); } +#endif HelpParser::HelpParser( const ByteString &rHelpFile, bool rUTF8 , bool rHasInputList ) : sHelpFile( rHelpFile ), @@ -436,9 +439,11 @@ bool HelpParser::MergeSingleFile( XMLFile* file , MergeDataFile& aMergeDataFile { aLangHM = pos->second; - //printf("*********************DUMPING HASHMAP***************************************"); - //Dump( aXMLStrHM ); - //printf("DBG: sHelpFile = %s\n",sHelpFile.GetBuffer() ); +#if OSL_DEBUG_LEVEL > 2 + printf("*********************DUMPING HASHMAP***************************************"); + Dump(aXMLStrHM); + printf("DBG: sHelpFile = %s\n",sHelpFile.GetBuffer() ); +#endif pResData.sGId = pos->first; pResData.sFilename = sHelpFile; |