Author: jani Date: Sat Feb 9 09:31:28 2013 New Revision: 1444346 URL: http://svn.apache.org/r1444346 Log: need to make lex for ulf files
Modified: openoffice/branches/l10n/main/l10ntools/source/gCon.cxx openoffice/branches/l10n/main/l10ntools/source/gConHrc.cxx openoffice/branches/l10n/main/l10ntools/source/gConHrc.hxx openoffice/branches/l10n/main/l10ntools/source/gConPo.cxx openoffice/branches/l10n/main/l10ntools/source/gConPo.hxx openoffice/branches/l10n/main/l10ntools/source/gConProp.cxx openoffice/branches/l10n/main/l10ntools/source/gConSrc.cxx openoffice/branches/l10n/main/l10ntools/source/gConSrc.hxx openoffice/branches/l10n/main/l10ntools/source/gConSrcWrap.cxx openoffice/branches/l10n/main/l10ntools/source/gConSrclex.l openoffice/branches/l10n/main/l10ntools/source/gConTree.cxx openoffice/branches/l10n/main/l10ntools/source/gConUlf.cxx openoffice/branches/l10n/main/l10ntools/source/gConXcs.cxx openoffice/branches/l10n/main/l10ntools/source/gConXcs.hxx openoffice/branches/l10n/main/l10ntools/source/gConXcu.cxx openoffice/branches/l10n/main/l10ntools/source/gConXcu.hxx openoffice/branches/l10n/main/l10ntools/source/gConXhp.cxx openoffice/branches/l10n/main/l10ntools/source/gConXhp.hxx openoffice/branches/l10n/main/l10ntools/source/gConXrm.cxx openoffice/branches/l10n/main/l10ntools/source/gConXrm.hxx openoffice/branches/l10n/main/l10ntools/source/gHandler.cxx openoffice/branches/l10n/main/l10ntools/source/gLang.hxx Modified: openoffice/branches/l10n/main/l10ntools/source/gCon.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gCon.cxx?rev=1444346&r1=1444345&r2=1444346&view=diff ============================================================================== --- openoffice/branches/l10n/main/l10ntools/source/gCon.cxx (original) +++ openoffice/branches/l10n/main/l10ntools/source/gCon.cxx Sat Feb 9 09:31:28 2013 @@ -32,8 +32,9 @@ /********************** I M P L E M E N T A T I O N **********************/ -convert_gen::convert_gen(const std::string& srSourceFile, l10nMem& crMemory) +convert_gen::convert_gen(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose) : msSourceFile(srSourceFile), + mbVerbose(brVerbose), mcMemory(crMemory) { std::ifstream inputFile(msSourceFile.c_str(), std::ios::binary); @@ -65,7 +66,7 @@ convert_gen::~convert_gen() /********************** I M P L E M E N T A T I O N **********************/ -convert_gen& convert_gen::getConverter(const std::string& srSourceFile, l10nMem& crMemory) +convert_gen& convert_gen::getConverter(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose) { // did the user give a .xxx with the source file ? int nInx = srSourceFile.find_last_of("."); @@ -76,16 +77,16 @@ convert_gen& convert_gen::getConverter(c std::string sExtension = srSourceFile.substr(nInx+1); // did the user give a .xxx with the source file ? - if (sExtension == "hrc") return *(new convert_hrc (srSourceFile, crMemory)); - if (sExtension == "src") return *(new convert_src (srSourceFile, crMemory)); - if (sExtension == "po") return *(new convert_po (srSourceFile, crMemory)); - if (sExtension == "tree") return *(new convert_tree (srSourceFile, crMemory)); - if (sExtension == "ulf") return *(new convert_ulf (srSourceFile, crMemory)); - if (sExtension == "xcu") return *(new convert_xcu (srSourceFile, crMemory)); - if (sExtension == "xcs") return *(new convert_xcs (srSourceFile, crMemory)); - if (sExtension == "xrm") return *(new convert_xrm (srSourceFile, crMemory)); - if (sExtension == "xhp") return *(new convert_xhp (srSourceFile, crMemory)); - if (sExtension == "properties") return *(new convert_properties(srSourceFile, crMemory)); + if (sExtension == "hrc") return *(new convert_hrc (srSourceFile, crMemory, brVerbose)); + if (sExtension == "src") return *(new convert_src (srSourceFile, crMemory, brVerbose)); + if (sExtension == "po") return *(new convert_po (srSourceFile, crMemory, brVerbose)); + if (sExtension == "tree") return *(new convert_tree (srSourceFile, crMemory, brVerbose)); + if (sExtension == "ulf") return *(new convert_ulf (srSourceFile, crMemory, brVerbose)); + if (sExtension == "xcu") return *(new convert_xcu (srSourceFile, crMemory, brVerbose)); + if (sExtension == "xcs") return *(new convert_xcs (srSourceFile, crMemory, brVerbose)); + if (sExtension == "xrm") return *(new convert_xrm (srSourceFile, crMemory, brVerbose)); + if (sExtension == "xhp") return *(new convert_xhp (srSourceFile, crMemory, brVerbose)); + if (sExtension == "properties") return *(new convert_properties(srSourceFile, crMemory, brVerbose)); throw std::string("unknown extension on source file: ")+srSourceFile; } Modified: openoffice/branches/l10n/main/l10ntools/source/gConHrc.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConHrc.cxx?rev=1444346&r1=1444345&r2=1444346&view=diff ============================================================================== --- openoffice/branches/l10n/main/l10ntools/source/gConHrc.cxx (original) +++ openoffice/branches/l10n/main/l10ntools/source/gConHrc.cxx Sat Feb 9 09:31:28 2013 @@ -37,9 +37,9 @@ convert_hrc_impl * convert_hrc::mcpImpl; /************ I N T E R F A C E I M P L E M E N T A T I O N ************/ -convert_hrc::convert_hrc(const std::string& srSourceFile, l10nMem& crMemory) - : convert_gen(srSourceFile, crMemory) - {mcpImpl = new convert_hrc_impl(srSourceFile, crMemory);} +convert_hrc::convert_hrc(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose) + : convert_gen(srSourceFile, crMemory, brVerbose) + {mcpImpl = new convert_hrc_impl(srSourceFile, crMemory, brVerbose);} convert_hrc::~convert_hrc() {delete mcpImpl;} void convert_hrc::extract() {mcpImpl->extract();} void convert_hrc::insert() {mcpImpl->insert();} @@ -47,8 +47,8 @@ void convert_hrc::insert() {mcpImpl->in /********************** I M P L E M E N T A T I O N **********************/ -convert_hrc_impl::convert_hrc_impl(const std::string& srSourceFile, l10nMem& crMemory) - : convert_gen(srSourceFile, crMemory) +convert_hrc_impl::convert_hrc_impl(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose) + : convert_gen(srSourceFile, crMemory, brVerbose) { } Modified: openoffice/branches/l10n/main/l10ntools/source/gConHrc.hxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConHrc.hxx?rev=1444346&r1=1444345&r2=1444346&view=diff ============================================================================== --- openoffice/branches/l10n/main/l10ntools/source/gConHrc.hxx (original) +++ openoffice/branches/l10n/main/l10ntools/source/gConHrc.hxx Sat Feb 9 09:31:28 2013 @@ -36,7 +36,7 @@ class convert_hrc_impl : public convert_gen { public: - convert_hrc_impl(const std::string& srSourceFile, l10nMem& crMemory); + convert_hrc_impl(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose); ~convert_hrc_impl(); void setKey(std::string &sText); Modified: openoffice/branches/l10n/main/l10ntools/source/gConPo.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConPo.cxx?rev=1444346&r1=1444345&r2=1444346&view=diff ============================================================================== --- openoffice/branches/l10n/main/l10ntools/source/gConPo.cxx (original) +++ openoffice/branches/l10n/main/l10ntools/source/gConPo.cxx Sat Feb 9 09:31:28 2013 @@ -36,9 +36,9 @@ convert_po_impl * convert_po::mcpImpl; /************ I N T E R F A C E I M P L E M E N T A T I O N ************/ -convert_po::convert_po(const std::string& srSourceFile, l10nMem& crMemory) - : convert_gen(srSourceFile, crMemory) - {mcpImpl = new convert_po_impl(srSourceFile, crMemory);} +convert_po::convert_po(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose) + : convert_gen(srSourceFile, crMemory, brVerbose) + {mcpImpl = new convert_po_impl(srSourceFile, crMemory, brVerbose);} convert_po::~convert_po() {delete mcpImpl;} void convert_po::extract() {mcpImpl->extract();} void convert_po::insert() {mcpImpl->insert();} @@ -62,8 +62,8 @@ po_stack_entry::~po_stack_entry() /********************** I M P L E M E N T A T I O N **********************/ -convert_po_impl::convert_po_impl(const std::string& srSourceFile, l10nMem& crMemory) - : convert_gen (srSourceFile, crMemory), +convert_po_impl::convert_po_impl(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose) + : convert_gen (srSourceFile, crMemory, brVerbose), mbCollectingData(false) { Modified: openoffice/branches/l10n/main/l10ntools/source/gConPo.hxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConPo.hxx?rev=1444346&r1=1444345&r2=1444346&view=diff ============================================================================== --- openoffice/branches/l10n/main/l10ntools/source/gConPo.hxx (original) +++ openoffice/branches/l10n/main/l10ntools/source/gConPo.hxx Sat Feb 9 09:31:28 2013 @@ -53,7 +53,7 @@ class po_stack_entry; class convert_po_impl : public convert_gen { public: - convert_po_impl(const std::string& srSourceFile, l10nMem& crMemory); + convert_po_impl(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose); ~convert_po_impl(); void pushKeyPart(TAG_TYPE eIsNode, std::string &sTag); Modified: openoffice/branches/l10n/main/l10ntools/source/gConProp.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConProp.cxx?rev=1444346&r1=1444345&r2=1444346&view=diff ============================================================================== --- openoffice/branches/l10n/main/l10ntools/source/gConProp.cxx (original) +++ openoffice/branches/l10n/main/l10ntools/source/gConProp.cxx Sat Feb 9 09:31:28 2013 @@ -31,8 +31,8 @@ /********************** I M P L E M E N T A T I O N **********************/ -convert_properties::convert_properties(const std::string& srSourceFile, l10nMem& crMemory) - : convert_gen(srSourceFile, crMemory) +convert_properties::convert_properties(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose) + : convert_gen(srSourceFile, crMemory, brVerbose) { throw std::string("convert_properties not implemented"); } Modified: openoffice/branches/l10n/main/l10ntools/source/gConSrc.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConSrc.cxx?rev=1444346&r1=1444345&r2=1444346&view=diff ============================================================================== --- openoffice/branches/l10n/main/l10ntools/source/gConSrc.cxx (original) +++ openoffice/branches/l10n/main/l10ntools/source/gConSrc.cxx Sat Feb 9 09:31:28 2013 @@ -37,9 +37,9 @@ convert_src_impl * convert_src::mcpImpl; /************ I N T E R F A C E I M P L E M E N T A T I O N ************/ -convert_src::convert_src(const std::string& srSourceFile, l10nMem& crMemory) - : convert_gen(srSourceFile, crMemory) - {mcpImpl = new convert_src_impl(srSourceFile, crMemory);} +convert_src::convert_src(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose) + : convert_gen(srSourceFile, crMemory, brVerbose) + {mcpImpl = new convert_src_impl(srSourceFile, crMemory, brVerbose);} convert_src::~convert_src() {delete mcpImpl;} void convert_src::extract() {mcpImpl->extract();} void convert_src::insert() {mcpImpl->insert();} @@ -47,8 +47,8 @@ void convert_src::insert() {mcpImpl->in /********************** I M P L E M E N T A T I O N **********************/ -convert_src_impl::convert_src_impl(const std::string& srSourceFile, l10nMem& crMemory) - : convert_gen(srSourceFile, crMemory) +convert_src_impl::convert_src_impl(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose) + : convert_gen(srSourceFile, crMemory, brVerbose) { } Modified: openoffice/branches/l10n/main/l10ntools/source/gConSrc.hxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConSrc.hxx?rev=1444346&r1=1444345&r2=1444346&view=diff ============================================================================== --- openoffice/branches/l10n/main/l10ntools/source/gConSrc.hxx (original) +++ openoffice/branches/l10n/main/l10ntools/source/gConSrc.hxx Sat Feb 9 09:31:28 2013 @@ -37,7 +37,7 @@ class convert_src_impl : public convert_gen { public: - convert_src_impl(const std::string& srSourceFile, l10nMem& crMemory); + convert_src_impl(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose); ~convert_src_impl(); void pushKey(std::string &sText); Modified: openoffice/branches/l10n/main/l10ntools/source/gConSrcWrap.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConSrcWrap.cxx?rev=1444346&r1=1444345&r2=1444346&view=diff ============================================================================== --- openoffice/branches/l10n/main/l10ntools/source/gConSrcWrap.cxx (original) +++ openoffice/branches/l10n/main/l10ntools/source/gConSrcWrap.cxx Sat Feb 9 09:31:28 2013 @@ -129,14 +129,17 @@ void convert_src_impl::saveData(std::str writeSourceFile(msCollector + sText); msCollector.clear(); + // Is it a real text + if (sText.find('\"') == std::string::npos) + return; + // locate key and extract it for (nL = 0; nL < (int)mcStack.size(); ++nL) sKey += (nL > 0 ? "." : "") + mcStack[nL]; // locate id - for (nL = 0; sText[nL] != '=' && sText[nL] != '\n'; ++nL) ; - for (; sText[nL] != '\"'; ++nL) ; - for (nE = nL+1; sText[nE] != '\"'; ++nE) ; + for (nL = 0; sText[nL] != '\"' && nL < (int)sText.size(); ++nL) ; + for (nE = sText.size()-1; sText[nE] != '\"' && nE > nL; --nE) ; sUseText = sText.substr(nL+1, nE - nL -1); if (mbMergeMode) Modified: openoffice/branches/l10n/main/l10ntools/source/gConSrclex.l URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConSrclex.l?rev=1444346&r1=1444345&r2=1444346&view=diff ============================================================================== --- openoffice/branches/l10n/main/l10ntools/source/gConSrclex.l (original) +++ openoffice/branches/l10n/main/l10ntools/source/gConSrclex.l Sat Feb 9 09:31:28 2013 @@ -99,7 +99,7 @@ convert_src::mcpImpl->registerKey(text); } -[tT][eE][xX][tT][^\"]*"\""[^\"]*"\";" { +[tT][eE][xX][tT][^\n]* { std::string text(yytext); convert_src::mcpImpl->saveData(text); } Modified: openoffice/branches/l10n/main/l10ntools/source/gConTree.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConTree.cxx?rev=1444346&r1=1444345&r2=1444346&view=diff ============================================================================== --- openoffice/branches/l10n/main/l10ntools/source/gConTree.cxx (original) +++ openoffice/branches/l10n/main/l10ntools/source/gConTree.cxx Sat Feb 9 09:31:28 2013 @@ -31,8 +31,8 @@ /********************** I M P L E M E N T A T I O N **********************/ -convert_tree::convert_tree(const std::string& srSourceFile, l10nMem& crMemory) - : convert_gen(srSourceFile, crMemory) +convert_tree::convert_tree(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose) + : convert_gen(srSourceFile, crMemory, brVerbose) { // extension, program, parameter, collectMode, xxx // ".tree", "xhtex", "", "negative", "noiso" Modified: openoffice/branches/l10n/main/l10ntools/source/gConUlf.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConUlf.cxx?rev=1444346&r1=1444345&r2=1444346&view=diff ============================================================================== --- openoffice/branches/l10n/main/l10ntools/source/gConUlf.cxx (original) +++ openoffice/branches/l10n/main/l10ntools/source/gConUlf.cxx Sat Feb 9 09:31:28 2013 @@ -31,8 +31,8 @@ /********************** I M P L E M E N T A T I O N **********************/ -convert_ulf::convert_ulf(const std::string& srSourceFile, l10nMem& crMemory) - : convert_gen(srSourceFile, crMemory) +convert_ulf::convert_ulf(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose) + : convert_gen(srSourceFile, crMemory, brVerbose) { } @@ -110,7 +110,9 @@ void convert_ulf::handleLines() // remove leading/trailing blanks and handle empty lines trim(sWorkLine); - if (!sWorkLine.size()) + if (!sWorkLine.size() || + ((int)sWorkLine.size() == 1 && + (sWorkLine[0] == ' ' || sWorkLine[0] == '\t'))) continue; // the format is: Modified: openoffice/branches/l10n/main/l10ntools/source/gConXcs.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXcs.cxx?rev=1444346&r1=1444345&r2=1444346&view=diff ============================================================================== --- openoffice/branches/l10n/main/l10ntools/source/gConXcs.cxx (original) +++ openoffice/branches/l10n/main/l10ntools/source/gConXcs.cxx Sat Feb 9 09:31:28 2013 @@ -36,9 +36,9 @@ convert_xcs_impl * convert_xcs::mcpImpl; /************ I N T E R F A C E I M P L E M E N T A T I O N ************/ -convert_xcs::convert_xcs(const std::string& srSourceFile, l10nMem& crMemory) - : convert_gen(srSourceFile, crMemory) - {mcpImpl = new convert_xcs_impl(srSourceFile, crMemory);} +convert_xcs::convert_xcs(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose) + : convert_gen(srSourceFile, crMemory, brVerbose) + {mcpImpl = new convert_xcs_impl(srSourceFile, crMemory, brVerbose);} convert_xcs::~convert_xcs() {delete mcpImpl;} void convert_xcs::extract() {mcpImpl->extract();} void convert_xcs::insert() {mcpImpl->insert();} @@ -46,8 +46,8 @@ void convert_xcs::insert() {mcpImpl->in /********************** I M P L E M E N T A T I O N **********************/ -convert_xcs_impl::convert_xcs_impl(const std::string& srSourceFile, l10nMem& crMemory) - : convert_gen (srSourceFile, crMemory), +convert_xcs_impl::convert_xcs_impl(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose) + : convert_gen (srSourceFile, crMemory, brVerbose), mbCollectingData(false) { } Modified: openoffice/branches/l10n/main/l10ntools/source/gConXcs.hxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXcs.hxx?rev=1444346&r1=1444345&r2=1444346&view=diff ============================================================================== --- openoffice/branches/l10n/main/l10ntools/source/gConXcs.hxx (original) +++ openoffice/branches/l10n/main/l10ntools/source/gConXcs.hxx Sat Feb 9 09:31:28 2013 @@ -36,7 +36,7 @@ class convert_xcs_impl : public convert_gen { public: - convert_xcs_impl(const std::string& srSourceFile, l10nMem& crMemory); + convert_xcs_impl(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose); ~convert_xcs_impl(); void setKey(std::string &sCollectedText); Modified: openoffice/branches/l10n/main/l10ntools/source/gConXcu.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXcu.cxx?rev=1444346&r1=1444345&r2=1444346&view=diff ============================================================================== --- openoffice/branches/l10n/main/l10ntools/source/gConXcu.cxx (original) +++ openoffice/branches/l10n/main/l10ntools/source/gConXcu.cxx Sat Feb 9 09:31:28 2013 @@ -36,9 +36,9 @@ convert_xcu_impl * convert_xcu::mcpImpl; /************ I N T E R F A C E I M P L E M E N T A T I O N ************/ -convert_xcu::convert_xcu(const std::string& srSourceFile, l10nMem& crMemory) - : convert_gen(srSourceFile, crMemory) - {mcpImpl = new convert_xcu_impl(srSourceFile, crMemory);} +convert_xcu::convert_xcu(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose) + : convert_gen(srSourceFile, crMemory, brVerbose) + {mcpImpl = new convert_xcu_impl(srSourceFile, crMemory, brVerbose);} convert_xcu::~convert_xcu() {delete mcpImpl;} void convert_xcu::extract() {mcpImpl->extract();} void convert_xcu::insert() {mcpImpl->insert();} @@ -46,8 +46,8 @@ void convert_xcu::insert() {mcpImpl->in /********************** I M P L E M E N T A T I O N **********************/ -convert_xcu_impl::convert_xcu_impl(const std::string& srSourceFile, l10nMem& crMemory) - : convert_gen (srSourceFile, crMemory), +convert_xcu_impl::convert_xcu_impl(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose) + : convert_gen (srSourceFile, crMemory, brVerbose), mbCollectingData(false) { Modified: openoffice/branches/l10n/main/l10ntools/source/gConXcu.hxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXcu.hxx?rev=1444346&r1=1444345&r2=1444346&view=diff ============================================================================== --- openoffice/branches/l10n/main/l10ntools/source/gConXcu.hxx (original) +++ openoffice/branches/l10n/main/l10ntools/source/gConXcu.hxx Sat Feb 9 09:31:28 2013 @@ -39,7 +39,7 @@ class xcu_stack_entry; class convert_xcu_impl : public convert_gen { public: - convert_xcu_impl(const std::string& srSourceFile, l10nMem& crMemory); + convert_xcu_impl(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose); ~convert_xcu_impl(); void pushKeyPart(TAG_TYPE eIsNode, std::string &sTag); Modified: openoffice/branches/l10n/main/l10ntools/source/gConXhp.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXhp.cxx?rev=1444346&r1=1444345&r2=1444346&view=diff ============================================================================== --- openoffice/branches/l10n/main/l10ntools/source/gConXhp.cxx (original) +++ openoffice/branches/l10n/main/l10ntools/source/gConXhp.cxx Sat Feb 9 09:31:28 2013 @@ -36,9 +36,9 @@ convert_xhp_impl * convert_xhp::mcpImpl; /************ I N T E R F A C E I M P L E M E N T A T I O N ************/ -convert_xhp::convert_xhp(const std::string& srSourceFile, l10nMem& crMemory) - : convert_gen(srSourceFile, crMemory) - {mcpImpl = new convert_xhp_impl(srSourceFile, crMemory);} +convert_xhp::convert_xhp(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose) + : convert_gen(srSourceFile, crMemory, brVerbose) + {mcpImpl = new convert_xhp_impl(srSourceFile, crMemory, brVerbose);} convert_xhp::~convert_xhp() {delete mcpImpl;} void convert_xhp::extract() {mcpImpl->extract();} void convert_xhp::insert() {mcpImpl->insert();} @@ -46,8 +46,8 @@ void convert_xhp::insert() {mcpImpl->in /********************** I M P L E M E N T A T I O N **********************/ -convert_xhp_impl::convert_xhp_impl(const std::string& srSourceFile, l10nMem& crMemory) - : convert_gen (srSourceFile, crMemory), +convert_xhp_impl::convert_xhp_impl(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose) + : convert_gen (srSourceFile, crMemory, brVerbose), mbCollectingData(false) { } Modified: openoffice/branches/l10n/main/l10ntools/source/gConXhp.hxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXhp.hxx?rev=1444346&r1=1444345&r2=1444346&view=diff ============================================================================== --- openoffice/branches/l10n/main/l10ntools/source/gConXhp.hxx (original) +++ openoffice/branches/l10n/main/l10ntools/source/gConXhp.hxx Sat Feb 9 09:31:28 2013 @@ -36,7 +36,7 @@ class convert_xhp_impl : public convert_gen { public: - convert_xhp_impl(const std::string& srSourceFile, l10nMem& crMemory); + convert_xhp_impl(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose); ~convert_xhp_impl(); void startCollectData(std::string sType, std::string& sCollectedText); Modified: openoffice/branches/l10n/main/l10ntools/source/gConXrm.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXrm.cxx?rev=1444346&r1=1444345&r2=1444346&view=diff ============================================================================== --- openoffice/branches/l10n/main/l10ntools/source/gConXrm.cxx (original) +++ openoffice/branches/l10n/main/l10ntools/source/gConXrm.cxx Sat Feb 9 09:31:28 2013 @@ -36,9 +36,9 @@ convert_xrm_impl * convert_xrm::mcpImpl; /************ I N T E R F A C E I M P L E M E N T A T I O N ************/ -convert_xrm::convert_xrm(const std::string& srSourceFile, l10nMem& crMemory) - : convert_gen(srSourceFile, crMemory) - {mcpImpl = new convert_xrm_impl(srSourceFile, crMemory);} +convert_xrm::convert_xrm(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose) + : convert_gen(srSourceFile, crMemory, brVerbose) + {mcpImpl = new convert_xrm_impl(srSourceFile, crMemory, brVerbose);} convert_xrm::~convert_xrm() {delete mcpImpl;} void convert_xrm::extract() {mcpImpl->extract();} void convert_xrm::insert() {mcpImpl->insert();} @@ -46,8 +46,8 @@ void convert_xrm::insert() {mcpImpl->in /********************** I M P L E M E N T A T I O N **********************/ -convert_xrm_impl::convert_xrm_impl(const std::string& srSourceFile, l10nMem& crMemory) - : convert_gen (srSourceFile, crMemory), +convert_xrm_impl::convert_xrm_impl(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose) + : convert_gen (srSourceFile, crMemory, brVerbose), mbCollectingData(false) { } Modified: openoffice/branches/l10n/main/l10ntools/source/gConXrm.hxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXrm.hxx?rev=1444346&r1=1444345&r2=1444346&view=diff ============================================================================== --- openoffice/branches/l10n/main/l10ntools/source/gConXrm.hxx (original) +++ openoffice/branches/l10n/main/l10ntools/source/gConXrm.hxx Sat Feb 9 09:31:28 2013 @@ -36,7 +36,7 @@ class convert_xrm_impl : public convert_gen { public: - convert_xrm_impl(const std::string& srSourceFile, l10nMem& crMemory); + convert_xrm_impl(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose); ~convert_xrm_impl(); void startCollectData(std::string sType, std::string& sCollectedText); Modified: openoffice/branches/l10n/main/l10ntools/source/gHandler.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gHandler.cxx?rev=1444346&r1=1444345&r2=1444346&view=diff ============================================================================== --- openoffice/branches/l10n/main/l10ntools/source/gHandler.cxx (original) +++ openoffice/branches/l10n/main/l10ntools/source/gHandler.cxx Sat Feb 9 09:31:28 2013 @@ -36,7 +36,7 @@ /********************** I M P L E M E N T A T I O N **********************/ handler::handler() : meWorkMode(DO_NONE), - mbDoNotCopy(false) + mbVerbose(false) { // clear translation memory } @@ -53,6 +53,9 @@ handler::~handler() /********************** I M P L E M E N T A T I O N **********************/ void handler::checkCommandLine(int argc, char *argv[]) { + std::string sWorkText; + + // make internal throw test (to avoid if cascades try { @@ -61,14 +64,14 @@ void handler::checkCommandLine(int argc, throw std::string(""); // check for working mode - std::string meWorkText(argv[1]); + sWorkText = argv[1]; - if (meWorkText == "extract") meWorkMode = DO_EXTRACT; - else if (meWorkText == "merge") meWorkMode = DO_MERGE; - else if (meWorkText == "generate") meWorkMode = DO_GENERATE; - else if (meWorkText == "insert") meWorkMode = DO_INSERT; - else if (meWorkText == "--help") throw std::string(""); - else throw std::string("unknown mode (1 argument)"); + if (sWorkText == "extract") meWorkMode = DO_EXTRACT; + else if (sWorkText == "merge") meWorkMode = DO_MERGE; + else if (sWorkText == "generate") meWorkMode = DO_GENERATE; + else if (sWorkText == "insert") meWorkMode = DO_INSERT; + else if (sWorkText == "--help") throw std::string(""); + else throw std::string("unknown mode (1 argument)"); // decode parameters and translate to variables for (int n = 2; n < argc; ++n) @@ -84,7 +87,8 @@ void handler::checkCommandLine(int argc, // find directory type, and set it if (sArg == "-m") msModuleName = argv[++n]; else if (sArg == "-t") msTargetDir = argv[++n]; - else if (sArg == "-s") msSourceDir = argv[++n]; + else if (sArg == "-s") msSourceDir = argv[++n]; + else if (sArg == "-v") mbVerbose = true; else throw std::string("unknown parameter: ")+sArg; } else @@ -162,6 +166,7 @@ void handler::checkCommandLine(int argc, " insert, uses the module file <source dir>/<module name> to\n" " update the source files in the module" "\n" + " -v verbose mode, tells what gLang is doing\n" " -m <modulename> name of the module, used in file naming\n" " -s <source dir> extract: source file directory\n" " merge: language staging input directory\n" @@ -185,6 +190,10 @@ void handler::checkCommandLine(int argc, if (msTargetDir.at(nLen-1) != '/') msTargetDir.append("/"); } + + // tell system + if (mbVerbose) + std::cout << "gLang starting to " + sWorkText << " in module " << msModuleName << std::endl; } @@ -222,14 +231,15 @@ void handler::runExtract() // loop through all source files, and extract messages from each file for (std::vector<std::string>::iterator siSource = msSourceFiles.begin(); siSource != msSourceFiles.end(); ++siSource) { - // JIX JUST FOR TEST - mcMemory.clear(); + // tell system + if (mbVerbose) + std::cout << "gLang extracting text from file " << *siSource << std::endl; // prepare translation memory mcMemory.setFileName(*siSource); // get converter and extract files - convert_gen::getConverter(msSourceDir + *siSource, mcMemory).extract(); + convert_gen::getConverter(msSourceDir + *siSource, mcMemory, mbVerbose).extract(); } // and generate language file Modified: openoffice/branches/l10n/main/l10ntools/source/gLang.hxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gLang.hxx?rev=1444346&r1=1444345&r2=1444346&view=diff ============================================================================== --- openoffice/branches/l10n/main/l10ntools/source/gLang.hxx (original) +++ openoffice/branches/l10n/main/l10ntools/source/gLang.hxx Sat Feb 9 09:31:28 2013 @@ -83,10 +83,10 @@ class l10nMem class convert_gen { public: - convert_gen(const std::string& srSourceFile, l10nMem& crMemory); + convert_gen(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose); virtual ~convert_gen(); - static convert_gen& getConverter(const std::string& srSourceFile, l10nMem& crMemory); + static convert_gen& getConverter(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose); virtual void extract() = 0; virtual void insert() = 0; @@ -98,11 +98,12 @@ class convert_gen protected: - bool mbMergeMode; + bool mbMergeMode; + bool mbVerbose; const std::string& msSourceFile; std::string msSourceBuffer; - int mnSourceReadIndex; - l10nMem& mcMemory; + int mnSourceReadIndex; + l10nMem& mcMemory; private: }; @@ -117,7 +118,7 @@ class convert_po : public convert_gen static convert_po_impl *mcpImpl; - convert_po(const std::string& srSourceFile, l10nMem& crMemory); + convert_po(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose); ~convert_po(); void extract(); @@ -136,7 +137,7 @@ class convert_src : public convert_gen static convert_src_impl *mcpImpl; - convert_src(const std::string& srSourceFile, l10nMem& crMemory); + convert_src(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose); ~convert_src(); void extract(); @@ -155,7 +156,7 @@ class convert_hrc : public convert_gen static convert_hrc_impl *mcpImpl; - convert_hrc(const std::string& srSourceFile, l10nMem& crMemory); + convert_hrc(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose); ~convert_hrc(); void extract(); @@ -170,7 +171,7 @@ class convert_hrc : public convert_gen class convert_tree : public convert_gen { public: - convert_tree(const std::string& srSourceFile, l10nMem& crMemory); + convert_tree(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose); ~convert_tree(); void extract(); @@ -185,7 +186,7 @@ class convert_tree : public convert_gen class convert_ulf : public convert_gen { public: - convert_ulf(const std::string& srSourceFile, l10nMem& srMemory); + convert_ulf(const std::string& srSourceFile, l10nMem& srMemory, bool brVerbose); ~convert_ulf(); void extract(); @@ -205,7 +206,7 @@ class convert_xcu : public convert_gen static convert_xcu_impl *mcpImpl; - convert_xcu(const std::string& srSourceFile, l10nMem& crMemory); + convert_xcu(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose); virtual ~convert_xcu(); virtual void extract(); @@ -224,7 +225,7 @@ class convert_xcs : public convert_gen static convert_xcs_impl *mcpImpl; - convert_xcs(const std::string& srSourceFile, l10nMem& srMemory); + convert_xcs(const std::string& srSourceFile, l10nMem& srMemory, bool brVerbose); ~convert_xcs(); void extract(); @@ -243,7 +244,7 @@ class convert_xrm : public convert_gen static convert_xrm_impl *mcpImpl; - convert_xrm(const std::string& srSourceFile, l10nMem& srMemory); + convert_xrm(const std::string& srSourceFile, l10nMem& srMemory, bool brVerbose); ~convert_xrm(); void extract(); @@ -262,7 +263,7 @@ class convert_xhp : public convert_gen static convert_xhp_impl *mcpImpl; - convert_xhp(const std::string& srSourceFile, l10nMem& crMemory); + convert_xhp(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose); ~convert_xhp(); void extract(); @@ -277,7 +278,7 @@ class convert_xhp : public convert_gen class convert_properties : public convert_gen { public: - convert_properties(const std::string& srSourceFile, l10nMem& crMemory); + convert_properties(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose); ~convert_properties(); void extract(); @@ -302,10 +303,10 @@ class handler private: enum {DO_NONE, DO_EXTRACT, DO_MERGE, DO_GENERATE, DO_INSERT} meWorkMode; l10nMem mcMemory; - std::string msModuleName; - std::string msSourceDir; - std::string msTargetDir; - bool mbDoNotCopy; + std::string msModuleName; + std::string msSourceDir; + std::string msTargetDir; + bool mbVerbose; std::vector<std::string> msSourceFiles; void runExtract();