Modified: openoffice/branches/l10n/main/l10ntools/source/gLang.hxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gLang.hxx?rev=1444992&r1=1444991&r2=1444992&view=diff ============================================================================== --- openoffice/branches/l10n/main/l10ntools/source/gLang.hxx (original) +++ openoffice/branches/l10n/main/l10ntools/source/gLang.hxx Mon Feb 11 23:16:00 2013 @@ -20,12 +20,8 @@ *************************************************************/ #ifndef GLANG_HXX #define GLANG_HXX -#include <cstdlib> -#include <iostream> -#include <fstream> #include <string> #include <vector> -#include <queue> @@ -33,17 +29,22 @@ *************************** G L A N G . H X X *************************** ***************************************************************************** * This is the class definition header of the l10n localizer program, - * all classes and their interrelations is defined here + * all global classes and their interrelations is defined here *****************************************************************************/ +/******************* G L O B A L D E F I N I T I O N *******************/ +extern bool gbVerbose; + + + /******************** C L A S S D E F I N I T I O N ********************/ class l10nMem_entry { public: l10nMem_entry(const std::string& srSourceFile, const std::string& srModuleName, const std::string& srKey, - const std::string& srLanguage, const std::string& srText, const int iIndex); + const std::string& srLanguage, const std::string& srText, const int iIndex); ~l10nMem_entry(); std::string msSourceFile; @@ -57,6 +58,7 @@ class l10nMem_entry }; + /******************** C L A S S D E F I N I T I O N ********************/ class l10nMem { @@ -64,11 +66,11 @@ class l10nMem l10nMem(); ~l10nMem(); - void save(const std::string& srTargetFile); + void save (const std::string& srTargetFile); void clear(); - void setFileName(const std::string& srSourceFile); + void setFileName (const std::string& srSourceFile); void setModuleName(const std::string& srModuleName); - void setEnUsKey(const std::string& srKey, const std::string& srText, int iIndex = 0); + void setEnUsKey (const std::string& srKey, const std::string& srText, int iIndex = 0); std::vector<l10nMem_entry *>& getLanguagesForKey(const std::string& srKey); private: @@ -84,211 +86,11 @@ class l10nMem class convert_gen { public: - convert_gen(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose); - virtual ~convert_gen(); - - static convert_gen& getConverter(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose); - - virtual void extract() = 0; - virtual void insert() = 0; - - void lexRead (char *sBuf, int *nResult, int nMax_size); - void lineRead(bool *bEof, std::string& line); - void writeSourceFile(const std::string& line); - void trim(std::string& line); - - - protected: - bool mbMergeMode; - bool mbVerbose; - const std::string& msSourceFile; - std::string msSourceBuffer; - int mnSourceReadIndex; - l10nMem& mcMemory; - - private: -}; - - - -/******************** C L A S S D E F I N I T I O N ********************/ -class convert_po_impl; -class convert_po : public convert_gen -{ - public: - static convert_po_impl *mcpImpl; - - - convert_po(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose); - ~convert_po(); - - void extract(); - void insert(); - - private: -}; - - - -/******************** C L A S S D E F I N I T I O N ********************/ -class convert_src_impl; -class convert_src : public convert_gen -{ - public: - static convert_src_impl *mcpImpl; - - - convert_src(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose); - ~convert_src(); - - void extract(); - void insert(); - - private: -}; - - - -/******************** C L A S S D E F I N I T I O N ********************/ -class convert_hrc_impl; -class convert_hrc : public convert_gen -{ - public: - static convert_hrc_impl *mcpImpl; - - - convert_hrc(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose); - ~convert_hrc(); - - void extract(); - void insert(); - - private: -}; - - - -/******************** C L A S S D E F I N I T I O N ********************/ -class convert_tree : public convert_gen -{ - public: - convert_tree(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose); - ~convert_tree(); - - void extract(); - void insert(); - - private: -}; - - - -/******************** C L A S S D E F I N I T I O N ********************/ -class convert_ulf_impl; -class convert_ulf : public convert_gen -{ - public: - static convert_ulf_impl *mcpImpl; - - convert_ulf(const std::string& srSourceFile, l10nMem& srMemory, bool brVerbose); - ~convert_ulf(); - - void extract(); - void insert(); - - private: - void handleLines(); -}; - - - -/******************** C L A S S D E F I N I T I O N ********************/ -class convert_xcu_impl; -class convert_xcu : public convert_gen -{ - public: - static convert_xcu_impl *mcpImpl; - - - convert_xcu(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose); - virtual ~convert_xcu(); - - virtual void extract(); - virtual void insert(); - - private: -}; - - - -/******************** C L A S S D E F I N I T I O N ********************/ -class convert_xcs_impl; -class convert_xcs : public convert_gen -{ - public: - static convert_xcs_impl *mcpImpl; - - - convert_xcs(const std::string& srSourceFile, l10nMem& srMemory, bool brVerbose); - ~convert_xcs(); - - void extract(); - void insert(); - - private: -}; - - - -/******************** C L A S S D E F I N I T I O N ********************/ -class convert_xrm_impl; -class convert_xrm : public convert_gen -{ - public: - static convert_xrm_impl *mcpImpl; - - - convert_xrm(const std::string& srSourceFile, l10nMem& srMemory, bool brVerbose); - ~convert_xrm(); - - void extract(); - void insert(); - - private: -}; - - - -/******************** C L A S S D E F I N I T I O N ********************/ -class convert_xhp_impl; -class convert_xhp : public convert_gen -{ - public: - static convert_xhp_impl *mcpImpl; - - - convert_xhp(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose); - ~convert_xhp(); - - void extract(); - void insert(); - - private: -}; - - - -/******************** C L A S S D E F I N I T I O N ********************/ -class convert_properties : public convert_gen -{ - public: - convert_properties(const std::string& srSourceFile, l10nMem& crMemory, bool brVerbose); - ~convert_properties(); - - void extract(); - void insert(); + convert_gen(const std::string& srSourceFile, l10nMem& crMemory, const bool bMerge); + ~convert_gen(); - private: + // do extract/merge + void execute(); }; @@ -297,7 +99,6 @@ class convert_properties : public conver class handler { public: - handler(); ~handler(); @@ -305,16 +106,15 @@ class handler void run(); 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 mbVerbose; + enum {DO_EXTRACT, DO_EXTRACTMERGE, DO_GENERATE, DO_INSERT} meWorkMode; + l10nMem mcMemory; + std::string msModuleName; + std::string msSourceDir; + std::string msTargetDir; std::vector<std::string> msSourceFiles; + bool mbVerbose; - void runExtract(); - void runMerge(); + void runExtractMerge(bool bMerge); void runGenerate(); void runInsert(); };
Modified: openoffice/branches/l10n/main/l10ntools/source/makefile.mk URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/makefile.mk?rev=1444992&r1=1444991&r2=1444992&view=diff ============================================================================== --- openoffice/branches/l10n/main/l10ntools/source/makefile.mk (original) +++ openoffice/branches/l10n/main/l10ntools/source/makefile.mk Mon Feb 11 23:16:00 2013 @@ -170,11 +170,7 @@ APP7STDLIBS+= \ APP8TARGET= genLang APP8OBJS= $(OBJ)$/gLang.obj $(OBJ)$/gL10nMem.obj \ $(OBJ)$/gHandler.obj $(OBJ)$/gConProp.obj \ - $(OBJ)$/gConHrc.obj $(OBJ)$/gConSrc.obj \ - $(OBJ)$/gConTree.obj $(OBJ)$/gConUlf.obj \ - $(OBJ)$/gConPo.obj $(OBJ)$/gConXcs.obj \ - $(OBJ)$/gConXcu.obj $(OBJ)$/gConXhp.obj \ - $(OBJ)$/gConXrm.obj $(OBJ)$/gCon.obj \ + $(OBJ)$/gConTree.obj $(OBJ)$/gCon.obj \ $(OBJ)$/gConPoWrap.obj $(OBJ)$/gConHrcWrap.obj \ $(OBJ)$/gConSrcWrap.obj $(OBJ)$/gConXcsWrap.obj \ $(OBJ)$/gConXcuWrap.obj $(OBJ)$/gConXrmWrap.obj \