genLang update
Last singleton gone, structure is now handler (local in gLang.cxx) holds a variable of l10nMem a temporary convert_gen variable (to analyze file) l10nMem contains hash list of all PO information convert_xxx is inherited from convert_gen and instanciated with a static function convert_gen::createInstance the lex functions (in c) uses a "this" pointer to find back to the class. This needs to be done better. l10nMem contains a link to convert_PO, to save files, this needs to be split. Change-Id: I3ad31aac27aac739845062f8da61c8c1c3bf9c31
This commit is contained in:
@@ -25,65 +25,40 @@
|
|||||||
class convert_gen
|
class convert_gen
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
convert_gen(l10nMem& cMemory,
|
static convert_gen *mcImpl;
|
||||||
|
|
||||||
|
convert_gen(l10nMem& cMemory);
|
||||||
|
virtual ~convert_gen();
|
||||||
|
|
||||||
|
// Create instance
|
||||||
|
static convert_gen& createInstance(l10nMem& cMemory,
|
||||||
const std::string& sSourceDir,
|
const std::string& sSourceDir,
|
||||||
const std::string& sTargetDir,
|
const std::string& sTargetDir,
|
||||||
const std::string& sSourceFile);
|
const std::string& sSourceFile);
|
||||||
~convert_gen();
|
|
||||||
|
|
||||||
// do extract/merge
|
// do extract/merge
|
||||||
bool execute(const bool bMerge, const bool bKid);
|
bool execute(const bool bMerge, const bool bKid);
|
||||||
|
|
||||||
// ONLY po should implement these functions
|
|
||||||
void startSave(const std::string& sLanguage,
|
|
||||||
const std::string& sFile);
|
|
||||||
void save(const std::string& sFileName,
|
|
||||||
const std::string& sKey,
|
|
||||||
const std::string& sENUStext,
|
|
||||||
const std::string& sText,
|
|
||||||
bool bFuzzy);
|
|
||||||
void endSave();
|
|
||||||
static bool checkAccess(std::string& sFile);
|
|
||||||
static bool createDir(std::string& sDir, std::string& sFile);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
|
||||||
**************************** G C O N . H X X ****************************
|
|
||||||
*****************************************************************************
|
|
||||||
* This is the class definition header for all converter classes,
|
|
||||||
* all classes and their interrelations is defined here
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/******************* G L O B A L D E F I N I T I O N *******************/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/******************** C L A S S D E F I N I T I O N ********************/
|
|
||||||
class convert_gen_impl
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static convert_gen_impl *mcImpl;
|
|
||||||
|
|
||||||
|
|
||||||
convert_gen_impl(l10nMem& crMemory);
|
|
||||||
virtual ~convert_gen_impl();
|
|
||||||
|
|
||||||
// all converters MUST implement this function
|
// all converters MUST implement this function
|
||||||
virtual void execute() = 0;
|
virtual void execute() = 0;
|
||||||
|
|
||||||
// ONLY po should implement these functions
|
// ONLY po should implement these functions
|
||||||
virtual void startSave(const std::string& sLanguage,
|
virtual void startSave(const std::string& sLanguage,
|
||||||
const std::string& sFile);
|
const std::string& sFile);
|
||||||
virtual void save(const std::string& sFileName,
|
virtual void save(const std::string& sFileName,
|
||||||
const std::string& sKey,
|
const std::string& sKey,
|
||||||
const std::string& sENUStext,
|
const std::string& sENUStext,
|
||||||
const std::string& sText,
|
const std::string& sText,
|
||||||
bool bFuzzy);
|
bool bFuzzy);
|
||||||
virtual void endSave();
|
virtual void endSave();
|
||||||
|
static bool checkAccess(std::string& sFile);
|
||||||
|
static bool createDir(std::string& sDir, std::string& sFile);
|
||||||
|
|
||||||
|
// utility functions for converters
|
||||||
|
void lexRead(char *sBuf, int *nResult, int nMax_size);
|
||||||
|
std::string& copySource(char const *yyText, bool bDoClear = true);
|
||||||
|
|
||||||
|
protected:
|
||||||
// generic variables
|
// generic variables
|
||||||
bool mbMergeMode;
|
bool mbMergeMode;
|
||||||
bool mbLoadMode;
|
bool mbLoadMode;
|
||||||
@@ -93,22 +68,14 @@ class convert_gen_impl
|
|||||||
l10nMem& mcMemory;
|
l10nMem& mcMemory;
|
||||||
std::string msCollector;
|
std::string msCollector;
|
||||||
int miLineNo;
|
int miLineNo;
|
||||||
|
|
||||||
|
|
||||||
// utility functions for converters
|
|
||||||
void lexRead (char *sBuf, int *nResult, int nMax_size);
|
|
||||||
void writeSourceFile(const std::string& line);
|
|
||||||
std::string& copySource (char const *yyText, bool bDoClear = true);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
std::string msSourceBuffer, msCopyText;
|
std::string msSourceBuffer, msCopyText;
|
||||||
int miSourceReadIndex;
|
int miSourceReadIndex;
|
||||||
|
|
||||||
bool prepareFile();
|
bool prepareFile();
|
||||||
|
|
||||||
private:
|
// utility functions for converters
|
||||||
|
void writeSourceFile(const std::string& line);
|
||||||
|
private:
|
||||||
std::ofstream mcOutputFile;
|
std::ofstream mcOutputFile;
|
||||||
|
|
||||||
friend class convert_gen;
|
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/******************** C L A S S D E F I N I T I O N ********************/
|
/******************** C L A S S D E F I N I T I O N ********************/
|
||||||
class convert_db : public convert_gen_impl
|
class convert_db : public convert_gen
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
convert_db(l10nMem& crMemory);
|
convert_db(l10nMem& crMemory);
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/******************** C L A S S D E F I N I T I O N ********************/
|
/******************** C L A S S D E F I N I T I O N ********************/
|
||||||
class convert_po : public convert_gen_impl
|
class convert_po : public convert_gen
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
bool mbExpectId;
|
bool mbExpectId;
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/******************** C L A S S D E F I N I T I O N ********************/
|
/******************** C L A S S D E F I N I T I O N ********************/
|
||||||
class convert_prop : public convert_gen_impl
|
class convert_prop : public convert_gen
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
convert_prop(l10nMem& crMemory);
|
convert_prop(l10nMem& crMemory);
|
||||||
|
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/******************** C L A S S D E F I N I T I O N ********************/
|
/******************** C L A S S D E F I N I T I O N ********************/
|
||||||
class convert_src : public convert_gen_impl
|
class convert_src : public convert_gen
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
bool mbExpectValue;
|
bool mbExpectValue;
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/******************** C L A S S D E F I N I T I O N ********************/
|
/******************** C L A S S D E F I N I T I O N ********************/
|
||||||
class convert_tree : public convert_gen_impl
|
class convert_tree : public convert_gen
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef enum
|
typedef enum
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/******************** C L A S S D E F I N I T I O N ********************/
|
/******************** C L A S S D E F I N I T I O N ********************/
|
||||||
class convert_ulf : public convert_gen_impl
|
class convert_ulf : public convert_gen
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
convert_ulf(l10nMem& crMemory);
|
convert_ulf(l10nMem& crMemory);
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/******************** C L A S S D E F I N I T I O N ********************/
|
/******************** C L A S S D E F I N I T I O N ********************/
|
||||||
class convert_xcs : public convert_gen_impl
|
class convert_xcs : public convert_gen
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
convert_xcs(l10nMem& crMemory);
|
convert_xcs(l10nMem& crMemory);
|
||||||
|
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
/******************** C L A S S D E F I N I T I O N ********************/
|
/******************** C L A S S D E F I N I T I O N ********************/
|
||||||
class xcu_stack_entry;
|
class xcu_stack_entry;
|
||||||
class convert_xcu : public convert_gen_impl
|
class convert_xcu : public convert_gen
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
bool mbNoCollectingData;
|
bool mbNoCollectingData;
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/******************** C L A S S D E F I N I T I O N ********************/
|
/******************** C L A S S D E F I N I T I O N ********************/
|
||||||
class convert_xhp : public convert_gen_impl
|
class convert_xhp : public convert_gen
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
convert_xhp(l10nMem& crMemory);
|
convert_xhp(l10nMem& crMemory);
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/******************** C L A S S D E F I N I T I O N ********************/
|
/******************** C L A S S D E F I N I T I O N ********************/
|
||||||
class convert_xrm : public convert_gen_impl
|
class convert_xrm : public convert_gen
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
bool mbNoCollectingData;
|
bool mbNoCollectingData;
|
||||||
|
@@ -45,31 +45,25 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
convert_gen * convert_gen::mcImpl = NULL;
|
||||||
/*****************************************************************************
|
|
||||||
**************************** G C O N . C X X ****************************
|
|
||||||
*****************************************************************************
|
|
||||||
* This is the generic conversion module, it handles all generic work of the
|
|
||||||
* conversion, and offer utility functions to the specific conversion classes
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/******************* G L O B A L D E F I N I T I O N *******************/
|
|
||||||
convert_gen_impl * convert_gen_impl::mcImpl = nullptr;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/********************** I M P L E M E N T A T I O N **********************/
|
/********************** I M P L E M E N T A T I O N **********************/
|
||||||
convert_gen::convert_gen(l10nMem& cMemory,
|
convert_gen::convert_gen(l10nMem& cMemory)
|
||||||
|
: mcMemory(cMemory)
|
||||||
|
{
|
||||||
|
mcImpl = this;
|
||||||
|
}
|
||||||
|
convert_gen::~convert_gen()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
convert_gen& convert_gen::createInstance(l10nMem& cMemory,
|
||||||
const std::string& sSourceDir,
|
const std::string& sSourceDir,
|
||||||
const std::string& sTargetDir,
|
const std::string& sTargetDir,
|
||||||
const std::string& sSourceFile)
|
const std::string& sSourceFile)
|
||||||
{
|
{
|
||||||
// do we have an old object
|
|
||||||
if (convert_gen_impl::mcImpl)
|
|
||||||
delete convert_gen_impl::mcImpl;
|
|
||||||
|
|
||||||
// did the user give a .xxx with the source file ?
|
// did the user give a .xxx with the source file ?
|
||||||
int nInx = sSourceFile.rfind(".");
|
int nInx = sSourceFile.rfind(".");
|
||||||
if (nInx == (int)std::string::npos)
|
if (nInx == (int)std::string::npos)
|
||||||
@@ -77,30 +71,24 @@ convert_gen::convert_gen(l10nMem& cMemory,
|
|||||||
|
|
||||||
// find correct conversion class and create correct object
|
// find correct conversion class and create correct object
|
||||||
std::string sExtension = sSourceFile.substr(nInx+1);
|
std::string sExtension = sSourceFile.substr(nInx+1);
|
||||||
if (sExtension == "hrc") convert_gen_impl::mcImpl = new convert_src(cMemory);
|
convert_gen *x;
|
||||||
else if (sExtension == "src") convert_gen_impl::mcImpl = new convert_src(cMemory);
|
if (sExtension == "hrc") x = new convert_src(cMemory);
|
||||||
else if (sExtension == "po") convert_gen_impl::mcImpl = new convert_po(cMemory);
|
else if (sExtension == "src") x = new convert_src(cMemory);
|
||||||
else if (sExtension == "pot") convert_gen_impl::mcImpl = new convert_po(cMemory);
|
else if (sExtension == "po") x = new convert_po(cMemory);
|
||||||
else if (sExtension == "tree") convert_gen_impl::mcImpl = new convert_tree(cMemory);
|
else if (sExtension == "pot") x = new convert_po(cMemory);
|
||||||
else if (sExtension == "ulf") convert_gen_impl::mcImpl = new convert_ulf(cMemory);
|
else if (sExtension == "tree") x = new convert_tree(cMemory);
|
||||||
else if (sExtension == "xcu") convert_gen_impl::mcImpl = new convert_xcu(cMemory);
|
else if (sExtension == "ulf") x = new convert_ulf(cMemory);
|
||||||
else if (sExtension == "xhp") convert_gen_impl::mcImpl = new convert_xhp(cMemory);
|
else if (sExtension == "xcu") x = new convert_xcu(cMemory);
|
||||||
else if (sExtension == "xrm") convert_gen_impl::mcImpl = new convert_xrm(cMemory);
|
else if (sExtension == "xhp") x = new convert_xhp(cMemory);
|
||||||
else if (sExtension == "properties") convert_gen_impl::mcImpl = new convert_prop(cMemory);
|
else if (sExtension == "xrm") x = new convert_xrm(cMemory);
|
||||||
|
else if (sExtension == "properties") x = new convert_prop(cMemory);
|
||||||
else throw l10nMem::showError("unknown extension on source file: "+sSourceFile);
|
else throw l10nMem::showError("unknown extension on source file: "+sSourceFile);
|
||||||
|
|
||||||
// and set environment
|
// and set environment
|
||||||
convert_gen_impl::mcImpl->msSourceFile = sSourceFile;
|
x->msSourceFile = sSourceFile;
|
||||||
convert_gen_impl::mcImpl->msTargetPath = sTargetDir;
|
x->msTargetPath = sTargetDir;
|
||||||
convert_gen_impl::mcImpl->msSourcePath = sSourceDir + sSourceFile;
|
x->msSourcePath = sSourceDir + sSourceFile;
|
||||||
}
|
return *x;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/********************** I M P L E M E N T A T I O N **********************/
|
|
||||||
convert_gen::~convert_gen()
|
|
||||||
{
|
|
||||||
delete convert_gen_impl::mcImpl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -108,17 +96,17 @@ convert_gen::~convert_gen()
|
|||||||
/********************** I M P L E M E N T A T I O N **********************/
|
/********************** I M P L E M E N T A T I O N **********************/
|
||||||
bool convert_gen::execute(const bool bMerge, const bool bKid)
|
bool convert_gen::execute(const bool bMerge, const bool bKid)
|
||||||
{
|
{
|
||||||
convert_gen_impl::mcImpl->mbMergeMode = bMerge;
|
mbMergeMode = bMerge;
|
||||||
|
|
||||||
if (bKid)
|
if (bKid)
|
||||||
throw l10nMem::showError("not implemented");
|
throw l10nMem::showError("not implemented");
|
||||||
|
|
||||||
// and load file
|
// and load file
|
||||||
if (!convert_gen_impl::mcImpl->prepareFile())
|
if (!prepareFile())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// and execute conversion
|
// and execute conversion
|
||||||
convert_gen_impl::mcImpl->execute();
|
execute();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -128,11 +116,6 @@ bool convert_gen::execute(const bool bMerge, const bool bKid)
|
|||||||
/********************** I M P L E M E N T A T I O N **********************/
|
/********************** I M P L E M E N T A T I O N **********************/
|
||||||
void convert_gen::startSave(const std::string& sLanguage,
|
void convert_gen::startSave(const std::string& sLanguage,
|
||||||
const std::string& sFile)
|
const std::string& sFile)
|
||||||
{
|
|
||||||
convert_gen_impl::mcImpl->startSave(sLanguage, sFile);
|
|
||||||
}
|
|
||||||
void convert_gen_impl::startSave(const std::string& sLanguage,
|
|
||||||
const std::string& sFile)
|
|
||||||
{
|
{
|
||||||
std::string x;
|
std::string x;
|
||||||
|
|
||||||
@@ -143,20 +126,11 @@ void convert_gen_impl::startSave(const std::string& sLanguage,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/********************** I M P L E M E N T A T I O N **********************/
|
|
||||||
void convert_gen::save(const std::string& sFileName,
|
void convert_gen::save(const std::string& sFileName,
|
||||||
const std::string& sKey,
|
const std::string& sKey,
|
||||||
const std::string& sENUStext,
|
const std::string& sENUStext,
|
||||||
const std::string& sText,
|
const std::string& sText,
|
||||||
bool bFuzzy)
|
bool bFuzzy)
|
||||||
{
|
|
||||||
convert_gen_impl::mcImpl->save(sFileName, sKey, sENUStext, sText, bFuzzy);
|
|
||||||
}
|
|
||||||
void convert_gen_impl::save(const std::string& sFileName,
|
|
||||||
const std::string& sKey,
|
|
||||||
const std::string& sENUStext,
|
|
||||||
const std::string& sText,
|
|
||||||
bool bFuzzy)
|
|
||||||
{
|
{
|
||||||
std::string x;
|
std::string x;
|
||||||
|
|
||||||
@@ -167,12 +141,7 @@ void convert_gen_impl::save(const std::string& sFileName,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/********************** I M P L E M E N T A T I O N **********************/
|
|
||||||
void convert_gen::endSave()
|
void convert_gen::endSave()
|
||||||
{
|
|
||||||
convert_gen_impl::mcImpl->endSave();
|
|
||||||
}
|
|
||||||
void convert_gen_impl::endSave()
|
|
||||||
{
|
{
|
||||||
throw l10nMem::showError("endSave called with non .po file");
|
throw l10nMem::showError("endSave called with non .po file");
|
||||||
}
|
}
|
||||||
@@ -216,26 +185,7 @@ bool convert_gen::createDir(std::string& sDir, std::string& sFile)
|
|||||||
|
|
||||||
|
|
||||||
/********************** I M P L E M E N T A T I O N **********************/
|
/********************** I M P L E M E N T A T I O N **********************/
|
||||||
convert_gen_impl::convert_gen_impl(l10nMem& crMemory)
|
bool convert_gen::prepareFile()
|
||||||
: mbMergeMode(false),
|
|
||||||
mbLoadMode(false),
|
|
||||||
mcMemory(crMemory),
|
|
||||||
miLineNo(1)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/********************** I M P L E M E N T A T I O N **********************/
|
|
||||||
convert_gen_impl::~convert_gen_impl()
|
|
||||||
{
|
|
||||||
mcImpl = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/********************** I M P L E M E N T A T I O N **********************/
|
|
||||||
bool convert_gen_impl::prepareFile()
|
|
||||||
{
|
{
|
||||||
std::ifstream inputFile(msSourcePath.c_str(), std::ios::binary);
|
std::ifstream inputFile(msSourcePath.c_str(), std::ios::binary);
|
||||||
|
|
||||||
@@ -290,7 +240,7 @@ bool convert_gen_impl::prepareFile()
|
|||||||
|
|
||||||
|
|
||||||
/********************** I M P L E M E N T A T I O N **********************/
|
/********************** I M P L E M E N T A T I O N **********************/
|
||||||
void convert_gen_impl::lexRead(char *sBuf, int *nResult, int nMax_size)
|
void convert_gen::lexRead(char *sBuf, int *nResult, int nMax_size)
|
||||||
{
|
{
|
||||||
// did we hit eof
|
// did we hit eof
|
||||||
if (miSourceReadIndex == -1)
|
if (miSourceReadIndex == -1)
|
||||||
@@ -320,7 +270,7 @@ void convert_gen_impl::lexRead(char *sBuf, int *nResult, int nMax_size)
|
|||||||
|
|
||||||
|
|
||||||
/********************** I M P L E M E N T A T I O N **********************/
|
/********************** I M P L E M E N T A T I O N **********************/
|
||||||
void convert_gen_impl::writeSourceFile(const std::string& line)
|
void convert_gen::writeSourceFile(const std::string& line)
|
||||||
{
|
{
|
||||||
if (!line.size())
|
if (!line.size())
|
||||||
return;
|
return;
|
||||||
@@ -332,7 +282,7 @@ void convert_gen_impl::writeSourceFile(const std::string& line)
|
|||||||
|
|
||||||
|
|
||||||
/********************** I M P L E M E N T A T I O N **********************/
|
/********************** I M P L E M E N T A T I O N **********************/
|
||||||
std::string& convert_gen_impl::copySource(char const *yyText, bool bDoClear)
|
std::string& convert_gen::copySource(char const *yyText, bool bDoClear)
|
||||||
{
|
{
|
||||||
int nL;
|
int nL;
|
||||||
|
|
||||||
|
@@ -24,16 +24,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
convert_db::convert_db(l10nMem& crMemory) : convert_gen(crMemory) {}
|
||||||
************************** G C O N D B . C X X **************************
|
|
||||||
*****************************************************************************
|
|
||||||
* This includes the c code generated by flex
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/************ I N T E R F A C E I M P L E M E N T A T I O N ************/
|
|
||||||
convert_db::convert_db(l10nMem& crMemory) : convert_gen_impl(crMemory) {}
|
|
||||||
convert_db::~convert_db() {}
|
convert_db::~convert_db() {}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
/************ I N T E R F A C E I M P L E M E N T A T I O N ************/
|
/************ 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(l10nMem& crMemory)
|
convert_po::convert_po(l10nMem& crMemory)
|
||||||
: convert_gen_impl(crMemory),
|
: convert_gen(crMemory),
|
||||||
mbExpectId(false),
|
mbExpectId(false),
|
||||||
mbExpectStr(false),
|
mbExpectStr(false),
|
||||||
mbFuzzy(false)
|
mbFuzzy(false)
|
||||||
|
@@ -24,16 +24,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
convert_prop::convert_prop(l10nMem& crMemory) : convert_gen(crMemory)
|
||||||
************************ G C O N P R O P . C X X ************************
|
|
||||||
*****************************************************************************
|
|
||||||
* This is the conversion for .properties files
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/********************** I M P L E M E N T A T I O N **********************/
|
|
||||||
convert_prop::convert_prop(l10nMem& crMemory) : convert_gen_impl(crMemory)
|
|
||||||
{
|
{
|
||||||
// throw l10nMem::showError(std::string("convert_prop not implemented"));
|
// throw l10nMem::showError(std::string("convert_prop not implemented"));
|
||||||
}
|
}
|
||||||
|
@@ -28,17 +28,8 @@
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
|
||||||
********************* G C O N S R C W R A P . C X X *********************
|
|
||||||
*****************************************************************************
|
|
||||||
* This includes the c code generated by flex
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/************ 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(l10nMem& crMemory)
|
convert_src::convert_src(l10nMem& crMemory)
|
||||||
: convert_gen_impl(crMemory),
|
: convert_gen(crMemory),
|
||||||
mbExpectValue(false),
|
mbExpectValue(false),
|
||||||
mbEnUs(false),
|
mbEnUs(false),
|
||||||
mbExpectName(false),
|
mbExpectName(false),
|
||||||
|
@@ -23,18 +23,8 @@
|
|||||||
#include "gConvTree.hxx"
|
#include "gConvTree.hxx"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
|
||||||
******************** G C O N T R E E W R A P . C X X ********************
|
|
||||||
*****************************************************************************
|
|
||||||
* This includes the c code generated by flex
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/********************** I M P L E M E N T A T I O N **********************/
|
|
||||||
convert_tree::convert_tree(l10nMem& crMemory)
|
convert_tree::convert_tree(l10nMem& crMemory)
|
||||||
: convert_gen_impl(crMemory),
|
: convert_gen(crMemory),
|
||||||
mcOutputFiles(nullptr),
|
mcOutputFiles(nullptr),
|
||||||
meStateTag(STATE_TAG_NONE),
|
meStateTag(STATE_TAG_NONE),
|
||||||
meStateVal(STATE_VAL_NONE),
|
meStateVal(STATE_VAL_NONE),
|
||||||
|
@@ -24,16 +24,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
convert_ulf::convert_ulf(l10nMem& crMemory) : convert_gen(crMemory) {}
|
||||||
********************* G C O N X C S W R A P . C X X *********************
|
|
||||||
*****************************************************************************
|
|
||||||
* This includes the c code generated by flex
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/********************** I M P L E M E N T A T I O N **********************/
|
|
||||||
convert_ulf::convert_ulf(l10nMem& crMemory) : convert_gen_impl(crMemory) {}
|
|
||||||
convert_ulf::~convert_ulf() {}
|
convert_ulf::~convert_ulf() {}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -24,17 +24,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
|
||||||
********************* G C O N X C S W R A P . C X X *********************
|
|
||||||
*****************************************************************************
|
|
||||||
* This includes the c code generated by flex
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/************ 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(l10nMem& crMemory)
|
convert_xcs::convert_xcs(l10nMem& crMemory)
|
||||||
: convert_gen_impl(crMemory),
|
: convert_gen(crMemory),
|
||||||
mbCollectingData(false)
|
mbCollectingData(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@@ -21,19 +21,8 @@
|
|||||||
|
|
||||||
#include "gL10nMem.hxx"
|
#include "gL10nMem.hxx"
|
||||||
#include "gConvXcu.hxx"
|
#include "gConvXcu.hxx"
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
|
||||||
********************* G C O N X C U W R A P . C X X *********************
|
|
||||||
*****************************************************************************
|
|
||||||
* This includes the c code generated by flex
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/************ 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(l10nMem& crMemory)
|
convert_xcu::convert_xcu(l10nMem& crMemory)
|
||||||
: convert_gen_impl(crMemory),
|
: convert_gen(crMemory),
|
||||||
mbNoCollectingData(true),
|
mbNoCollectingData(true),
|
||||||
miLevel(0),
|
miLevel(0),
|
||||||
mbNoTranslate(false)
|
mbNoTranslate(false)
|
||||||
|
@@ -21,20 +21,8 @@
|
|||||||
|
|
||||||
#include "gL10nMem.hxx"
|
#include "gL10nMem.hxx"
|
||||||
#include "gConvXhp.hxx"
|
#include "gConvXhp.hxx"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
|
||||||
********************* G C O N X H P W R A P . C X X *********************
|
|
||||||
*****************************************************************************
|
|
||||||
* This includes the c code generated by flex
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/************ 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(l10nMem& crMemory)
|
convert_xhp::convert_xhp(l10nMem& crMemory)
|
||||||
: convert_gen_impl(crMemory),
|
: convert_gen(crMemory),
|
||||||
meExpectValue(VALUE_NOT_USED),
|
meExpectValue(VALUE_NOT_USED),
|
||||||
msLangText(nullptr),
|
msLangText(nullptr),
|
||||||
mcOutputFiles(nullptr),
|
mcOutputFiles(nullptr),
|
||||||
|
@@ -23,17 +23,9 @@
|
|||||||
#include "gConvXrm.hxx"
|
#include "gConvXrm.hxx"
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
|
||||||
********************* G C O N X R M W R A P . C X X *********************
|
|
||||||
*****************************************************************************
|
|
||||||
* This includes the c code generated by flex
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/************ 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(l10nMem& crMemory)
|
convert_xrm::convert_xrm(l10nMem& crMemory)
|
||||||
: convert_gen_impl(crMemory),
|
: convert_gen(crMemory),
|
||||||
mbNoCollectingData(true),
|
mbNoCollectingData(true),
|
||||||
mbIsTag(false),
|
mbIsTag(false),
|
||||||
mbIsLang(false)
|
mbIsLang(false)
|
||||||
|
@@ -330,7 +330,7 @@ void handler::loadL10MEM(bool onlyTemplates)
|
|||||||
|
|
||||||
// and load file
|
// and load file
|
||||||
mcMemory.setLanguage("", true);
|
mcMemory.setLanguage("", true);
|
||||||
convert_gen (mcMemory, sLoad, msTargetDir, "").execute(false, false);
|
convert_gen::createInstance(mcMemory, sLoad, msTargetDir, "").execute(false, false);
|
||||||
|
|
||||||
if (onlyTemplates)
|
if (onlyTemplates)
|
||||||
return;
|
return;
|
||||||
@@ -346,7 +346,7 @@ void handler::loadL10MEM(bool onlyTemplates)
|
|||||||
// tell system
|
// tell system
|
||||||
l10nMem::showDebug("genLang loading text from language file " + sLoad);
|
l10nMem::showDebug("genLang loading text from language file " + sLoad);
|
||||||
|
|
||||||
convert_gen(mcMemory, sLoad, msTargetDir, "").execute(false, false);
|
convert_gen::createInstance(mcMemory, sLoad, msTargetDir, "").execute(false, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -368,7 +368,7 @@ void handler::runConvert()
|
|||||||
l10nMem::showDebug("genLang compare template " + *siSource);
|
l10nMem::showDebug("genLang compare template " + *siSource);
|
||||||
|
|
||||||
// get converter and extract files
|
// get converter and extract files
|
||||||
convert_gen convertObj(mcMemory, "./", msTargetDir, *siSource);
|
convert_gen& convertObj = convert_gen::createInstance(mcMemory, "./", msTargetDir, *siSource);
|
||||||
convertObj.execute(false, false);
|
convertObj.execute(false, false);
|
||||||
|
|
||||||
mcMemory.showNOconvert();
|
mcMemory.showNOconvert();
|
||||||
@@ -385,7 +385,7 @@ void handler::runConvert()
|
|||||||
sFilePath + *siSource + " language " + *siLang);
|
sFilePath + *siSource + " language " + *siLang);
|
||||||
|
|
||||||
// get converter and extract files
|
// get converter and extract files
|
||||||
//convert_gen convertObj(mcMemory, sFilePath, msTargetDir, *siSource);
|
convert_gen& convertObj = convert_gen::createInstance(mcMemory, sFilePath, msTargetDir, *siSource);
|
||||||
convertObj.execute(true, false);
|
convertObj.execute(true, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -411,7 +411,7 @@ void handler::runExtract()
|
|||||||
l10nMem::showDebug("genLang extracting text from file " + *siSource);
|
l10nMem::showDebug("genLang extracting text from file " + *siSource);
|
||||||
|
|
||||||
// get converter and extract file
|
// get converter and extract file
|
||||||
convert_gen convertObj(mcMemory, "", msTargetDir, *siSource);
|
convert_gen& convertObj = convert_gen::createInstance(mcMemory, "", msTargetDir, *siSource);
|
||||||
convertObj.execute(false, false);
|
convertObj.execute(false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -435,7 +435,7 @@ void handler::runMerge(bool bKid)
|
|||||||
l10nMem::showDebug("genLang merging translated text to file " + *siSource);
|
l10nMem::showDebug("genLang merging translated text to file " + *siSource);
|
||||||
|
|
||||||
// get converter and extract file
|
// get converter and extract file
|
||||||
convert_gen convertObj(mcMemory, "", msTargetDir, *siSource);
|
convert_gen& convertObj = convert_gen::createInstance(mcMemory, "", msTargetDir, *siSource);
|
||||||
convertObj.execute(true, bKid);
|
convertObj.execute(true, bKid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -41,8 +41,8 @@
|
|||||||
#include "gL10nMem.hxx"
|
#include "gL10nMem.hxx"
|
||||||
#include "gConvPo.hxx"
|
#include "gConvPo.hxx"
|
||||||
|
|
||||||
#define IMPLptr convert_gen_impl::mcImpl
|
#define IMPLptr convert_gen::mcImpl
|
||||||
#define LOCptr ((convert_po *)convert_gen_impl::mcImpl)
|
#define LOCptr ((convert_po *)convert_gen::mcImpl)
|
||||||
|
|
||||||
/* enlarge token buffer to tokenize whole std::strings */
|
/* enlarge token buffer to tokenize whole std::strings */
|
||||||
#undef YYLMAX
|
#undef YYLMAX
|
||||||
|
@@ -26,8 +26,8 @@
|
|||||||
#include "gL10nMem.hxx"
|
#include "gL10nMem.hxx"
|
||||||
#include "gConvSrc.hxx"
|
#include "gConvSrc.hxx"
|
||||||
|
|
||||||
#define IMPLptr convert_gen_impl::mcImpl
|
#define IMPLptr convert_gen::mcImpl
|
||||||
#define LOCptr ((convert_src *)convert_gen_impl::mcImpl)
|
#define LOCptr ((convert_src *)convert_gen::mcImpl)
|
||||||
|
|
||||||
/* enlarge token buffer to tokenize whole std::strings */
|
/* enlarge token buffer to tokenize whole std::strings */
|
||||||
#undef YYLMAX
|
#undef YYLMAX
|
||||||
|
@@ -26,8 +26,8 @@
|
|||||||
#include "gL10nMem.hxx"
|
#include "gL10nMem.hxx"
|
||||||
#include "gConvTree.hxx"
|
#include "gConvTree.hxx"
|
||||||
|
|
||||||
#define IMPLptr convert_gen_impl::mcImpl
|
#define IMPLptr convert_gen::mcImpl
|
||||||
#define LOCptr ((convert_tree *)convert_gen_impl::mcImpl)
|
#define LOCptr ((convert_tree *)convert_gen::mcImpl)
|
||||||
|
|
||||||
/* enlarge token buffer to tokenize whole std::strings */
|
/* enlarge token buffer to tokenize whole std::strings */
|
||||||
#undef YYLMAX
|
#undef YYLMAX
|
||||||
|
@@ -26,8 +26,8 @@
|
|||||||
#include "gL10nMem.hxx"
|
#include "gL10nMem.hxx"
|
||||||
#include "gConvUlf.hxx"
|
#include "gConvUlf.hxx"
|
||||||
|
|
||||||
#define IMPLptr convert_gen_impl::mcImpl
|
#define IMPLptr convert_gen::mcImpl
|
||||||
#define LOCptr ((convert_ulf *)convert_gen_impl::mcImpl)
|
#define LOCptr ((convert_ulf *)convert_gen::mcImpl)
|
||||||
|
|
||||||
/* enlarge token buffer to tokenize whole std::strings */
|
/* enlarge token buffer to tokenize whole std::strings */
|
||||||
#undef YYLMAX
|
#undef YYLMAX
|
||||||
|
@@ -26,8 +26,8 @@
|
|||||||
#include "gL10nMem.hxx"
|
#include "gL10nMem.hxx"
|
||||||
#include "gConvXcs.hxx"
|
#include "gConvXcs.hxx"
|
||||||
|
|
||||||
#define IMPLptr convert_gen_impl::mcImpl
|
#define IMPLptr convert_gen::mcImpl
|
||||||
#define LOCptr ((convert_xcs *)convert_gen_impl::mcImpl)
|
#define LOCptr ((convert_xcs *)convert_gen::mcImpl)
|
||||||
|
|
||||||
/* enlarge token buffer to tokenize whole std::strings */
|
/* enlarge token buffer to tokenize whole std::strings */
|
||||||
#undef YYLMAX
|
#undef YYLMAX
|
||||||
|
@@ -26,8 +26,8 @@
|
|||||||
#include "gL10nMem.hxx"
|
#include "gL10nMem.hxx"
|
||||||
#include "gConvXcu.hxx"
|
#include "gConvXcu.hxx"
|
||||||
|
|
||||||
#define IMPLptr convert_gen_impl::mcImpl
|
#define IMPLptr convert_gen::mcImpl
|
||||||
#define LOCptr ((convert_xcu *)convert_gen_impl::mcImpl)
|
#define LOCptr ((convert_xcu *)convert_gen::mcImpl)
|
||||||
|
|
||||||
/* enlarge token buffer to tokenize whole std::strings */
|
/* enlarge token buffer to tokenize whole std::strings */
|
||||||
#undef YYLMAX
|
#undef YYLMAX
|
||||||
|
@@ -26,8 +26,8 @@
|
|||||||
#include "gL10nMem.hxx"
|
#include "gL10nMem.hxx"
|
||||||
#include "gConvXhp.hxx"
|
#include "gConvXhp.hxx"
|
||||||
|
|
||||||
#define IMPLptr convert_gen_impl::mcImpl
|
#define IMPLptr convert_gen::mcImpl
|
||||||
#define LOCptr ((convert_xhp *)convert_gen_impl::mcImpl)
|
#define LOCptr ((convert_xhp *)convert_gen::mcImpl)
|
||||||
|
|
||||||
/* enlarge token buffer to tokenize whole std::strings */
|
/* enlarge token buffer to tokenize whole std::strings */
|
||||||
#undef YYLMAX
|
#undef YYLMAX
|
||||||
|
@@ -26,8 +26,8 @@
|
|||||||
#include "gL10nMem.hxx"
|
#include "gL10nMem.hxx"
|
||||||
#include "gConvXrm.hxx"
|
#include "gConvXrm.hxx"
|
||||||
|
|
||||||
#define IMPLptr convert_gen_impl::mcImpl
|
#define IMPLptr convert_gen::mcImpl
|
||||||
#define LOCptr ((convert_xrm *)convert_gen_impl::mcImpl)
|
#define LOCptr ((convert_xrm *)convert_gen::mcImpl)
|
||||||
|
|
||||||
/* enlarge token buffer to tokenize whole std::strings */
|
/* enlarge token buffer to tokenize whole std::strings */
|
||||||
#undef YYLMAX
|
#undef YYLMAX
|
||||||
|
Reference in New Issue
Block a user