summaryrefslogtreecommitdiff
path: root/l10ntools
diff options
context:
space:
mode:
authorjan iversen <jani@documentfoundation.org>2016-03-20 11:52:54 +0100
committerjan iversen <jani@documentfoundation.org>2016-03-22 16:32:19 +0100
commit283cdcf922fcc1605e8f4825c784fe9b3eb8d4ca (patch)
treed8846d2cff6c02d826ec701119bffcd5cbaabeef /l10ntools
parentfe150b57b6c146cb174bfe066d4f6a2ba9b65760 (diff)
genlang, removed std::
Added "using namespace std;" to the cxx/l files thereby being able to remove std:: from all files Change-Id: I92b411870deb7a97b6fd1f7e33674a1e072c0cc1
Diffstat (limited to 'l10ntools')
-rw-r--r--l10ntools/inc/gConv.hxx26
-rw-r--r--l10ntools/inc/gConvPo.hxx22
-rw-r--r--l10ntools/inc/gConvSrc.hxx16
-rw-r--r--l10ntools/inc/gConvTree.hxx12
-rw-r--r--l10ntools/inc/gConvUlf.hxx2
-rw-r--r--l10ntools/inc/gConvXcs.hxx2
-rw-r--r--l10ntools/inc/gConvXcu.hxx2
-rw-r--r--l10ntools/inc/gConvXhp.hxx12
-rw-r--r--l10ntools/inc/gConvXrm.hxx4
-rw-r--r--l10ntools/inc/gL10nMem.hxx100
-rw-r--r--l10ntools/source/gConvPo.cxx3
-rw-r--r--l10ntools/source/gConvProp.cxx5
-rw-r--r--l10ntools/source/gConvSrc.cxx23
-rw-r--r--l10ntools/source/gConvTree.cxx23
-rw-r--r--l10ntools/source/gConvUlf.cxx7
-rw-r--r--l10ntools/source/gConvXcs.cxx15
-rw-r--r--l10ntools/source/gConvXcu.cxx23
-rw-r--r--l10ntools/source/gConvXhp.cxx39
-rw-r--r--l10ntools/source/gConvXrm.cxx15
-rw-r--r--l10ntools/source/gLexPo.l3
-rw-r--r--l10ntools/source/gLexSrc.l3
-rw-r--r--l10ntools/source/gLexTree.l3
-rw-r--r--l10ntools/source/gLexUlf.l3
-rw-r--r--l10ntools/source/gLexXcs.l3
-rw-r--r--l10ntools/source/gLexXcu.l3
-rw-r--r--l10ntools/source/gLexXhp.l3
-rw-r--r--l10ntools/source/gLexXrm.l3
27 files changed, 196 insertions, 179 deletions
diff --git a/l10ntools/inc/gConv.hxx b/l10ntools/inc/gConv.hxx
index 3f0f2137370b..d51f2bf9a808 100644
--- a/l10ntools/inc/gConv.hxx
+++ b/l10ntools/inc/gConv.hxx
@@ -31,9 +31,9 @@ class convert_gen
// Create instance
static convert_gen& createInstance(l10nMem& cMemory,
- const std::string& sSourceDir,
- const std::string& sTargetDir,
- const std::string& sSourceFile);
+ const string& sSourceDir,
+ const string& sTargetDir,
+ const string& sSourceFile);
// do extract/merge
bool execute(const bool bMerge);
@@ -43,28 +43,28 @@ class convert_gen
// utility functions for converters
void lexRead(char *sBuf, int *nResult, int nMax_size);
- std::string& copySource(char const *yyText, bool bDoClear = true);
+ string& copySource(char const *yyText, bool bDoClear = true);
protected:
// generic variables
bool mbMergeMode;
bool mbLoadMode;
- std::string msSourcePath;
- std::string msTargetPath;
- std::string msSourceFile;
+ string msSourcePath;
+ string msTargetPath;
+ string msSourceFile;
l10nMem& mcMemory;
- std::string msCollector;
+ string msCollector;
int miLineNo;
- std::string msSourceBuffer, msCopyText;
+ string msSourceBuffer, msCopyText;
int miSourceReadIndex;
bool prepareFile();
// utility functions for converters
- void writeSourceFile(const std::string& line);
- bool createDir(const std::string& sDir, const std::string& sFile);
+ void writeSourceFile(const string& line);
+ bool createDir(const string& sDir, const string& sFile);
private:
- std::ofstream mcOutputFile;
- bool checkAccess(std::string& sFile);
+ ofstream mcOutputFile;
+ bool checkAccess(string& sFile);
};
#endif
diff --git a/l10ntools/inc/gConvPo.hxx b/l10ntools/inc/gConvPo.hxx
index 4511a27e8981..d76a4a5a1767 100644
--- a/l10ntools/inc/gConvPo.hxx
+++ b/l10ntools/inc/gConvPo.hxx
@@ -42,22 +42,22 @@ class convert_po : public convert_gen
void handleNL ();
// Used to save .pot files
- void startSave(const std::string& sName,
- const std::string& sTargetDir,
- const std::string& sFile);
- void save(const std::string& sFileName,
- const std::string& sKey,
- const std::string& sENUStext,
- const std::string& sText,
+ void startSave(const string& sName,
+ const string& sTargetDir,
+ const string& sFile);
+ void save(const string& sFileName,
+ const string& sKey,
+ const string& sENUStext,
+ const string& sText,
bool bFuzzy);
void endSave();
private:
- std::string msId;
- std::string msStr;
- std::string msKey;
+ string msId;
+ string msStr;
+ string msKey;
bool mbFuzzy;
- std::filebuf outBuffer;
+ filebuf outBuffer;
void doExecute() override;
};
diff --git a/l10ntools/inc/gConvSrc.hxx b/l10ntools/inc/gConvSrc.hxx
index 69d339eb22d9..21fa0f497c98 100644
--- a/l10ntools/inc/gConvSrc.hxx
+++ b/l10ntools/inc/gConvSrc.hxx
@@ -44,11 +44,11 @@ class convert_src : public convert_gen
void stopBlock (char *syyText);
private:
- std::vector<std::string> mcStack;
- std::string msValue;
- std::string msName;
- std::string msTextName;
- std::string msCmd;
+ vector<string> mcStack;
+ string msValue;
+ string msName;
+ string msTextName;
+ string msCmd;
bool mbEnUs;
bool mbExpectName;
bool mbExpectMacro;
@@ -59,8 +59,8 @@ class convert_src : public convert_gen
int miListCount;
int miMacroLevel;
void doExecute() override;
- void trim(std::string& sText);
- void buildKey(std::string& sKey);
- void insertLanguagePart(std::string& sKey, std::string& sTextType);
+ void trim(string& sText);
+ void buildKey(string& sKey);
+ void insertLanguagePart(string& sKey, string& sTextType);
};
#endif
diff --git a/l10ntools/inc/gConvTree.hxx b/l10ntools/inc/gConvTree.hxx
index f795aa9cca02..98b219eb5226 100644
--- a/l10ntools/inc/gConvTree.hxx
+++ b/l10ntools/inc/gConvTree.hxx
@@ -45,14 +45,14 @@ class convert_tree : public convert_gen
void setString (char *yytext);
void setState (char *yytext, STATE_TAG eNewStateTag, STATE_VAL eNewStateVAL);
void setValue (char *yytext);
- std::string& copySourceSpecial (char *yytext, int iType);
- void writeSourceFile (std::string& sText, int inx);
+ string& copySourceSpecial (char *yytext, int iType);
+ void writeSourceFile (string& sText, int inx);
private:
- std::string msLine;
- std::string msId;
- std::string msAppl;
- std::ofstream *mcOutputFiles;
+ string msLine;
+ string msId;
+ string msAppl;
+ ofstream *mcOutputFiles;
STATE_TAG meStateTag;
STATE_VAL meStateVal;
int miCntLanguages;
diff --git a/l10ntools/inc/gConvUlf.hxx b/l10ntools/inc/gConvUlf.hxx
index 255d15fdd927..52d415da2613 100644
--- a/l10ntools/inc/gConvUlf.hxx
+++ b/l10ntools/inc/gConvUlf.hxx
@@ -33,7 +33,7 @@ class convert_ulf : public convert_gen
void setValue(char *syyText);
private:
- std::string msKey;
+ string msKey;
void doExecute() override;
void handleLines();
diff --git a/l10ntools/inc/gConvXcs.hxx b/l10ntools/inc/gConvXcs.hxx
index 26f4ed9b7a84..2d65cc3d2dff 100644
--- a/l10ntools/inc/gConvXcs.hxx
+++ b/l10ntools/inc/gConvXcs.hxx
@@ -34,7 +34,7 @@ class convert_xcs : public convert_gen
void stopCollectData(char *syyText);
private:
- std::string msKey;
+ string msKey;
bool mbCollectingData;
void doExecute() override;
diff --git a/l10ntools/inc/gConvXcu.hxx b/l10ntools/inc/gConvXcu.hxx
index a9815cf270e4..b00b9ba431ce 100644
--- a/l10ntools/inc/gConvXcu.hxx
+++ b/l10ntools/inc/gConvXcu.hxx
@@ -41,7 +41,7 @@ class convert_xcu : public convert_gen
void addLevel();
private:
- std::vector<std::string> mcStack;
+ vector<string> mcStack;
int miLevel;
bool mbNoTranslate;
diff --git a/l10ntools/inc/gConvXhp.hxx b/l10ntools/inc/gConvXhp.hxx
index 404a69b52dab..ef39822cb926 100644
--- a/l10ntools/inc/gConvXhp.hxx
+++ b/l10ntools/inc/gConvXhp.hxx
@@ -43,8 +43,8 @@ class convert_xhp : public convert_gen
void handleSpecial(char *yytext);
void handleDataEnd(char *yytext);
void duplicate(char *yytext);
- std::string& copySourceSpecial(char *yytext, int iType);
- void writeSourceFile(std::string& sText, int inx);
+ string& copySourceSpecial(char *yytext, int iType);
+ void writeSourceFile(string& sText, int inx);
private:
typedef enum {
@@ -55,10 +55,10 @@ class convert_xhp : public convert_gen
VALUE_IS_VALUE_TAG
} STATE;
STATE meExpectValue, mePushValue;
- std::string msKey, msPushCollect;
- std::string msLine;
- std::string *msLangText;
- std::ofstream *mcOutputFiles;
+ string msKey, msPushCollect;
+ string msLine;
+ string *msLangText;
+ ofstream *mcOutputFiles;
int miCntLanguages;
void doExecute() override;
};
diff --git a/l10ntools/inc/gConvXrm.hxx b/l10ntools/inc/gConvXrm.hxx
index e0b32474aa11..4187a848f5e6 100644
--- a/l10ntools/inc/gConvXrm.hxx
+++ b/l10ntools/inc/gConvXrm.hxx
@@ -36,10 +36,10 @@ class convert_xrm : public convert_gen
void stopCollectData(char *yytext);
private:
- std::string msKey;
+ string msKey;
bool mbIsTag;
bool mbIsLang;
- std::string msTag;
+ string msTag;
void doExecute() override;
};
diff --git a/l10ntools/inc/gL10nMem.hxx b/l10ntools/inc/gL10nMem.hxx
index 3cfd9f051746..f89459fca863 100644
--- a/l10ntools/inc/gL10nMem.hxx
+++ b/l10ntools/inc/gL10nMem.hxx
@@ -35,15 +35,15 @@ class l10nMem
ENTRY_NORMAL
} ENTRY_STATE;
- static int showError(const std::string& sText, int iLineNo = 0);
- static void showWarning(const std::string& sText, int iLineNo = 0);
- static void showDebug(const std::string& sText, int iLineNo = 0);
- static void showVerbose(const std::string& sText, int iLineNo = 0);
- static void keyToUpper(std::string& sKey);
+ static int showError(const string& sText, int iLineNo = 0);
+ static void showWarning(const string& sText, int iLineNo = 0);
+ static void showDebug(const string& sText, int iLineNo = 0);
+ static void showVerbose(const string& sText, int iLineNo = 0);
+ static void keyToUpper(string& sKey);
- void setModuleName(const std::string& sModuleName);
- const std::string& getModuleName(void);
- void setLanguage(const std::string& sLanguage,
+ void setModuleName(const string& sModuleName);
+ const string& getModuleName(void);
+ void setLanguage(const string& sLanguage,
bool bCreate);
void setConvert(bool bConvert,
bool bStrict);
@@ -51,83 +51,83 @@ class l10nMem
void setDebug(const bool doDebug);
void loadEntryKey(int iLineNo,
- const std::string& sSourceFile,
- const std::string& sKey,
- const std::string& sOrgText,
- const std::string& sText,
+ const string& sSourceFile,
+ const string& sKey,
+ const string& sOrgText,
+ const string& sText,
bool bIsFuzzy);
void setSourceKey(int iLineNo,
- const std::string& sFilename,
- const std::string& sKey,
- const std::string& sText,
+ const string& sFilename,
+ const string& sKey,
+ const string& sText,
bool bMustExist);
- void saveTemplates(const std::string& sTargetDir,
+ void saveTemplates(const string& sTargetDir,
bool bKid,
bool bForce);
void saveLanguages(l10nMem& cMem,
- const std::string& sTargetDir,
+ const string& sTargetDir,
bool bForce);
- void dumpMem(const std::string& sTargetDir);
+ void dumpMem(const string& sTargetDir);
int prepareMerge();
- bool getMergeLang(std::string& sLang,
- std::string& sText);
+ bool getMergeLang(string& sLang,
+ string& sText);
void showNOconvert();
bool isError();
- void convertToInetString(std::string& sText);
- void convertFromInetString(std::string& sText);
+ void convertToInetString(string& sText);
+ void convertFromInetString(string& sText);
private:
bool mbVerbose;
bool mbDebug;
bool mbInError;
- std::string msModuleName;
+ string msModuleName;
int miCurFileInx;
int miCurLangInx;
int miCurENUSinx;
bool mbNeedWrite;
bool mbConvertMode;
bool mbStrictMode;
- std::vector<l10nMem_enus_entry> mcENUSlist;
- std::vector<l10nMem_file_entry> mcFileList;
- std::vector<l10nMem_lang_list_entry> mcLangList;
+ vector<l10nMem_enus_entry> mcENUSlist;
+ vector<l10nMem_file_entry> mcFileList;
+ vector<l10nMem_lang_list_entry> mcLangList;
- void formatAndShowText(const std::string& sType, int iLineNo, const std::string& sText);
- bool needWrite(const std::string sFileName, bool bForce);
- bool convFilterWarning(const std::string& sSourceFile,
- const std::string& sKey,
- const std::string& sMsgId);
+ void formatAndShowText(const string& sType, int iLineNo, const string& sText);
+ bool needWrite(const string sFileName, bool bForce);
+ bool convFilterWarning(const string& sSourceFile,
+ const string& sKey,
+ const string& sMsgId);
void convEntryKey(int iLineNo,
- const std::string& sSourceFile,
- const std::string& sKey,
- const std::string& sMsgId,
- const std::string& sMsgStr,
+ const string& sSourceFile,
+ const string& sKey,
+ const string& sMsgId,
+ const string& sMsgStr,
bool bIsFuzzy);
void saveTemplates(l10nMem& cMem,
- const std::string& sTargetDir,
+ const string& sTargetDir,
bool bKid,
bool bForce);
void loadENUSkey(int iLineNo,
- const std::string& sSourceFile,
- const std::string& sKey,
- const std::string& sMsgId);
+ const string& sSourceFile,
+ const string& sKey,
+ const string& sMsgId);
void loadLangKey(int iLineNo,
- const std::string& sSourceFile,
- const std::string& sKey,
- const std::string& sMsgId,
- const std::string& sMsgStr,
+ const string& sSourceFile,
+ const string& sKey,
+ const string& sMsgId,
+ const string& sMsgStr,
bool bFuzzy);
void reorganize(bool bConvert);
bool locateKey(int iLineNo,
- const std::string& sSourceFile,
- const std::string& sKey,
- const std::string& sMsgId,
+ const string& sSourceFile,
+ const string& sKey,
+ const string& sMsgId,
bool bThrow);
void addKey(int iLineNo,
- const std::string& sSourceFile,
- const std::string& sKey,
- const std::string& sMsgId,
+ const string& sSourceFile,
+ const string& sKey,
+ const string& sMsgId,
l10nMem::ENTRY_STATE eStat);
- bool findFileName(const std::string& sSourceFile);
+ bool findFileName(const string& sSourceFile);
};
#endif
diff --git a/l10ntools/source/gConvPo.cxx b/l10ntools/source/gConvPo.cxx
index 1eccf9a08841..d82d2912c3fb 100644
--- a/l10ntools/source/gConvPo.cxx
+++ b/l10ntools/source/gConvPo.cxx
@@ -200,7 +200,8 @@ void convert_po::save(const string& sFileName,
outFile << "#. xxxxx" << endl
<< "#: " << sName << endl
<< "msgctxt \"\"" << endl
- << "\"" << sName << "\\n\"" << endl;
+ << "\"" << sName << "\\n\"" << endl
+ << "\"" << sKey << "\\n\"" << endl;
if (bFuzzy)
outFile << "#, fuzzy" << endl;
outFile << "msgid \"" << sENUStext << "\"" << endl
diff --git a/l10ntools/source/gConvProp.cxx b/l10ntools/source/gConvProp.cxx
index 76d7c936c4d3..b473c6d51998 100644
--- a/l10ntools/source/gConvProp.cxx
+++ b/l10ntools/source/gConvProp.cxx
@@ -18,6 +18,7 @@
*/
#include <string>
#include <vector>
+using namespace std;
#include "gL10nMem.hxx"
#include "gConvProp.hxx"
@@ -26,7 +27,7 @@
convert_prop::convert_prop(l10nMem& crMemory) : convert_gen(crMemory)
{
- // throw l10nMem::showError(std::string("convert_prop not implemented"));
+ // throw l10nMem::showError(string("convert_prop not implemented"));
}
@@ -39,5 +40,5 @@ convert_prop::~convert_prop()
void convert_prop::doExecute()
{
- throw l10nMem::showError(std::string("convert_prop::execute not implemented"));
+ throw l10nMem::showError(string("convert_prop::execute not implemented"));
}
diff --git a/l10ntools/source/gConvSrc.cxx b/l10ntools/source/gConvSrc.cxx
index b3f4736d65fc..a6dbe2f9b087 100644
--- a/l10ntools/source/gConvSrc.cxx
+++ b/l10ntools/source/gConvSrc.cxx
@@ -18,6 +18,7 @@
*/
#include <string>
#include <vector>
+using namespace std;
#include "gL10nMem.hxx"
@@ -68,7 +69,7 @@ void convert_src::setValue(char *syyText, char *sbuildValue)
void convert_src::setLang(char *syyText, bool bEnUs)
{
- std::string useText = copySource(syyText) + " is no en-US language";
+ string useText = copySource(syyText) + " is no en-US language";
mbEnUs = bEnUs;
if (!bEnUs && mbExpectValue)
@@ -98,7 +99,7 @@ void convert_src::setText(char *syyText)
void convert_src::setName(char *syyText)
{
- std::string useText = copySource(syyText);
+ string useText = copySource(syyText);
trim(useText);
if (mbExpectName) {
@@ -152,7 +153,7 @@ void convert_src::setList(char *syyText)
void convert_src::setNL(char *syyText, bool bMacro)
{
int nL;
- std::string sKey;
+ string sKey;
copySource(syyText);
@@ -162,13 +163,13 @@ void convert_src::setNL(char *syyText, bool bMacro)
for (nL = -1;;) {
nL = msValue.find("\\\"", nL+1);
- if (nL == (int)std::string::npos)
+ if (nL == (int)string::npos)
break;
msValue.erase(nL,1);
}
for (nL = -1;;) {
nL = msValue.find("\\\\", nL+1);
- if (nL == (int)std::string::npos)
+ if (nL == (int)string::npos)
break;
msValue.erase(nL,1);
}
@@ -240,8 +241,8 @@ void convert_src::setListItem(char const *syyText, bool bIsStart)
else
{
if (mbInListItem) {
- std::stringstream ssBuf;
- std::string myKey;
+ stringstream ssBuf;
+ string myKey;
++miListCount;
mcStack.pop_back();
@@ -261,7 +262,7 @@ void convert_src::setListItem(char const *syyText, bool bIsStart)
-void convert_src::trim(std::string& sText)
+void convert_src::trim(string& sText)
{
int nL;
@@ -275,7 +276,7 @@ void convert_src::trim(std::string& sText)
-void convert_src::buildKey(std::string& sKey)
+void convert_src::buildKey(string& sKey)
{
int nL;
@@ -288,9 +289,9 @@ void convert_src::buildKey(std::string& sKey)
-void convert_src::insertLanguagePart(std::string& sKey, std::string& sTextType)
+void convert_src::insertLanguagePart(string& sKey, string& sTextType)
{
- std::string sLang, sText, sTagText;
+ string sLang, sText, sTagText;
// just to please compiler
diff --git a/l10ntools/source/gConvTree.cxx b/l10ntools/source/gConvTree.cxx
index 0b62ccaa6957..197b1d4f0e06 100644
--- a/l10ntools/source/gConvTree.cxx
+++ b/l10ntools/source/gConvTree.cxx
@@ -18,6 +18,7 @@
*/
#include <string>
#include <vector>
+using namespace std;
#include "gL10nMem.hxx"
#include "gConvTree.hxx"
@@ -51,8 +52,8 @@ convert_tree::~convert_tree()
extern int treelex(void);
void convert_tree::doExecute()
{
- std::string sLang;
- std::string sFile, sFile2;
+ string sLang;
+ string sFile, sFile2;
if (mbMergeMode)
throw l10nMem::showError("Merge not implemented");
@@ -60,17 +61,17 @@ void convert_tree::doExecute()
// prepare list with languages
if (mbMergeMode) {
miCntLanguages = mcMemory.prepareMerge();
- mcOutputFiles = new std::ofstream[miCntLanguages];
+ mcOutputFiles = new ofstream[miCntLanguages];
for (int i = 0; mcMemory.getMergeLang(sLang, sFile); ++i) {
sFile2 = sLang + "/" + msSourceFile;
sFile = msTargetPath + sFile2;
- mcOutputFiles[i].open(sFile.c_str(), std::ios::binary);
+ mcOutputFiles[i].open(sFile.c_str(), ios::binary);
if (!mcOutputFiles[i].is_open()) {
if (!convert_gen::createDir(msTargetPath, sFile2))
throw l10nMem::showError("Cannot create missing directories (" + sFile + ") for writing");
- mcOutputFiles[i].open(sFile.c_str(), std::ios::binary);
+ mcOutputFiles[i].open(sFile.c_str(), ios::binary);
if (!mcOutputFiles[i].is_open())
throw l10nMem::showError("Cannot open file (" + sFile + ") for writing");
}
@@ -103,7 +104,7 @@ void convert_tree::setString(char *yytext)
break;
case STATE_VAL_TITLE:
- std::string sText = copySourceSpecial(yytext, 1);
+ string sText = copySourceSpecial(yytext, 1);
sText.erase(sText.size()-1);
mcMemory.setSourceKey(miLineNo, msSourceFile, msId, sText, mbMergeMode);
break;
@@ -134,10 +135,10 @@ void convert_tree::setValue(char *yytext)
-std::string& convert_tree::copySourceSpecial(char *yytext, int iType)
+string& convert_tree::copySourceSpecial(char *yytext, int iType)
{
- std::string& sText = copySource(yytext, false);
- std::string sLang, sTemp;
+ string& sText = copySource(yytext, false);
+ string sLang, sTemp;
int i;
// Handling depends on iType
@@ -172,7 +173,7 @@ std::string& convert_tree::copySourceSpecial(char *yytext, int iType)
writeSourceFile(msLine, i);
mcMemory.getMergeLang(sLang, sTemp);
writeSourceFile(sTemp,i);
- std::string sYY(yytext);
+ string sYY(yytext);
writeSourceFile(sYY, i);
}
msLine.clear();
@@ -191,7 +192,7 @@ std::string& convert_tree::copySourceSpecial(char *yytext, int iType)
-void convert_tree::writeSourceFile(std::string& sText, int inx)
+void convert_tree::writeSourceFile(string& sText, int inx)
{
if (sText.size() && mcOutputFiles[inx].is_open())
mcOutputFiles[inx].write(sText.c_str(), sText.size());
diff --git a/l10ntools/source/gConvUlf.cxx b/l10ntools/source/gConvUlf.cxx
index fc532c18b7e4..424396eb322c 100644
--- a/l10ntools/source/gConvUlf.cxx
+++ b/l10ntools/source/gConvUlf.cxx
@@ -18,6 +18,7 @@
*/
#include <string>
#include <vector>
+using namespace std;
#include "gL10nMem.hxx"
#include "gConvUlf.hxx"
@@ -38,7 +39,7 @@ void convert_ulf::doExecute()
void convert_ulf::setKey(char *syyText)
{
- std::string sText = copySource(syyText);
+ string sText = copySource(syyText);
// locate key (is any)
msKey = sText.substr(1,sText.size()-2);
@@ -48,7 +49,7 @@ void convert_ulf::setKey(char *syyText)
void convert_ulf::setText(char *syyText, bool bIsEnUs)
{
- std::string sText = copySource(syyText) + " is not en-US";
+ string sText = copySource(syyText) + " is not en-US";
if (!bIsEnUs)
@@ -59,7 +60,7 @@ void convert_ulf::setText(char *syyText, bool bIsEnUs)
void convert_ulf::setValue(char *syyText)
{
- std::string sLang, sText = copySource(syyText);
+ string sLang, sText = copySource(syyText);
int nL;
sText.erase(0,1);
diff --git a/l10ntools/source/gConvXcs.cxx b/l10ntools/source/gConvXcs.cxx
index 2d190d6663e8..1753b792154b 100644
--- a/l10ntools/source/gConvXcs.cxx
+++ b/l10ntools/source/gConvXcs.cxx
@@ -18,6 +18,7 @@
*/
#include <string>
#include <vector>
+using namespace std;
#include "gL10nMem.hxx"
#include "gConvXcs.hxx"
@@ -53,15 +54,15 @@ void convert_xcs::doExecute()
void convert_xcs::setKey(char *syyText)
{
int nL;
- std::string sHead, sText = copySource(syyText);
+ string sHead, sText = copySource(syyText);
// is it to be translated
- if (sText.find("oor:localized=") == std::string::npos)
+ if (sText.find("oor:localized=") == string::npos)
return;
// locate key (is any)
nL = sText.find("oor:name=\"");
- if (nL == (int)std::string::npos)
+ if (nL == (int)string::npos)
return;
sHead = sText.substr(nL+10);
nL = sHead.find("\"");
@@ -88,14 +89,14 @@ void convert_xcs::startCollectData(char *syyText)
void convert_xcs::stopCollectData(char *syyText)
{
- std::string sHead, sKey, sLang, sText, sCollectedText = copySource(syyText, false);
+ string sHead, sKey, sLang, sText, sCollectedText = copySource(syyText, false);
int nL;
// get type of tag
msCollector += sCollectedText;
nL = msCollector.find("<p");
- if (nL != (int)std::string::npos)
+ if (nL != (int)string::npos)
sHead = msCollector.substr(nL+1, 1);
else {
nL = msCollector.find("<h");
@@ -114,8 +115,8 @@ void convert_xcs::stopCollectData(char *syyText)
if (mbMergeMode) {
#if 0
// get all languages (includes en-US)
- std::vector<l10nMem_entry *>& cExtraLangauges = mcMemory.getLanguagesForKey(sKey);
- std::string sNewLine;
+ vector<l10nMem_entry *>& cExtraLangauges = mcMemory.getLanguagesForKey(sKey);
+ string sNewLine;
nL = cExtraLangauges.size();
for (int i = 0; i < nL; ++i) {
diff --git a/l10ntools/source/gConvXcu.cxx b/l10ntools/source/gConvXcu.cxx
index 2579a38ca840..ddb2b0297e81 100644
--- a/l10ntools/source/gConvXcu.cxx
+++ b/l10ntools/source/gConvXcu.cxx
@@ -18,6 +18,7 @@
*/
#include <string>
#include <vector>
+using namespace std;
#include "gL10nMem.hxx"
#include "gConvXcu.hxx"
@@ -47,16 +48,16 @@ void convert_xcu::doExecute()
void convert_xcu::pushKey(char *syyText)
{
- std::string sKey, sTag = copySource(syyText);
+ string sKey, sTag = copySource(syyText);
int nL, nE;
// find key in tag
nL = sTag.find("oor:name=\"");
- if (nL != (int)std::string::npos) {
+ if (nL != (int)string::npos) {
// find end of key
nL += 10;
nE = sTag.find("\"", nL);
- if (nE != (int)std::string::npos)
+ if (nE != (int)string::npos)
sKey = sTag.substr(nL, nE - nL);
}
mcStack.push_back(sKey);
@@ -80,14 +81,14 @@ void convert_xcu::popKey(char *syyText)
void convert_xcu::startCollectData(char *syyText)
{
int nL;
- std::string sTag = copySource(syyText);
+ string sTag = copySource(syyText);
if (mbNoTranslate)
return;
// locate object name
nL = sTag.find("xml:lang=\"");
- if (nL != (int)std::string::npos) {
+ if (nL != (int)string::npos) {
// test langauge
nL += 10;
if (sTag.substr(nL,5) == "en-US")
@@ -95,7 +96,7 @@ void convert_xcu::startCollectData(char *syyText)
else if (sTag.substr(nL,14) == "x-no-translate")
mbNoTranslate = true;
else {
- std::string sErr = sTag.substr(nL,5) + " is not en-US";
+ string sErr = sTag.substr(nL,5) + " is not en-US";
l10nMem::showError(sErr);
}
}
@@ -106,7 +107,7 @@ void convert_xcu::startCollectData(char *syyText)
void convert_xcu::stopCollectData(char *syyText)
{
int nL;
- std::string useKey, useText = msCollector;
+ string useKey, useText = msCollector;
copySource(syyText);
@@ -117,7 +118,7 @@ void convert_xcu::stopCollectData(char *syyText)
// remove any newline
for (nL = 0;;) {
nL = useText.find("\n");
- if (nL == (int)std::string::npos)
+ if (nL == (int)string::npos)
break;
useText.erase(nL,1);
}
@@ -132,7 +133,7 @@ void convert_xcu::stopCollectData(char *syyText)
}
if (mbMergeMode) {
- std::string sLang, sText, sNewLine;
+ string sLang, sText, sNewLine;
// prepare to read all languages
mcMemory.prepareMerge();
@@ -149,7 +150,7 @@ void convert_xcu::stopCollectData(char *syyText)
void convert_xcu::copySpecial(char *syyText)
{
int nx = msCollector.size();
- std::string sText = copySource(syyText, mbNoCollectingData);
+ string sText = copySource(syyText, mbNoCollectingData);
if (!mbNoCollectingData) {
msCollector.erase(nx);
@@ -163,7 +164,7 @@ void convert_xcu::copySpecial(char *syyText)
void convert_xcu::copyNL(char *syyText)
{
int nX = msCollector.size();
- std::string sText = copySource(syyText, mbNoCollectingData);
+ string sText = copySource(syyText, mbNoCollectingData);
if (!mbNoCollectingData) {
msCollector.erase(nX);
diff --git a/l10ntools/source/gConvXhp.cxx b/l10ntools/source/gConvXhp.cxx
index c2460a42fdfc..0a08ec7080f0 100644
--- a/l10ntools/source/gConvXhp.cxx
+++ b/l10ntools/source/gConvXhp.cxx
@@ -18,6 +18,7 @@
*/
#include <string>
#include <vector>
+using namespace std;
#include "gL10nMem.hxx"
#include "gConvXhp.hxx"
@@ -50,24 +51,24 @@ convert_xhp::~convert_xhp()
extern int xhplex(void);
void convert_xhp::doExecute()
{
- std::string sLang;
- std::string sFile, sFile2;
+ string sLang;
+ string sFile, sFile2;
// prepare list with languages
miCntLanguages = mcMemory.prepareMerge();
if (mbMergeMode) {
- mcOutputFiles = new std::ofstream[miCntLanguages];
- msLangText = new std::string[miCntLanguages];
+ mcOutputFiles = new ofstream[miCntLanguages];
+ msLangText = new string[miCntLanguages];
for (int i = 0; mcMemory.getMergeLang(sLang, sFile); ++i) {
sFile2 = sLang + "/text/" + mcMemory.getModuleName().substr(5) + "/" + msSourceFile;
sFile = msTargetPath + sFile2;
- mcOutputFiles[i].open(sFile.c_str(), std::ios::binary);
+ mcOutputFiles[i].open(sFile.c_str(), ios::binary);
if (!mcOutputFiles[i].is_open()) {
if (!convert_gen::createDir(msTargetPath, sFile2))
throw l10nMem::showError("Cannot create missing directories (" + sFile + ") for writing");
- mcOutputFiles[i].open(sFile.c_str(), std::ios::binary);
+ mcOutputFiles[i].open(sFile.c_str(), ios::binary);
if (!mcOutputFiles[i].is_open())
throw l10nMem::showError("Cannot open file (" + sFile + ") for writing");
}
@@ -146,12 +147,12 @@ void convert_xhp::closeTagNOvalue(char *yytext)
void convert_xhp::setId(char *yytext)
{
int nL, nE;
- std::string& sText = copySourceSpecial(yytext, 0);
+ string& sText = copySourceSpecial(yytext, 0);
nL = sText.find("\"");
nE = sText.find("\"", nL+1);
- if (nL == (int)std::string::npos || nE == (int)std::string::npos)
+ if (nL == (int)string::npos || nE == (int)string::npos)
return;
switch (meExpectValue) {
@@ -172,13 +173,13 @@ void convert_xhp::setId(char *yytext)
void convert_xhp::setLang(char *yytext)
{
int nL, nE;
- std::string sLang;
- std::string& sText = copySourceSpecial(yytext, 1);
+ string sLang;
+ string& sText = copySourceSpecial(yytext, 1);
nL = sText.find("\"");
nE = sText.find("\"", nL+1);
- if (nL == (int)std::string::npos || nE == (int)std::string::npos)
+ if (nL == (int)string::npos || nE == (int)string::npos)
return;
switch (meExpectValue) {
@@ -206,12 +207,12 @@ void convert_xhp::setLang(char *yytext)
void convert_xhp::setRef(char *yytext)
{
int nL, nE;
- std::string& sText = copySourceSpecial(yytext, 0);
+ string& sText = copySourceSpecial(yytext, 0);
nL = sText.find("\"");
nE = sText.find("\"", nL+1);
- if (nL == (int)std::string::npos || nE == (int)std::string::npos)
+ if (nL == (int)string::npos || nE == (int)string::npos)
return;
switch (meExpectValue) {
@@ -285,7 +286,7 @@ void convert_xhp::stopComment(char *yytext)
void convert_xhp::handleSpecial(char *yytext)
{
if (meExpectValue != VALUE_IS_VALUE || meExpectValue != VALUE_IS_VALUE_TAG) {
- std::string sText(yytext);
+ string sText(yytext);
mcMemory.convertFromInetString(sText);
msCollector += sText;
}
@@ -316,11 +317,11 @@ void convert_xhp::duplicate(char *yytext)
-std::string& convert_xhp::copySourceSpecial(char *yytext, int iType)
+string& convert_xhp::copySourceSpecial(char *yytext, int iType)
{
bool doingValue = (meExpectValue == VALUE_IS_VALUE || meExpectValue == VALUE_IS_VALUE_TAG);
- std::string& sText = copySource(yytext, !doingValue);
- std::string sLang;
+ string& sText = copySource(yytext, !doingValue);
+ string sLang;
int i;
@@ -358,7 +359,7 @@ std::string& convert_xhp::copySourceSpecial(char *yytext, int iType)
writeSourceFile(msLine, i);
mcMemory.getMergeLang(sLang, sText);
writeSourceFile(sText,i);
- std::string sYY(yytext);
+ string sYY(yytext);
writeSourceFile(sYY, i);
}
msLine.clear();
@@ -377,7 +378,7 @@ std::string& convert_xhp::copySourceSpecial(char *yytext, int iType)
-void convert_xhp::writeSourceFile(std::string& sText, int inx)
+void convert_xhp::writeSourceFile(string& sText, int inx)
{
if (sText.size() && mcOutputFiles[inx].is_open())
mcOutputFiles[inx].write(sText.c_str(), sText.size());
diff --git a/l10ntools/source/gConvXrm.cxx b/l10ntools/source/gConvXrm.cxx
index 3184dc85176b..afe9bc5433a4 100644
--- a/l10ntools/source/gConvXrm.cxx
+++ b/l10ntools/source/gConvXrm.cxx
@@ -18,6 +18,7 @@
*/
#include <string>
#include <vector>
+using namespace std;
#include "gL10nMem.hxx"
#include "gConvXrm.hxx"
@@ -54,14 +55,14 @@ void convert_xrm::doExecute()
void convert_xrm::setId(char *yytext)
{
- std::string& sText = copySource(yytext, mbNoCollectingData);
+ string& sText = copySource(yytext, mbNoCollectingData);
int nL, nE;
if (mbIsTag) {
nL = sText.find("\"");
nE = sText.find("\"", nL+1);
- if (nL == (int)std::string::npos || nE == (int)std::string::npos)
+ if (nL == (int)string::npos || nE == (int)string::npos)
return;
msKey = sText.substr(nL+1, nE - nL -1);
@@ -72,15 +73,15 @@ void convert_xrm::setId(char *yytext)
void convert_xrm::setLang(char *yytext)
{
- std::string& sText = copySource(yytext, mbNoCollectingData);
- std::string sLang;
+ string& sText = copySource(yytext, mbNoCollectingData);
+ string sLang;
int nL, nE;
if (mbIsTag) {
nL = sText.find("\"");
nE = sText.find("\"", nL+1);
- if (nL == (int)std::string::npos || nE == (int)std::string::npos)
+ if (nL == (int)string::npos || nE == (int)string::npos)
return;
sLang = sText.substr(nL+1, nE - nL -1);
@@ -118,7 +119,7 @@ void convert_xrm::startCollectData(char *yytext)
void convert_xrm::stopCollectData(char *yytext)
{
- std::string sTagText, sTagEnd, sLang, sText = msCollector;
+ string sTagText, sTagEnd, sLang, sText = msCollector;
copySource(yytext);
if (!mbNoCollectingData) {
@@ -132,7 +133,7 @@ void convert_xrm::stopCollectData(char *yytext)
mcMemory.prepareMerge();
for (; mcMemory.getMergeLang(sLang, sText);) {
// replace \" with "
- for (int i = 0; (i = sText.find("\\\"", i)) != (int)std::string::npos;)
+ for (int i = 0; (i = sText.find("\\\"", i)) != (int)string::npos;)
sText.erase(i,1);
// Prepare tag start and end
diff --git a/l10ntools/source/gLexPo.l b/l10ntools/source/gLexPo.l
index 9faf94f53029..d390e007e3a8 100644
--- a/l10ntools/source/gLexPo.l
+++ b/l10ntools/source/gLexPo.l
@@ -37,6 +37,7 @@
%top{
#include <string>
#include <vector>
+using namespace std;
#include "gL10nMem.hxx"
#include "gConvPo.hxx"
@@ -44,7 +45,7 @@
#define IMPLptr convert_gen::mcImpl
#define LOCptr ((convert_po *)convert_gen::mcImpl)
-/* enlarge token buffer to tokenize whole std::strings */
+/* enlarge token buffer to tokenize whole strings */
#undef YYLMAX
#define YYLMAX 64000
diff --git a/l10ntools/source/gLexSrc.l b/l10ntools/source/gLexSrc.l
index ea8c152d5837..e5446e417399 100644
--- a/l10ntools/source/gLexSrc.l
+++ b/l10ntools/source/gLexSrc.l
@@ -22,6 +22,7 @@
%top{
#include <string>
#include <vector>
+using namespace std;
#include "gL10nMem.hxx"
#include "gConvSrc.hxx"
@@ -29,7 +30,7 @@
#define IMPLptr convert_gen::mcImpl
#define LOCptr ((convert_src *)convert_gen::mcImpl)
-/* enlarge token buffer to tokenize whole std::strings */
+/* enlarge token buffer to tokenize whole strings */
#undef YYLMAX
#define YYLMAX 64000
diff --git a/l10ntools/source/gLexTree.l b/l10ntools/source/gLexTree.l
index 6c5b9089b62b..9778f8c9846e 100644
--- a/l10ntools/source/gLexTree.l
+++ b/l10ntools/source/gLexTree.l
@@ -22,6 +22,7 @@
%top{
#include <string>
#include <vector>
+using namespace std;
#include "gL10nMem.hxx"
#include "gConvTree.hxx"
@@ -29,7 +30,7 @@
#define IMPLptr convert_gen::mcImpl
#define LOCptr ((convert_tree *)convert_gen::mcImpl)
-/* enlarge token buffer to tokenize whole std::strings */
+/* enlarge token buffer to tokenize whole strings */
#undef YYLMAX
#define YYLMAX 64000
diff --git a/l10ntools/source/gLexUlf.l b/l10ntools/source/gLexUlf.l
index 5980b3d8122f..f6409ec359ee 100644
--- a/l10ntools/source/gLexUlf.l
+++ b/l10ntools/source/gLexUlf.l
@@ -22,6 +22,7 @@
%top{
#include <string>
#include <vector>
+using namespace std;
#include "gL10nMem.hxx"
#include "gConvUlf.hxx"
@@ -29,7 +30,7 @@
#define IMPLptr convert_gen::mcImpl
#define LOCptr ((convert_ulf *)convert_gen::mcImpl)
-/* enlarge token buffer to tokenize whole std::strings */
+/* enlarge token buffer to tokenize whole strings */
#undef YYLMAX
#define YYLMAX 64000
diff --git a/l10ntools/source/gLexXcs.l b/l10ntools/source/gLexXcs.l
index cd4cec8532b0..25abd467efed 100644
--- a/l10ntools/source/gLexXcs.l
+++ b/l10ntools/source/gLexXcs.l
@@ -22,6 +22,7 @@
%top{
#include <string>
#include <vector>
+using namespace std;
#include "gL10nMem.hxx"
#include "gConvXcs.hxx"
@@ -29,7 +30,7 @@
#define IMPLptr convert_gen::mcImpl
#define LOCptr ((convert_xcs *)convert_gen::mcImpl)
-/* enlarge token buffer to tokenize whole std::strings */
+/* enlarge token buffer to tokenize whole strings */
#undef YYLMAX
#define YYLMAX 64000
diff --git a/l10ntools/source/gLexXcu.l b/l10ntools/source/gLexXcu.l
index 9b7a52063359..25c227756251 100644
--- a/l10ntools/source/gLexXcu.l
+++ b/l10ntools/source/gLexXcu.l
@@ -22,6 +22,7 @@
%top{
#include <string>
#include <vector>
+using namespace std;
#include "gL10nMem.hxx"
#include "gConvXcu.hxx"
@@ -29,7 +30,7 @@
#define IMPLptr convert_gen::mcImpl
#define LOCptr ((convert_xcu *)convert_gen::mcImpl)
-/* enlarge token buffer to tokenize whole std::strings */
+/* enlarge token buffer to tokenize whole strings */
#undef YYLMAX
#define YYLMAX 64000
diff --git a/l10ntools/source/gLexXhp.l b/l10ntools/source/gLexXhp.l
index 1bd5c0c2be23..0af3a412d9a7 100644
--- a/l10ntools/source/gLexXhp.l
+++ b/l10ntools/source/gLexXhp.l
@@ -22,6 +22,7 @@
%top{
#include <string>
#include <vector>
+using namespace std;
#include "gL10nMem.hxx"
#include "gConvXhp.hxx"
@@ -29,7 +30,7 @@
#define IMPLptr convert_gen::mcImpl
#define LOCptr ((convert_xhp *)convert_gen::mcImpl)
-/* enlarge token buffer to tokenize whole std::strings */
+/* enlarge token buffer to tokenize whole strings */
#undef YYLMAX
#define YYLMAX 64000
diff --git a/l10ntools/source/gLexXrm.l b/l10ntools/source/gLexXrm.l
index 140edf1e0000..9ef4d20e26e4 100644
--- a/l10ntools/source/gLexXrm.l
+++ b/l10ntools/source/gLexXrm.l
@@ -22,6 +22,7 @@
%top{
#include <string>
#include <vector>
+using namespace std;
#include "gL10nMem.hxx"
#include "gConvXrm.hxx"
@@ -29,7 +30,7 @@
#define IMPLptr convert_gen::mcImpl
#define LOCptr ((convert_xrm *)convert_gen::mcImpl)
-/* enlarge token buffer to tokenize whole std::strings */
+/* enlarge token buffer to tokenize whole strings */
#undef YYLMAX
#define YYLMAX 64000