All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
StringUtils.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/common/StringUtils.h
22 
23  \brief Utility functions for dealing with strings.
24 
25  \ingroup common
26 */
27 
28 #ifndef __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
29 #define __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
30 
31 // STL
32 #include <cstdio>
33 #include <cstring>
34 #include <limits>
35 #include <map>
36 #include <string>
37 #include <vector>
38 
39 // Boost
40 #include <boost/cstdint.hpp>
41 
42 namespace te
43 {
44  namespace common
45  {
46  /*!
47  \brief It converts a short integer value to a string.
48 
49  \return The integer value converted to a string.
50  */
51  inline std::string Convert2String(boost::int16_t value)
52  {
53  char name[std::numeric_limits<boost::int16_t>::digits10 + 2];
54  sprintf(name, "%hd", value);
55  return name;
56  }
57 
58  /*!
59  \brief It converts a unsigned short integer value to a string.
60 
61  \return The integer value converted to a string.
62  */
63  inline std::string Convert2String(boost::uint16_t value)
64  {
65  char name[std::numeric_limits<boost::uint16_t>::digits10 + 2];
66  sprintf(name, "%hu", value);
67  return name;
68  }
69 
70  /*!
71  \brief It converts an integer value to a string.
72 
73  \return The integer value converted to a string.
74  */
75  inline std::string Convert2String(boost::int32_t value)
76  {
77  char name[std::numeric_limits<boost::int32_t>::digits10 + 2];
78  sprintf(name, "%d", value);
79  return name;
80  }
81 
82  /*!
83  \brief It converts an unsigned integer value to a string.
84 
85  \return The unsigned integer value converted to a string.
86  */
87  inline std::string Convert2String(boost::uint32_t value)
88  {
89  char name[std::numeric_limits<boost::uint32_t>::digits10 + 2];
90  sprintf(name, "%u", value);
91  return name;
92  }
93 
94  /*!
95  \brief It converts a long value to a string.
96 
97  \return The long value converted to a string.
98  */
99  inline std::string Convert2String(boost::int64_t value)
100  {
101  char name[std::numeric_limits<boost::int64_t>::digits10 + 2];
102  sprintf(name, "%lli", value);
103  return name;
104  }
105 
106  /*!
107  \brief It converts a unsigned long value to a string.
108 
109  \return The unsigned long value converted to a string.
110  */
111  inline std::string Convert2String(boost::uint64_t value)
112  {
113  char name[std::numeric_limits<boost::uint64_t>::digits10 + 2];
114  sprintf(name, "%llu", value);
115  return name;
116  }
117 
118  /*!
119  \brief It converts a double value to a string.
120 
121  \return The double value converted to a string.
122  */
123  inline std::string Convert2String(float value)
124  {
125  char name[std::numeric_limits<float>::digits10 + std::numeric_limits<float>::digits + 4];
126  sprintf(name, "%f", value);
127  return name;
128  }
129 
130  /*!
131  \brief It converts a double value to a string.
132 
133  \return The double value converted to a string.
134  */
135  inline std::string Convert2String(double value)
136  {
137  char name[std::numeric_limits<double>::digits10 + std::numeric_limits<double>::digits + 4];
138  sprintf(name, "%e", value);
139  return name;
140  }
141 
142  /*!
143  \brief It converts a double value to a string with a precision.
144 
145  \return The double value converted with the given precision to a string.
146 
147  \warning Max allowed precision is 20.
148  */
149  inline std::string Convert2String(double value, int precision)
150  {
151  char name[256];
152  sprintf(name, "%.*f", precision, value );
153  return name;
154  }
155 
156  /*!
157  \brief It converts a string to upper case.
158 
159  \param value The string value to be converted.
160 
161  \return The converted string.
162  */
163  inline std::string Convert2UCase(const std::string& value)
164  {
165  size_t size = value.size();
166 
167  std::string aux(size, ' ');
168 
169  for(size_t i = 0; i < size; ++i)
170  aux[i] = ((value[i] >= 97) && (value[i] <= 122)) ? (value[i] - 32) : value[i];
171 
172  return aux;
173  }
174 
175  /*!
176  \brief It converts a string to upper case in place (it doesn't allocate an auxiliar buffer).
177 
178  \param value The string value to be converted.
179 
180  \return The converted string.
181  */
182  inline void Convert2UCaseInPlace(std::string& value)
183  {
184  size_t size = value.size();
185 
186  for(size_t i = 0; i < size; ++i)
187  value[i] = ((value[i] >= 97) && (value[i] <= 122)) ? (value[i] - 32) : value[i];
188  }
189 
190  /*!
191  \brief It converts a string to lower case.
192 
193  \param value The string value to be converted.
194 
195  \return The converted string.
196  */
197  inline std::string Convert2LCase(const std::string& value)
198  {
199  size_t size = value.size();
200 
201  std::string aux(size, ' ');
202 
203  for(size_t i = 0; i < size; ++i)
204  aux[i] = ((value[i] >= 65) && (value[i] <= 90)) ? (value[i] + 32) : value[i];
205 
206  return aux;
207  }
208 
209  /*!
210  \brief It tokenizes a given string with a delimiter of your own choice.
211 
212  \param str The string to be tokenize.
213  \param tokens The output vector with the tokens.
214  \param delimiters The character delimiters.
215  */
216  inline void Tokenize(const std::string& str,
217  std::vector<std::string>& tokens,
218  const std::string& delimiters = " ")
219  {
220 // skip delimiters at beginning
221  size_t lastPos = str.find_first_not_of(delimiters, 0);
222 
223 // find first "non-delimiter"
224  size_t pos = str.find_first_of(delimiters, lastPos);
225 
226  while((std::string::npos != pos) ||
227  (std::string::npos != lastPos))
228  {
229 // found a token, add it to the vector
230  tokens.push_back(str.substr(lastPos, pos - lastPos));
231 
232 // skip delimiters. Note the "not_of"
233  lastPos = str.find_first_not_of(delimiters, pos);
234 
235 // find next "non-delimiter"
236  pos = str.find_first_of(delimiters, lastPos);
237  }
238  }
239 
240  /*!
241  \brief It extracts a key-value map from a string.
242 
243  \param kvpStr A string with key-value-pairs to be splitted.
244  \param kvp A map to output the pairs: (parameter-name, parameter-value).
245  \param kvpDelimiter The character used to delimit the key-value-pairs.
246  \param kvDelimiter The character used to delimit a key from its value.
247  \param toUpper If true the key will be converted to upper-case. The value case will not be touched.
248 
249  \pre The kvpStr must already be cleaned if necessary (see CleanQueryString function if needed).
250  */
251  inline void ExtractKVP(const std::string& kvpStr,
252  std::map<std::string, std::string>& kvp,
253  const std::string& kvpDelimiter = "&",
254  const std::string& kvDelimiter = "=",
255  bool toUpper = false)
256  {
257  if(kvpStr.empty())
258  return;
259 
260 // split query string
261  std::vector<std::string> tokens;
262 
263  Tokenize(kvpStr, tokens, kvpDelimiter);
264 
265 // for each token let's find a kvp
266  size_t size = tokens.size();
267 
268  for(size_t i = 0; i < size; ++i)
269  {
270  std::vector<std::string> kv;
271 
272  Tokenize(tokens[i], kv, kvDelimiter);
273 
274  //if(kvp.empty())
275  // continue;
276 
277  if(toUpper)
278  Convert2UCaseInPlace(kv[0]);
279 
280  if(!kv[0].empty())
281  kvp[kv[0]] = "";
282 
283  if(kv.size() > 1)
284  kvp[kv[0]] = kv[1];
285 
286  if(kv.size() > 2) // if we have >2 '=' ? concat
287  {
288  std::string aux("");
289 
290  for(size_t k = 1; k < kv.size(); ++k)
291  aux += kv[k] + "=";
292 
293  size_t pos = aux.size() - 1;
294 
295  kvp[kv[0]] = aux.erase(pos, 1);
296  }
297  }
298  }
299 
300  /*!
301  \brief It converts the C++ string to a C-string.
302 
303  \param s The C++ string to be converted to a char*.
304 
305  \return A C-string. The caller will take the ownership of the returned string and must use 'delete [] pointer' to release it when necessary.
306  */
307  inline char* CreateCString(const std::string& s)
308  {
309  char* cs = new char[s.length() + 1];
310  strncpy(cs, s.c_str(), s.length() + 1);
311  return cs;
312  }
313 
314  /*!
315  \brief It converts the C++ vector of string pointers to a C array os strings.
316 
317  \param vs The C++ vector of string pointers to be converted to a char**.
318 
319  \return A C array os strings NULL terminated. The caller will take the ownership of the returned array.
320  */
321  inline char** CreateCStringArray(const std::vector<std::string*>& vs)
322  {
323  std::size_t ns = vs.size() ;
324 
325  char** as = new char*[ns + 1];
326 
327  as[ns] = 0;
328 
329  for(std::size_t i = 0; i< ns; ++i)
330  {
331  as[i] = new char[vs[i]->length() + 1];
332 
333  strncpy(as[i], vs[i]->c_str(), vs[i]->length() + 1);
334  }
335 
336  return as;
337  }
338 
339  /*!
340  \brief It converts the C++ vector of string pointers to a C array os strings.
341 
342  \param vs The C++ vector of string pointers to be converted to a char**.
343 
344  \return A C array os strings NULL terminated. The caller will take the ownership of the returned array.
345  */
346  inline char** CreateCStringArray(const std::vector<std::string>& vs)
347  {
348  std::size_t ns = vs.size() ;
349 
350  char** as = new char*[ns + 1];
351 
352  as[ns] = 0;
353 
354  for(std::size_t i = 0; i< ns; ++i)
355  {
356  as[i] = new char[vs[i].length() + 1];
357 
358  strncpy(as[i], vs[i].c_str(), vs[i].length() + 1);
359  }
360 
361  return as;
362  }
363 
364  /*!
365  \brief It build two string vectors with special upper case characters and the his respective normal characters
366 
367  \param vecUpperIn The vector with upper case special characters.
368  \param vecUpperOut The vector with upper case normal characters.
369 
370  */
371  inline void GetAccentuatedUpperVector(std::vector<std::string> & vecUpperIn, std::vector<std::string> & vecUpperOut)
372  {
373  static std::vector<std::string> upperIn;
374  static std::vector<std::string> upperOut;
375 
376  if(upperIn.empty() == true || upperOut.empty() == true)
377  {
378  upperIn.clear();
379  upperOut.clear();
380 
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 ");
404 
405 
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");
429  }
430 
431  vecUpperIn = upperIn;
432  vecUpperOut = upperOut;
433 
434  }
435 
436  /*!
437  \brief It build two string vectors with special lower case characters and the his respective normal characters
438 
439  \param vecUpperIn The vector with lower case special characters.
440  \param vecUpperOut The vector with lower case normal characters.
441 
442  */
443  inline void GetAccentuatedLowerVector(std::vector<std::string> & vecLowerIn, std::vector<std::string> & vecLowerOut)
444  {
445  static std::vector<std::string> lowerIn;
446  static std::vector<std::string> lowerOut;
447 
448  if(lowerIn.empty() == true || lowerOut.empty() == true)
449  {
450  lowerIn.clear();
451  lowerOut.clear();
452 
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 ");
475 
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);
478 
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");
502  }
503 
504  vecLowerIn = lowerIn;
505  vecLowerOut = lowerOut;
506  }
507 
508  /*!
509  \brief It build two string vectors with special characters and the his respective normal characters
510 
511  \param especialIn The vector with special characters.
512  \param especialOut The vector with normal characters.
513 
514  */
515  inline void GetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
516  {
517  especialIn.push_back("ª");
518  especialIn.push_back("º");
519  especialIn.push_back("¹");
520  especialIn.push_back("²");
521  especialIn.push_back("³");
522 
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");
528  }
529 
530  /*!
531  \brief It replace special characters of a string.
532 
533  \param str The string that will be verify.
534  \param changed Boolean that records whether there was a change.
535 
536  */
537  inline std::string ReplaceSpecialChars ( const std::string& str, bool& changed)
538  {
539 
540  changed = false;
541 
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;
548 
549  GetAccentuatedUpperVector(upperIn, upperOut);
550  GetAccentuatedLowerVector(lowerIn, lowerOut);
551  GetEspecialCharsFixVector(especialIn, especialOut);
552 
553 
554  std::string outputStr = str;
555  for(unsigned int i = 0; i < outputStr.size(); ++i)
556  {
557  std::string value = "";
558  value += outputStr[i];
559  for(unsigned int j = 0; j < upperIn.size(); ++j)
560  {
561  if(outputStr[i] == upperIn[j][0])
562  {
563  outputStr[i] = upperOut[j][0];
564  changed = true;
565  break;
566  }
567  }
568 
569  for(unsigned int j = 0; j < lowerIn.size(); ++j)
570  {
571  if(value == lowerIn[j])
572  {
573  outputStr[i] = lowerOut[j][0];
574  changed = true;
575  break;
576  }
577  }
578 
579  for(unsigned int j = 0; j < especialIn.size(); ++j)
580  {
581  if(outputStr[i] == especialIn[j][0])
582  {
583  outputStr[i] = especialOut[j][0];
584  changed = true;
585  break;
586  }
587  }
588 
589  }
590 
591  return outputStr;
592 
593  }
594 
595  } // end namespace common
596 } // end namespace te
597 
598 #endif // __TERRALIB_COMMON_INTERNAL_STRINGUTILS_H
599 
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...
Definition: StringUtils.h:443
std::string Convert2LCase(const std::string &value)
It converts a string to lower case.
Definition: StringUtils.h:197
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.
Definition: StringUtils.h:251
std::string Convert2UCase(const std::string &value)
It converts a string to upper case.
Definition: StringUtils.h:163
std::string ReplaceSpecialChars(const std::string &str, bool &changed)
It replace special characters of a string.
Definition: StringUtils.h:537
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.
Definition: StringUtils.h:216
void Convert2UCaseInPlace(std::string &value)
It converts a string to upper case in place (it doesn't allocate an auxiliar buffer).
Definition: StringUtils.h:182
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...
Definition: StringUtils.h:515
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...
Definition: StringUtils.h:371
char * CreateCString(const std::string &s)
It converts the C++ string to a C-string.
Definition: StringUtils.h:307
std::string Convert2String(boost::int16_t value)
It converts a short integer value to a string.
Definition: StringUtils.h:51
char ** CreateCStringArray(const std::vector< std::string * > &vs)
It converts the C++ vector of string pointers to a C array os strings.
Definition: StringUtils.h:321