28 #ifndef __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
29 #define __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
40 #include <boost/cstdint.hpp>
53 char name[std::numeric_limits<boost::int16_t>::digits10 + 2];
54 sprintf(name,
"%hd", value);
65 char name[std::numeric_limits<boost::uint16_t>::digits10 + 2];
66 sprintf(name,
"%hu", value);
77 char name[std::numeric_limits<boost::int32_t>::digits10 + 2];
78 sprintf(name,
"%d", value);
89 char name[std::numeric_limits<boost::uint32_t>::digits10 + 2];
90 sprintf(name,
"%u", value);
101 char name[std::numeric_limits<boost::int64_t>::digits10 + 2];
102 sprintf(name,
"%lli", value);
113 char name[std::numeric_limits<boost::uint64_t>::digits10 + 2];
114 sprintf(name,
"%llu", value);
125 char name[std::numeric_limits<float>::digits10 + std::numeric_limits<float>::digits + 4];
126 sprintf(name,
"%f", value);
137 char name[std::numeric_limits<double>::digits10 + std::numeric_limits<double>::digits + 4];
138 sprintf(name,
"%e", value);
152 sprintf(name,
"%.*f", precision, value );
165 size_t size = value.size();
167 std::string aux(size,
' ');
169 for(
size_t i = 0; i < size; ++i)
170 aux[i] = ((value[i] >= 97) && (value[i] <= 122)) ? (value[i] - 32) : value[i];
184 size_t size = value.size();
186 for(
size_t i = 0; i < size; ++i)
187 value[i] = ((value[i] >= 97) && (value[i] <= 122)) ? (value[i] - 32) : value[i];
199 size_t size = value.size();
201 std::string aux(size,
' ');
203 for(
size_t i = 0; i < size; ++i)
204 aux[i] = ((value[i] >= 65) && (value[i] <= 90)) ? (value[i] + 32) : value[i];
217 std::vector<std::string>& tokens,
218 const std::string& delimiters =
" ")
221 size_t lastPos = str.find_first_not_of(delimiters, 0);
224 size_t pos = str.find_first_of(delimiters, lastPos);
226 while((std::string::npos != pos) ||
227 (std::string::npos != lastPos))
230 tokens.push_back(str.substr(lastPos, pos - lastPos));
233 lastPos = str.find_first_not_of(delimiters, pos);
236 pos = str.find_first_of(delimiters, lastPos);
252 std::map<std::string, std::string>& kvp,
253 const std::string& kvpDelimiter =
"&",
254 const std::string& kvDelimiter =
"=",
255 bool toUpper =
false)
261 std::vector<std::string> tokens;
263 Tokenize(kvpStr, tokens, kvpDelimiter);
266 size_t size = tokens.size();
268 for(
size_t i = 0; i < size; ++i)
270 std::vector<std::string> kv;
272 Tokenize(tokens[i], kv, kvDelimiter);
290 for(
size_t k = 1; k < kv.size(); ++k)
293 size_t pos = aux.size() - 1;
295 kvp[kv[0]] = aux.erase(pos, 1);
309 char* cs =
new char[s.length() + 1];
310 strncpy(cs, s.c_str(), s.length() + 1);
323 std::size_t ns = vs.size() ;
325 char** as =
new char*[ns + 1];
329 for(std::size_t i = 0; i< ns; ++i)
331 as[i] =
new char[vs[i]->length() + 1];
333 strncpy(as[i], vs[i]->c_str(), vs[i]->length() + 1);
348 std::size_t ns = vs.size() ;
350 char** as =
new char*[ns + 1];
354 for(std::size_t i = 0; i< ns; ++i)
356 as[i] =
new char[vs[i].length() + 1];
358 strncpy(as[i], vs[i].c_str(), vs[i].length() + 1);
373 static std::vector<std::string> upperIn;
374 static std::vector<std::string> upperOut;
376 if(upperIn.empty() ==
true || upperOut.empty() ==
true)
381 upperIn.push_back(
"Á );
upperIn.push_back("É");
upperIn.push_back("Í");
upperIn.push_back("Ó");
upperIn.push_back("Ú");
upperIn.push_back("À");
upperIn.push_back("È");
upperIn.push_back("Ì");
upperIn.push_back("Ò");
upperIn.push_back("Ù");
upperIn.push_back("Ä");
upperIn.push_back("Ë");
upperIn.push_back("Ï");
upperIn.push_back("Ö");
upperIn.push_back("Ü");
upperIn.push_back("Â");
upperIn.push_back("Ê");
upperIn.push_back("Î");
upperIn.push_back("Ô");
upperIn.push_back("Û");
upperIn.push_back("Ã");
upperIn.push_back("Õ");
upperIn.push_back("Ç");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("O");
upperOut.push_back("C");
}
vecUpperIn = upperIn;
vecUpperOut = upperOut;
}
/*!
\brief It build two string vectors with special lower case characters and the his respective normal characters
\param vecUpperIn The vector with lower case special characters.
\param vecUpperOut The vector with lower case normal characters.
*/
inline void GetAccentuatedLowerVector(std::vector<std::string> & vecLowerIn, std::vector<std::string> & vecLowerOut)
{
static std::vector<std::string> lowerIn;
static std::vector<std::string> lowerOut;
if(lowerIn.empty() == true || lowerOut.empty() == true)
{
lowerIn.clear();
lowerOut.clear();
lowerIn.push_back("á");
lowerIn.push_back("é");
lowerIn.push_back("í");
lowerIn.push_back("ó");
lowerIn.push_back("ú");
lowerIn.push_back("à");
lowerIn.push_back("è");
lowerIn.push_back("ì");
lowerIn.push_back("ò");
lowerIn.push_back("ù");
lowerIn.push_back("ä");
lowerIn.push_back("ë");
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
382 upperIn.push_back(
"É );
upperIn.push_back("Í");
upperIn.push_back("Ó");
upperIn.push_back("Ú");
upperIn.push_back("À");
upperIn.push_back("È");
upperIn.push_back("Ì");
upperIn.push_back("Ò");
upperIn.push_back("Ù");
upperIn.push_back("Ä");
upperIn.push_back("Ë");
upperIn.push_back("Ï");
upperIn.push_back("Ö");
upperIn.push_back("Ü");
upperIn.push_back("Â");
upperIn.push_back("Ê");
upperIn.push_back("Î");
upperIn.push_back("Ô");
upperIn.push_back("Û");
upperIn.push_back("Ã");
upperIn.push_back("Õ");
upperIn.push_back("Ç");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("O");
upperOut.push_back("C");
}
vecUpperIn = upperIn;
vecUpperOut = upperOut;
}
/*!
\brief It build two string vectors with special lower case characters and the his respective normal characters
\param vecUpperIn The vector with lower case special characters.
\param vecUpperOut The vector with lower case normal characters.
*/
inline void GetAccentuatedLowerVector(std::vector<std::string> & vecLowerIn, std::vector<std::string> & vecLowerOut)
{
static std::vector<std::string> lowerIn;
static std::vector<std::string> lowerOut;
if(lowerIn.empty() == true || lowerOut.empty() == true)
{
lowerIn.clear();
lowerOut.clear();
lowerIn.push_back("á");
lowerIn.push_back("é");
lowerIn.push_back("í");
lowerIn.push_back("ó");
lowerIn.push_back("ú");
lowerIn.push_back("à");
lowerIn.push_back("è");
lowerIn.push_back("ì");
lowerIn.push_back("ò");
lowerIn.push_back("ù");
lowerIn.push_back("ä");
lowerIn.push_back("ë");
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
383 upperIn.push_back(
"Í );
upperIn.push_back("Ó");
upperIn.push_back("Ú");
upperIn.push_back("À");
upperIn.push_back("È");
upperIn.push_back("Ì");
upperIn.push_back("Ò");
upperIn.push_back("Ù");
upperIn.push_back("Ä");
upperIn.push_back("Ë");
upperIn.push_back("Ï");
upperIn.push_back("Ö");
upperIn.push_back("Ü");
upperIn.push_back("Â");
upperIn.push_back("Ê");
upperIn.push_back("Î");
upperIn.push_back("Ô");
upperIn.push_back("Û");
upperIn.push_back("Ã");
upperIn.push_back("Õ");
upperIn.push_back("Ç");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("O");
upperOut.push_back("C");
}
vecUpperIn = upperIn;
vecUpperOut = upperOut;
}
/*!
\brief It build two string vectors with special lower case characters and the his respective normal characters
\param vecUpperIn The vector with lower case special characters.
\param vecUpperOut The vector with lower case normal characters.
*/
inline void GetAccentuatedLowerVector(std::vector<std::string> & vecLowerIn, std::vector<std::string> & vecLowerOut)
{
static std::vector<std::string> lowerIn;
static std::vector<std::string> lowerOut;
if(lowerIn.empty() == true || lowerOut.empty() == true)
{
lowerIn.clear();
lowerOut.clear();
lowerIn.push_back("á");
lowerIn.push_back("é");
lowerIn.push_back("í");
lowerIn.push_back("ó");
lowerIn.push_back("ú");
lowerIn.push_back("à");
lowerIn.push_back("è");
lowerIn.push_back("ì");
lowerIn.push_back("ò");
lowerIn.push_back("ù");
lowerIn.push_back("ä");
lowerIn.push_back("ë");
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
384 upperIn.push_back(
"Ó );
upperIn.push_back("Ú");
upperIn.push_back("À");
upperIn.push_back("È");
upperIn.push_back("Ì");
upperIn.push_back("Ò");
upperIn.push_back("Ù");
upperIn.push_back("Ä");
upperIn.push_back("Ë");
upperIn.push_back("Ï");
upperIn.push_back("Ö");
upperIn.push_back("Ü");
upperIn.push_back("Â");
upperIn.push_back("Ê");
upperIn.push_back("Î");
upperIn.push_back("Ô");
upperIn.push_back("Û");
upperIn.push_back("Ã");
upperIn.push_back("Õ");
upperIn.push_back("Ç");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("O");
upperOut.push_back("C");
}
vecUpperIn = upperIn;
vecUpperOut = upperOut;
}
/*!
\brief It build two string vectors with special lower case characters and the his respective normal characters
\param vecUpperIn The vector with lower case special characters.
\param vecUpperOut The vector with lower case normal characters.
*/
inline void GetAccentuatedLowerVector(std::vector<std::string> & vecLowerIn, std::vector<std::string> & vecLowerOut)
{
static std::vector<std::string> lowerIn;
static std::vector<std::string> lowerOut;
if(lowerIn.empty() == true || lowerOut.empty() == true)
{
lowerIn.clear();
lowerOut.clear();
lowerIn.push_back("á");
lowerIn.push_back("é");
lowerIn.push_back("í");
lowerIn.push_back("ó");
lowerIn.push_back("ú");
lowerIn.push_back("à");
lowerIn.push_back("è");
lowerIn.push_back("ì");
lowerIn.push_back("ò");
lowerIn.push_back("ù");
lowerIn.push_back("ä");
lowerIn.push_back("ë");
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
385 upperIn.push_back(
"Ú );
upperIn.push_back("À");
upperIn.push_back("È");
upperIn.push_back("Ì");
upperIn.push_back("Ò");
upperIn.push_back("Ù");
upperIn.push_back("Ä");
upperIn.push_back("Ë");
upperIn.push_back("Ï");
upperIn.push_back("Ö");
upperIn.push_back("Ü");
upperIn.push_back("Â");
upperIn.push_back("Ê");
upperIn.push_back("Î");
upperIn.push_back("Ô");
upperIn.push_back("Û");
upperIn.push_back("Ã");
upperIn.push_back("Õ");
upperIn.push_back("Ç");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("O");
upperOut.push_back("C");
}
vecUpperIn = upperIn;
vecUpperOut = upperOut;
}
/*!
\brief It build two string vectors with special lower case characters and the his respective normal characters
\param vecUpperIn The vector with lower case special characters.
\param vecUpperOut The vector with lower case normal characters.
*/
inline void GetAccentuatedLowerVector(std::vector<std::string> & vecLowerIn, std::vector<std::string> & vecLowerOut)
{
static std::vector<std::string> lowerIn;
static std::vector<std::string> lowerOut;
if(lowerIn.empty() == true || lowerOut.empty() == true)
{
lowerIn.clear();
lowerOut.clear();
lowerIn.push_back("á");
lowerIn.push_back("é");
lowerIn.push_back("í");
lowerIn.push_back("ó");
lowerIn.push_back("ú");
lowerIn.push_back("à");
lowerIn.push_back("è");
lowerIn.push_back("ì");
lowerIn.push_back("ò");
lowerIn.push_back("ù");
lowerIn.push_back("ä");
lowerIn.push_back("ë");
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
386 upperIn.push_back(
"À );
upperIn.push_back("È");
upperIn.push_back("Ì");
upperIn.push_back("Ò");
upperIn.push_back("Ù");
upperIn.push_back("Ä");
upperIn.push_back("Ë");
upperIn.push_back("Ï");
upperIn.push_back("Ö");
upperIn.push_back("Ü");
upperIn.push_back("Â");
upperIn.push_back("Ê");
upperIn.push_back("Î");
upperIn.push_back("Ô");
upperIn.push_back("Û");
upperIn.push_back("Ã");
upperIn.push_back("Õ");
upperIn.push_back("Ç");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("O");
upperOut.push_back("C");
}
vecUpperIn = upperIn;
vecUpperOut = upperOut;
}
/*!
\brief It build two string vectors with special lower case characters and the his respective normal characters
\param vecUpperIn The vector with lower case special characters.
\param vecUpperOut The vector with lower case normal characters.
*/
inline void GetAccentuatedLowerVector(std::vector<std::string> & vecLowerIn, std::vector<std::string> & vecLowerOut)
{
static std::vector<std::string> lowerIn;
static std::vector<std::string> lowerOut;
if(lowerIn.empty() == true || lowerOut.empty() == true)
{
lowerIn.clear();
lowerOut.clear();
lowerIn.push_back("á");
lowerIn.push_back("é");
lowerIn.push_back("í");
lowerIn.push_back("ó");
lowerIn.push_back("ú");
lowerIn.push_back("à");
lowerIn.push_back("è");
lowerIn.push_back("ì");
lowerIn.push_back("ò");
lowerIn.push_back("ù");
lowerIn.push_back("ä");
lowerIn.push_back("ë");
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
387 upperIn.push_back(
"È );
upperIn.push_back("Ì");
upperIn.push_back("Ò");
upperIn.push_back("Ù");
upperIn.push_back("Ä");
upperIn.push_back("Ë");
upperIn.push_back("Ï");
upperIn.push_back("Ö");
upperIn.push_back("Ü");
upperIn.push_back("Â");
upperIn.push_back("Ê");
upperIn.push_back("Î");
upperIn.push_back("Ô");
upperIn.push_back("Û");
upperIn.push_back("Ã");
upperIn.push_back("Õ");
upperIn.push_back("Ç");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("O");
upperOut.push_back("C");
}
vecUpperIn = upperIn;
vecUpperOut = upperOut;
}
/*!
\brief It build two string vectors with special lower case characters and the his respective normal characters
\param vecUpperIn The vector with lower case special characters.
\param vecUpperOut The vector with lower case normal characters.
*/
inline void GetAccentuatedLowerVector(std::vector<std::string> & vecLowerIn, std::vector<std::string> & vecLowerOut)
{
static std::vector<std::string> lowerIn;
static std::vector<std::string> lowerOut;
if(lowerIn.empty() == true || lowerOut.empty() == true)
{
lowerIn.clear();
lowerOut.clear();
lowerIn.push_back("á");
lowerIn.push_back("é");
lowerIn.push_back("í");
lowerIn.push_back("ó");
lowerIn.push_back("ú");
lowerIn.push_back("à");
lowerIn.push_back("è");
lowerIn.push_back("ì");
lowerIn.push_back("ò");
lowerIn.push_back("ù");
lowerIn.push_back("ä");
lowerIn.push_back("ë");
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
388 upperIn.push_back(
"Ì );
upperIn.push_back("Ò");
upperIn.push_back("Ù");
upperIn.push_back("Ä");
upperIn.push_back("Ë");
upperIn.push_back("Ï");
upperIn.push_back("Ö");
upperIn.push_back("Ü");
upperIn.push_back("Â");
upperIn.push_back("Ê");
upperIn.push_back("Î");
upperIn.push_back("Ô");
upperIn.push_back("Û");
upperIn.push_back("Ã");
upperIn.push_back("Õ");
upperIn.push_back("Ç");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("O");
upperOut.push_back("C");
}
vecUpperIn = upperIn;
vecUpperOut = upperOut;
}
/*!
\brief It build two string vectors with special lower case characters and the his respective normal characters
\param vecUpperIn The vector with lower case special characters.
\param vecUpperOut The vector with lower case normal characters.
*/
inline void GetAccentuatedLowerVector(std::vector<std::string> & vecLowerIn, std::vector<std::string> & vecLowerOut)
{
static std::vector<std::string> lowerIn;
static std::vector<std::string> lowerOut;
if(lowerIn.empty() == true || lowerOut.empty() == true)
{
lowerIn.clear();
lowerOut.clear();
lowerIn.push_back("á");
lowerIn.push_back("é");
lowerIn.push_back("í");
lowerIn.push_back("ó");
lowerIn.push_back("ú");
lowerIn.push_back("à");
lowerIn.push_back("è");
lowerIn.push_back("ì");
lowerIn.push_back("ò");
lowerIn.push_back("ù");
lowerIn.push_back("ä");
lowerIn.push_back("ë");
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
389 upperIn.push_back(
"Ò );
upperIn.push_back("Ù");
upperIn.push_back("Ä");
upperIn.push_back("Ë");
upperIn.push_back("Ï");
upperIn.push_back("Ö");
upperIn.push_back("Ü");
upperIn.push_back("Â");
upperIn.push_back("Ê");
upperIn.push_back("Î");
upperIn.push_back("Ô");
upperIn.push_back("Û");
upperIn.push_back("Ã");
upperIn.push_back("Õ");
upperIn.push_back("Ç");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("O");
upperOut.push_back("C");
}
vecUpperIn = upperIn;
vecUpperOut = upperOut;
}
/*!
\brief It build two string vectors with special lower case characters and the his respective normal characters
\param vecUpperIn The vector with lower case special characters.
\param vecUpperOut The vector with lower case normal characters.
*/
inline void GetAccentuatedLowerVector(std::vector<std::string> & vecLowerIn, std::vector<std::string> & vecLowerOut)
{
static std::vector<std::string> lowerIn;
static std::vector<std::string> lowerOut;
if(lowerIn.empty() == true || lowerOut.empty() == true)
{
lowerIn.clear();
lowerOut.clear();
lowerIn.push_back("á");
lowerIn.push_back("é");
lowerIn.push_back("í");
lowerIn.push_back("ó");
lowerIn.push_back("ú");
lowerIn.push_back("à");
lowerIn.push_back("è");
lowerIn.push_back("ì");
lowerIn.push_back("ò");
lowerIn.push_back("ù");
lowerIn.push_back("ä");
lowerIn.push_back("ë");
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
390 upperIn.push_back(
"Ù );
upperIn.push_back("Ä");
upperIn.push_back("Ë");
upperIn.push_back("Ï");
upperIn.push_back("Ö");
upperIn.push_back("Ü");
upperIn.push_back("Â");
upperIn.push_back("Ê");
upperIn.push_back("Î");
upperIn.push_back("Ô");
upperIn.push_back("Û");
upperIn.push_back("Ã");
upperIn.push_back("Õ");
upperIn.push_back("Ç");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("O");
upperOut.push_back("C");
}
vecUpperIn = upperIn;
vecUpperOut = upperOut;
}
/*!
\brief It build two string vectors with special lower case characters and the his respective normal characters
\param vecUpperIn The vector with lower case special characters.
\param vecUpperOut The vector with lower case normal characters.
*/
inline void GetAccentuatedLowerVector(std::vector<std::string> & vecLowerIn, std::vector<std::string> & vecLowerOut)
{
static std::vector<std::string> lowerIn;
static std::vector<std::string> lowerOut;
if(lowerIn.empty() == true || lowerOut.empty() == true)
{
lowerIn.clear();
lowerOut.clear();
lowerIn.push_back("á");
lowerIn.push_back("é");
lowerIn.push_back("í");
lowerIn.push_back("ó");
lowerIn.push_back("ú");
lowerIn.push_back("à");
lowerIn.push_back("è");
lowerIn.push_back("ì");
lowerIn.push_back("ò");
lowerIn.push_back("ù");
lowerIn.push_back("ä");
lowerIn.push_back("ë");
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
391 upperIn.push_back(
"Ä );
upperIn.push_back("Ë");
upperIn.push_back("Ï");
upperIn.push_back("Ö");
upperIn.push_back("Ü");
upperIn.push_back("Â");
upperIn.push_back("Ê");
upperIn.push_back("Î");
upperIn.push_back("Ô");
upperIn.push_back("Û");
upperIn.push_back("Ã");
upperIn.push_back("Õ");
upperIn.push_back("Ç");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("O");
upperOut.push_back("C");
}
vecUpperIn = upperIn;
vecUpperOut = upperOut;
}
/*!
\brief It build two string vectors with special lower case characters and the his respective normal characters
\param vecUpperIn The vector with lower case special characters.
\param vecUpperOut The vector with lower case normal characters.
*/
inline void GetAccentuatedLowerVector(std::vector<std::string> & vecLowerIn, std::vector<std::string> & vecLowerOut)
{
static std::vector<std::string> lowerIn;
static std::vector<std::string> lowerOut;
if(lowerIn.empty() == true || lowerOut.empty() == true)
{
lowerIn.clear();
lowerOut.clear();
lowerIn.push_back("á");
lowerIn.push_back("é");
lowerIn.push_back("í");
lowerIn.push_back("ó");
lowerIn.push_back("ú");
lowerIn.push_back("à");
lowerIn.push_back("è");
lowerIn.push_back("ì");
lowerIn.push_back("ò");
lowerIn.push_back("ù");
lowerIn.push_back("ä");
lowerIn.push_back("ë");
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
392 upperIn.push_back(
"Ë );
upperIn.push_back("Ï");
upperIn.push_back("Ö");
upperIn.push_back("Ü");
upperIn.push_back("Â");
upperIn.push_back("Ê");
upperIn.push_back("Î");
upperIn.push_back("Ô");
upperIn.push_back("Û");
upperIn.push_back("Ã");
upperIn.push_back("Õ");
upperIn.push_back("Ç");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("O");
upperOut.push_back("C");
}
vecUpperIn = upperIn;
vecUpperOut = upperOut;
}
/*!
\brief It build two string vectors with special lower case characters and the his respective normal characters
\param vecUpperIn The vector with lower case special characters.
\param vecUpperOut The vector with lower case normal characters.
*/
inline void GetAccentuatedLowerVector(std::vector<std::string> & vecLowerIn, std::vector<std::string> & vecLowerOut)
{
static std::vector<std::string> lowerIn;
static std::vector<std::string> lowerOut;
if(lowerIn.empty() == true || lowerOut.empty() == true)
{
lowerIn.clear();
lowerOut.clear();
lowerIn.push_back("á");
lowerIn.push_back("é");
lowerIn.push_back("í");
lowerIn.push_back("ó");
lowerIn.push_back("ú");
lowerIn.push_back("à");
lowerIn.push_back("è");
lowerIn.push_back("ì");
lowerIn.push_back("ò");
lowerIn.push_back("ù");
lowerIn.push_back("ä");
lowerIn.push_back("ë");
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
393 upperIn.push_back(
"Ï );
upperIn.push_back("Ö");
upperIn.push_back("Ü");
upperIn.push_back("Â");
upperIn.push_back("Ê");
upperIn.push_back("Î");
upperIn.push_back("Ô");
upperIn.push_back("Û");
upperIn.push_back("Ã");
upperIn.push_back("Õ");
upperIn.push_back("Ç");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("O");
upperOut.push_back("C");
}
vecUpperIn = upperIn;
vecUpperOut = upperOut;
}
/*!
\brief It build two string vectors with special lower case characters and the his respective normal characters
\param vecUpperIn The vector with lower case special characters.
\param vecUpperOut The vector with lower case normal characters.
*/
inline void GetAccentuatedLowerVector(std::vector<std::string> & vecLowerIn, std::vector<std::string> & vecLowerOut)
{
static std::vector<std::string> lowerIn;
static std::vector<std::string> lowerOut;
if(lowerIn.empty() == true || lowerOut.empty() == true)
{
lowerIn.clear();
lowerOut.clear();
lowerIn.push_back("á");
lowerIn.push_back("é");
lowerIn.push_back("í");
lowerIn.push_back("ó");
lowerIn.push_back("ú");
lowerIn.push_back("à");
lowerIn.push_back("è");
lowerIn.push_back("ì");
lowerIn.push_back("ò");
lowerIn.push_back("ù");
lowerIn.push_back("ä");
lowerIn.push_back("ë");
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
394 upperIn.push_back(
"Ö );
upperIn.push_back("Ü");
upperIn.push_back("Â");
upperIn.push_back("Ê");
upperIn.push_back("Î");
upperIn.push_back("Ô");
upperIn.push_back("Û");
upperIn.push_back("Ã");
upperIn.push_back("Õ");
upperIn.push_back("Ç");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("O");
upperOut.push_back("C");
}
vecUpperIn = upperIn;
vecUpperOut = upperOut;
}
/*!
\brief It build two string vectors with special lower case characters and the his respective normal characters
\param vecUpperIn The vector with lower case special characters.
\param vecUpperOut The vector with lower case normal characters.
*/
inline void GetAccentuatedLowerVector(std::vector<std::string> & vecLowerIn, std::vector<std::string> & vecLowerOut)
{
static std::vector<std::string> lowerIn;
static std::vector<std::string> lowerOut;
if(lowerIn.empty() == true || lowerOut.empty() == true)
{
lowerIn.clear();
lowerOut.clear();
lowerIn.push_back("á");
lowerIn.push_back("é");
lowerIn.push_back("í");
lowerIn.push_back("ó");
lowerIn.push_back("ú");
lowerIn.push_back("à");
lowerIn.push_back("è");
lowerIn.push_back("ì");
lowerIn.push_back("ò");
lowerIn.push_back("ù");
lowerIn.push_back("ä");
lowerIn.push_back("ë");
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
395 upperIn.push_back(
"Ü );
upperIn.push_back("Â");
upperIn.push_back("Ê");
upperIn.push_back("Î");
upperIn.push_back("Ô");
upperIn.push_back("Û");
upperIn.push_back("Ã");
upperIn.push_back("Õ");
upperIn.push_back("Ç");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("O");
upperOut.push_back("C");
}
vecUpperIn = upperIn;
vecUpperOut = upperOut;
}
/*!
\brief It build two string vectors with special lower case characters and the his respective normal characters
\param vecUpperIn The vector with lower case special characters.
\param vecUpperOut The vector with lower case normal characters.
*/
inline void GetAccentuatedLowerVector(std::vector<std::string> & vecLowerIn, std::vector<std::string> & vecLowerOut)
{
static std::vector<std::string> lowerIn;
static std::vector<std::string> lowerOut;
if(lowerIn.empty() == true || lowerOut.empty() == true)
{
lowerIn.clear();
lowerOut.clear();
lowerIn.push_back("á");
lowerIn.push_back("é");
lowerIn.push_back("í");
lowerIn.push_back("ó");
lowerIn.push_back("ú");
lowerIn.push_back("à");
lowerIn.push_back("è");
lowerIn.push_back("ì");
lowerIn.push_back("ò");
lowerIn.push_back("ù");
lowerIn.push_back("ä");
lowerIn.push_back("ë");
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
396 upperIn.push_back(
"Â );
upperIn.push_back("Ê");
upperIn.push_back("Î");
upperIn.push_back("Ô");
upperIn.push_back("Û");
upperIn.push_back("Ã");
upperIn.push_back("Õ");
upperIn.push_back("Ç");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("O");
upperOut.push_back("C");
}
vecUpperIn = upperIn;
vecUpperOut = upperOut;
}
/*!
\brief It build two string vectors with special lower case characters and the his respective normal characters
\param vecUpperIn The vector with lower case special characters.
\param vecUpperOut The vector with lower case normal characters.
*/
inline void GetAccentuatedLowerVector(std::vector<std::string> & vecLowerIn, std::vector<std::string> & vecLowerOut)
{
static std::vector<std::string> lowerIn;
static std::vector<std::string> lowerOut;
if(lowerIn.empty() == true || lowerOut.empty() == true)
{
lowerIn.clear();
lowerOut.clear();
lowerIn.push_back("á");
lowerIn.push_back("é");
lowerIn.push_back("í");
lowerIn.push_back("ó");
lowerIn.push_back("ú");
lowerIn.push_back("à");
lowerIn.push_back("è");
lowerIn.push_back("ì");
lowerIn.push_back("ò");
lowerIn.push_back("ù");
lowerIn.push_back("ä");
lowerIn.push_back("ë");
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
397 upperIn.push_back(
"Ê );
upperIn.push_back("Î");
upperIn.push_back("Ô");
upperIn.push_back("Û");
upperIn.push_back("Ã");
upperIn.push_back("Õ");
upperIn.push_back("Ç");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("O");
upperOut.push_back("C");
}
vecUpperIn = upperIn;
vecUpperOut = upperOut;
}
/*!
\brief It build two string vectors with special lower case characters and the his respective normal characters
\param vecUpperIn The vector with lower case special characters.
\param vecUpperOut The vector with lower case normal characters.
*/
inline void GetAccentuatedLowerVector(std::vector<std::string> & vecLowerIn, std::vector<std::string> & vecLowerOut)
{
static std::vector<std::string> lowerIn;
static std::vector<std::string> lowerOut;
if(lowerIn.empty() == true || lowerOut.empty() == true)
{
lowerIn.clear();
lowerOut.clear();
lowerIn.push_back("á");
lowerIn.push_back("é");
lowerIn.push_back("í");
lowerIn.push_back("ó");
lowerIn.push_back("ú");
lowerIn.push_back("à");
lowerIn.push_back("è");
lowerIn.push_back("ì");
lowerIn.push_back("ò");
lowerIn.push_back("ù");
lowerIn.push_back("ä");
lowerIn.push_back("ë");
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
398 upperIn.push_back(
"Î );
upperIn.push_back("Ô");
upperIn.push_back("Û");
upperIn.push_back("Ã");
upperIn.push_back("Õ");
upperIn.push_back("Ç");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("O");
upperOut.push_back("C");
}
vecUpperIn = upperIn;
vecUpperOut = upperOut;
}
/*!
\brief It build two string vectors with special lower case characters and the his respective normal characters
\param vecUpperIn The vector with lower case special characters.
\param vecUpperOut The vector with lower case normal characters.
*/
inline void GetAccentuatedLowerVector(std::vector<std::string> & vecLowerIn, std::vector<std::string> & vecLowerOut)
{
static std::vector<std::string> lowerIn;
static std::vector<std::string> lowerOut;
if(lowerIn.empty() == true || lowerOut.empty() == true)
{
lowerIn.clear();
lowerOut.clear();
lowerIn.push_back("á");
lowerIn.push_back("é");
lowerIn.push_back("í");
lowerIn.push_back("ó");
lowerIn.push_back("ú");
lowerIn.push_back("à");
lowerIn.push_back("è");
lowerIn.push_back("ì");
lowerIn.push_back("ò");
lowerIn.push_back("ù");
lowerIn.push_back("ä");
lowerIn.push_back("ë");
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
399 upperIn.push_back(
"Ô );
upperIn.push_back("Û");
upperIn.push_back("Ã");
upperIn.push_back("Õ");
upperIn.push_back("Ç");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("O");
upperOut.push_back("C");
}
vecUpperIn = upperIn;
vecUpperOut = upperOut;
}
/*!
\brief It build two string vectors with special lower case characters and the his respective normal characters
\param vecUpperIn The vector with lower case special characters.
\param vecUpperOut The vector with lower case normal characters.
*/
inline void GetAccentuatedLowerVector(std::vector<std::string> & vecLowerIn, std::vector<std::string> & vecLowerOut)
{
static std::vector<std::string> lowerIn;
static std::vector<std::string> lowerOut;
if(lowerIn.empty() == true || lowerOut.empty() == true)
{
lowerIn.clear();
lowerOut.clear();
lowerIn.push_back("á");
lowerIn.push_back("é");
lowerIn.push_back("í");
lowerIn.push_back("ó");
lowerIn.push_back("ú");
lowerIn.push_back("à");
lowerIn.push_back("è");
lowerIn.push_back("ì");
lowerIn.push_back("ò");
lowerIn.push_back("ù");
lowerIn.push_back("ä");
lowerIn.push_back("ë");
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
400 upperIn.push_back(
"Û );
upperIn.push_back("Ã");
upperIn.push_back("Õ");
upperIn.push_back("Ç");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("O");
upperOut.push_back("C");
}
vecUpperIn = upperIn;
vecUpperOut = upperOut;
}
/*!
\brief It build two string vectors with special lower case characters and the his respective normal characters
\param vecUpperIn The vector with lower case special characters.
\param vecUpperOut The vector with lower case normal characters.
*/
inline void GetAccentuatedLowerVector(std::vector<std::string> & vecLowerIn, std::vector<std::string> & vecLowerOut)
{
static std::vector<std::string> lowerIn;
static std::vector<std::string> lowerOut;
if(lowerIn.empty() == true || lowerOut.empty() == true)
{
lowerIn.clear();
lowerOut.clear();
lowerIn.push_back("á");
lowerIn.push_back("é");
lowerIn.push_back("í");
lowerIn.push_back("ó");
lowerIn.push_back("ú");
lowerIn.push_back("à");
lowerIn.push_back("è");
lowerIn.push_back("ì");
lowerIn.push_back("ò");
lowerIn.push_back("ù");
lowerIn.push_back("ä");
lowerIn.push_back("ë");
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
401 upperIn.push_back(
"Ã );
upperIn.push_back("Õ");
upperIn.push_back("Ç");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("O");
upperOut.push_back("C");
}
vecUpperIn = upperIn;
vecUpperOut = upperOut;
}
/*!
\brief It build two string vectors with special lower case characters and the his respective normal characters
\param vecUpperIn The vector with lower case special characters.
\param vecUpperOut The vector with lower case normal characters.
*/
inline void GetAccentuatedLowerVector(std::vector<std::string> & vecLowerIn, std::vector<std::string> & vecLowerOut)
{
static std::vector<std::string> lowerIn;
static std::vector<std::string> lowerOut;
if(lowerIn.empty() == true || lowerOut.empty() == true)
{
lowerIn.clear();
lowerOut.clear();
lowerIn.push_back("á");
lowerIn.push_back("é");
lowerIn.push_back("í");
lowerIn.push_back("ó");
lowerIn.push_back("ú");
lowerIn.push_back("à");
lowerIn.push_back("è");
lowerIn.push_back("ì");
lowerIn.push_back("ò");
lowerIn.push_back("ù");
lowerIn.push_back("ä");
lowerIn.push_back("ë");
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
402 upperIn.push_back(
"Õ );
upperIn.push_back("Ç");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("O");
upperOut.push_back("C");
}
vecUpperIn = upperIn;
vecUpperOut = upperOut;
}
/*!
\brief It build two string vectors with special lower case characters and the his respective normal characters
\param vecUpperIn The vector with lower case special characters.
\param vecUpperOut The vector with lower case normal characters.
*/
inline void GetAccentuatedLowerVector(std::vector<std::string> & vecLowerIn, std::vector<std::string> & vecLowerOut)
{
static std::vector<std::string> lowerIn;
static std::vector<std::string> lowerOut;
if(lowerIn.empty() == true || lowerOut.empty() == true)
{
lowerIn.clear();
lowerOut.clear();
lowerIn.push_back("á");
lowerIn.push_back("é");
lowerIn.push_back("í");
lowerIn.push_back("ó");
lowerIn.push_back("ú");
lowerIn.push_back("à");
lowerIn.push_back("è");
lowerIn.push_back("ì");
lowerIn.push_back("ò");
lowerIn.push_back("ù");
lowerIn.push_back("ä");
lowerIn.push_back("ë");
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
403 upperIn.push_back(
"Ç );
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("E");
upperOut.push_back("I");
upperOut.push_back("O");
upperOut.push_back("U");
upperOut.push_back("A");
upperOut.push_back("O");
upperOut.push_back("C");
}
vecUpperIn = upperIn;
vecUpperOut = upperOut;
}
/*!
\brief It build two string vectors with special lower case characters and the his respective normal characters
\param vecUpperIn The vector with lower case special characters.
\param vecUpperOut The vector with lower case normal characters.
*/
inline void GetAccentuatedLowerVector(std::vector<std::string> & vecLowerIn, std::vector<std::string> & vecLowerOut)
{
static std::vector<std::string> lowerIn;
static std::vector<std::string> lowerOut;
if(lowerIn.empty() == true || lowerOut.empty() == true)
{
lowerIn.clear();
lowerOut.clear();
lowerIn.push_back("á");
lowerIn.push_back("é");
lowerIn.push_back("í");
lowerIn.push_back("ó");
lowerIn.push_back("ú");
lowerIn.push_back("à");
lowerIn.push_back("è");
lowerIn.push_back("ì");
lowerIn.push_back("ò");
lowerIn.push_back("ù");
lowerIn.push_back("ä");
lowerIn.push_back("ë");
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
406 upperOut.push_back(
"A");
407 upperOut.push_back(
"E");
408 upperOut.push_back(
"I");
409 upperOut.push_back(
"O");
410 upperOut.push_back(
"U");
411 upperOut.push_back(
"A");
412 upperOut.push_back(
"E");
413 upperOut.push_back(
"I");
414 upperOut.push_back(
"O");
415 upperOut.push_back(
"U");
416 upperOut.push_back(
"A");
417 upperOut.push_back(
"E");
418 upperOut.push_back(
"I");
419 upperOut.push_back(
"O");
420 upperOut.push_back(
"U");
421 upperOut.push_back(
"A");
422 upperOut.push_back(
"E");
423 upperOut.push_back(
"I");
424 upperOut.push_back(
"O");
425 upperOut.push_back(
"U");
426 upperOut.push_back(
"A");
427 upperOut.push_back(
"O");
428 upperOut.push_back(
"C");
431 vecUpperIn = upperIn;
432 vecUpperOut = upperOut;
445 static std::vector<std::string> lowerIn;
446 static std::vector<std::string> lowerOut;
448 if(lowerIn.empty() ==
true || lowerOut.empty() ==
true)
453 lowerIn.push_back(
"á );
lowerIn.push_back("é");
lowerIn.push_back("í");
lowerIn.push_back("ó");
lowerIn.push_back("ú");
lowerIn.push_back("à");
lowerIn.push_back("è");
lowerIn.push_back("ì");
lowerIn.push_back("ò");
lowerIn.push_back("ù");
lowerIn.push_back("ä");
lowerIn.push_back("ë");
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
454 lowerIn.push_back(
"é );
lowerIn.push_back("í");
lowerIn.push_back("ó");
lowerIn.push_back("ú");
lowerIn.push_back("à");
lowerIn.push_back("è");
lowerIn.push_back("ì");
lowerIn.push_back("ò");
lowerIn.push_back("ù");
lowerIn.push_back("ä");
lowerIn.push_back("ë");
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
455 lowerIn.push_back(
"í );
lowerIn.push_back("ó");
lowerIn.push_back("ú");
lowerIn.push_back("à");
lowerIn.push_back("è");
lowerIn.push_back("ì");
lowerIn.push_back("ò");
lowerIn.push_back("ù");
lowerIn.push_back("ä");
lowerIn.push_back("ë");
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
456 lowerIn.push_back(
"ó );
lowerIn.push_back("ú");
lowerIn.push_back("à");
lowerIn.push_back("è");
lowerIn.push_back("ì");
lowerIn.push_back("ò");
lowerIn.push_back("ù");
lowerIn.push_back("ä");
lowerIn.push_back("ë");
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
457 lowerIn.push_back(
"ú );
lowerIn.push_back("à");
lowerIn.push_back("è");
lowerIn.push_back("ì");
lowerIn.push_back("ò");
lowerIn.push_back("ù");
lowerIn.push_back("ä");
lowerIn.push_back("ë");
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
458 lowerIn.push_back(
"à );
lowerIn.push_back("è");
lowerIn.push_back("ì");
lowerIn.push_back("ò");
lowerIn.push_back("ù");
lowerIn.push_back("ä");
lowerIn.push_back("ë");
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
459 lowerIn.push_back(
"è );
lowerIn.push_back("ì");
lowerIn.push_back("ò");
lowerIn.push_back("ù");
lowerIn.push_back("ä");
lowerIn.push_back("ë");
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
460 lowerIn.push_back(
"ì );
lowerIn.push_back("ò");
lowerIn.push_back("ù");
lowerIn.push_back("ä");
lowerIn.push_back("ë");
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
461 lowerIn.push_back(
"ò );
lowerIn.push_back("ù");
lowerIn.push_back("ä");
lowerIn.push_back("ë");
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
462 lowerIn.push_back(
"ù );
lowerIn.push_back("ä");
lowerIn.push_back("ë");
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
463 lowerIn.push_back(
"ä );
lowerIn.push_back("ë");
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
464 lowerIn.push_back(
"ë );
lowerIn.push_back("ï");
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
465 lowerIn.push_back(
"ï );
lowerIn.push_back("ö");
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
466 lowerIn.push_back(
"ö );
lowerIn.push_back("ü");
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
467 lowerIn.push_back(
"ü );
lowerIn.push_back("â");
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
468 lowerIn.push_back(
"â );
lowerIn.push_back("ê");
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
469 lowerIn.push_back(
"ê );
lowerIn.push_back("î");
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
470 lowerIn.push_back(
"î );
lowerIn.push_back("ô");
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
471 lowerIn.push_back(
"ô );
lowerIn.push_back("û");
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
472 lowerIn.push_back(
"û );
lowerIn.push_back("ã");
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
473 lowerIn.push_back(
"ã );
lowerIn.push_back("õ");
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
474 lowerIn.push_back(
"õ );
std::string str = "ç";
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
");
476 std::string str =
"ç ;
lowerIn.push_back(str);
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("e");
lowerOut.push_back("i");
lowerOut.push_back("o");
lowerOut.push_back("u");
lowerOut.push_back("a");
lowerOut.push_back("o");
lowerOut.push_back("c");
}
vecLowerIn = lowerIn;
vecLowerOut = lowerOut;
}
/*!
\brief It build two string vectors with special characters and the his respective normal characters
\param especialIn The vector with special characters.
\param especialOut The vector with normal characters.
*/
inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
{
especialIn.push_back("ª");
especialIn.push_back("º");
especialIn.push_back("¹");
especialIn.push_back("²");
especialIn.push_back("³");
especialOut.push_back("a");
especialOut.push_back("o");
especialOut.push_back("1");
especialOut.push_back("2");
especialOut.push_back("3");
}
/*!
\brief It replace special characters of a string.
\param str The string that will be verify.
\param changed Boolean that records whether there was a change.
*/
inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
{
changed = false;
std::vector<std::string> upperIn;
std::vector<std::string> upperOut;
std::vector<std::string> lowerIn;
std::vector<std::string> lowerOut;
std::vector<std::string> especialIn;
std::vector<std::string> especialOut;
GetAccentuatedUpperVector(upperIn, upperOut);
GetAccentuatedLowerVector(lowerIn, lowerOut);
GetEspecialCharsFixVector(especialIn, especialOut);
std::string outputStr = str;
for(unsigned int i = 0; i < outputStr.size(); ++i)
{
std::string value = "";
value += outputStr[i];
for(unsigned int j = 0; j < upperIn.size(); ++j)
{
if(outputStr[i] == upperIn[j][0])
{
outputStr[i] = upperOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < lowerIn.size(); ++j)
{
if(value == lowerIn[j])
{
outputStr[i] = lowerOut[j][0];
changed = true;
break;
}
}
for(unsigned int j = 0; j < especialIn.size(); ++j)
{
if(outputStr[i] == especialIn[j][0])
{
outputStr[i] = especialOut[j][0];
changed = true;
break;
}
}
}
return outputStr;
}
} // end namespace common
} // end namespace te
#endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
";
477 lowerIn.push_back(str);
479 lowerOut.push_back(
"a");
480 lowerOut.push_back(
"e");
481 lowerOut.push_back(
"i");
482 lowerOut.push_back(
"o");
483 lowerOut.push_back(
"u");
484 lowerOut.push_back(
"a");
485 lowerOut.push_back(
"e");
486 lowerOut.push_back(
"i");
487 lowerOut.push_back(
"o");
488 lowerOut.push_back(
"u");
489 lowerOut.push_back(
"a");
490 lowerOut.push_back(
"e");
491 lowerOut.push_back(
"i");
492 lowerOut.push_back(
"o");
493 lowerOut.push_back(
"u");
494 lowerOut.push_back(
"a");
495 lowerOut.push_back(
"e");
496 lowerOut.push_back(
"i");
497 lowerOut.push_back(
"o");
498 lowerOut.push_back(
"u");
499 lowerOut.push_back(
"a");
500 lowerOut.push_back(
"o");
501 lowerOut.push_back(
"c");
504 vecLowerIn = lowerIn;
505 vecLowerOut = lowerOut;
517 especialIn.push_back(
"ª");
518 especialIn.push_back(
"º");
519 especialIn.push_back(
"¹");
520 especialIn.push_back(
"²");
521 especialIn.push_back(
"³");
523 especialOut.push_back(
"a");
524 especialOut.push_back(
"o");
525 especialOut.push_back(
"1");
526 especialOut.push_back(
"2");
527 especialOut.push_back(
"3");
542 std::vector<std::string> upperIn;
543 std::vector<std::string> upperOut;
544 std::vector<std::string> lowerIn;
545 std::vector<std::string> lowerOut;
546 std::vector<std::string> especialIn;
547 std::vector<std::string> especialOut;
554 std::string outputStr = str;
555 for(
unsigned int i = 0; i < outputStr.size(); ++i)
557 std::string value =
"";
558 value += outputStr[i];
559 for(
unsigned int j = 0; j < upperIn.size(); ++j)
561 if(outputStr[i] == upperIn[j][0])
563 outputStr[i] = upperOut[j][0];
569 for(
unsigned int j = 0; j < lowerIn.size(); ++j)
571 if(value == lowerIn[j])
573 outputStr[i] = lowerOut[j][0];
579 for(
unsigned int j = 0; j < especialIn.size(); ++j)
581 if(outputStr[i] == especialIn[j][0])
583 outputStr[i] = especialOut[j][0];
598 #endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
void GetAccentuatedLowerVector(std::vector< std::string > &vecLowerIn, std::vector< std::string > &vecLowerOut)
It build two string vectors with special lower case characters and the his respective normal characte...
std::string Convert2LCase(const std::string &value)
It converts a string to lower case.
void ExtractKVP(const std::string &kvpStr, std::map< std::string, std::string > &kvp, const std::string &kvpDelimiter="&", const std::string &kvDelimiter="=", bool toUpper=false)
It extracts a key-value map from a string.
std::string Convert2UCase(const std::string &value)
It converts a string to upper case.
std::string ReplaceSpecialChars(const std::string &str, bool &changed)
It replace special characters of a string.
void Tokenize(const std::string &str, std::vector< std::string > &tokens, const std::string &delimiters=" ")
It tokenizes a given string with a delimiter of your own choice.
void Convert2UCaseInPlace(std::string &value)
It converts a string to upper case in place (it doesn't allocate an auxiliar buffer).
void GetEspecialCharsFixVector(std::vector< std::string > &especialIn, std::vector< std::string > &especialOut)
It build two string vectors with special characters and the his respective normal characters...
void GetAccentuatedUpperVector(std::vector< std::string > &vecUpperIn, std::vector< std::string > &vecUpperOut)
It build two string vectors with special upper case characters and the his respective normal characte...
char * CreateCString(const std::string &s)
It converts the C++ string to a C-string.
std::string Convert2String(boost::int16_t value)
It converts a short integer value to a string.
char ** CreateCStringArray(const std::vector< std::string * > &vs)
It converts the C++ vector of string pointers to a C array os strings.