| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

Functions
E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/kernel/TeUtils.cpp File Reference
`#include "TeUtils.h"`
`#include "TeDefines.h"`
`#include "TeException.h"`
`#include "TeAgnostic.h"`
`#include "TeProjection.h"`
`#include "TeVectorRemap.h"`
`#include <stdio.h>`
`#include <ctype.h>`
`#include <string>`
`#include <cstring>`
`#include <cstdlib>`
`#include <fstream>`

## Functions

string | Te2String (const int value)
| Transforms an integer to string.
string | Te2String (const unsigned int value)
| Transforms an unsigned integer to string.
string | Te2String (const long value)
| Transforms a long to string.
string | Te2String (const long long int value)
| Transforms a long long int to string.
string | Te2String (const unsigned long value)
| Transforms an unsigned long to string.
void | TeTrim (string &str)
| Removes left and right blank, tab and carriage return characters of a string.
std::string | TeRemoveSpecialChars (const std::string &str)
| Removes special characteres from a string.
std::string | TeReplaceSpecialChars (const std::string &str)
| Replace special characteres from a string.
std::string | TeReplaceSpecialChars (const std::string &str, bool &changed)
| Replace special characteres from a string.
void | TeRemoveRightDecimalZeroes (const std::string &strIn, char separatorSymbol, std::string &strOut)
| Remove all occurrences right decimal zeros from the real number represented by strIn.
string | Te2String (const double value, int precision)
| Transforms a double to string floating point notation with precision decimal places.
string | Te2String (const double value)
| Transforms a double to string in exponential notation.
string | TeGetExtension (const char *value)
| Get the extension part (right to the dot) of a string.
string | TeGetName (const char *value)
| Get the name part (left to the dot) of a string, path included.
string | TeGetBaseName (const char *value)
| Get the base name part of a string, strip path information.
string | TeGetPath (const char *value)
| Get the path part of a file name.
void | TeConvertToUpperCase (const string &name, char upName[])
string | TeConvertToUpperCase (const string &name)
| Converts a string to upper case.
string | TeConvertToLowerCase (const string &name)
| Converts a string to lower case.
int | TeSplitString (const string &input, const string &delimiter, vector< string > &results)
| Splits a string, given a separator, in a vector of parts.
bool | TeNoCaseCmp (const char &c1, const char &c2)
bool | TeStringCompare (const string &str1, const string &str2, bool caseS)
| Compares two strings.
double | TeRoundD (double val, int precision)
| Rounds a double value to a given number of decimal digits.
bool | TeCompareDouble (double a, double b, int precision)
| Compares two doubles.
void | TeWriteToFile (const string &fileName, const string &text, const string &mode)
| Writes a string to a file.
double | TeAdjustToPrecision (double val, int precision, bool reduce)
| Adjust a number to a given precision.
string | TeCheckName (const string &name, bool &changed, string &invalidChar)
| Validate a string to check if it can be used as a column name.
unsigned long int | TeGetFreePhysicalMemory ()
unsigned long int | TeGetTotalPhysicalMemory ()
unsigned long int | TeGetUsedVirtualMemory ()
unsigned long int | TeGetTotalVirtualMemory ()
unsigned int | TeGetPhysProcNumber ()
bool | TeGetTempFileName (std::string &filename)
unsigned long int | TeGetFileSize (const std::string &filename)
| The file size (bytes).
bool | TeCheckFileExistence (const std::string &filename)
| Check the file existence.
bool | TeGetDirFullFilesNames (const std::string &path, const bool &recursive, std::vector< std::string > &filesnames)
| Get the full names of all files inside the given directory.
bool | TeCopyFile (const std::string &inputFileName, const std::string &outputFileName)
| Creates a copy from the given input file name.
bool | TeCompareFiles (const std::string &inputFileName1, const std::string &inputFileName2)
| Compare two files.
bool | TeReplaceTextFileSubString (const std::string &inputFileName, const std::string &outputFileName, const std::string &oldSubString, const std::string &newSubString)
| Creates a copy from the given input text file name replacing all ocurrences of.
unsigned long int | TeCreateHashFromString (unsigned char const *inputString, const unsigned int &inputStringSize)
| Creates a hash number from an input string.
bool | TeRenameInvalidFieldName (TeAttributeList &attr)
| Rename special field names.
void | TeGetEspecialCharsFixVector (std::vector< std::string > &especialIn, std::vector< std::string > &especialOut)
| Popule vectors with especial chars with accentuation and without.
void | TeGetAccentuatedUpperVector (std::vector< std::string > &upperIn, std::vector< std::string > &upperOut)
| Popule vectors with upper chars with accentuation and without.
void | TeGetAccentuatedLowerVector (std::vector< std::string > &lowerIn, std::vector< std::string > &lowerOut)
| Popule vectors with lower chars with accentuation and without.
bool | TeCheckBoxConsistency (const TeBox &box, TeProjection *boxProjection)
| Checks if the given box at the given projection is inside the LatLong's representation limits.
std::string | TeGetUnitName (const TeUnits &units)
| From a given unit enum value, returns the std::string associated to it.
TeUnits | TeGetUnit (const std::string &unitName)
| From a given std::string, returns the unit enum value associated to it.
double | TeConvertUnits (const double &value, const TeUnits &unitFrom, const TeUnits &unitTo)
| Converts the units of the given 'value' from the 'unitFrom' to the 'unitTo'.
bool | TeFileExists (const std::string &fileName)
| Checks if the given file name exists of the disk.
bool | TeFileCopy (const std::string &fileNameIn, const std::string &fileNameOut)
| Copies the given fileNameIn to the given fileNameOut. If fileNameOut already exists, it will be overwritten.
bool | TeFileDelete (const std::string &fileName)
| Deletes a file from the the disk.
bool | TeFileRename (const std::string &oldFileName, const std::string &newFileName)
| Renames a file.

## Function Documentation

bool TeCheckBoxConsistency | ( | const TeBox & | box,
|  | TeProjection * | boxProjection
| ) |  |

Checks if the given box at the given projection is inside the LatLong's representation limits.

Parameters:

  box | The box to be verified
  boxProjection | The projection of the box.

Returns:
  TRUE if the box is consisnt, FALSE otherwise.

void TeConvertToUpperCase | ( | const string & | name,
|  | char | upName[]
| ) |  |

double TeConvertUnits | ( | const double & | value,
|  | const TeUnits & | unitFrom,
|  | const TeUnits & | unitTo
| ) |  |

Converts the units of the given 'value' from the 'unitFrom' to the 'unitTo'.

Parameters:

  value | The value to be converted
  unitFrom | The current unit of 'value'
  unitTo | The output converted unit

Returns:
  The converted value.

bool TeFileCopy | ( | const std::string & | fileNameIn,
|  | const std::string & | fileNameOut
| ) |  |

Copies the given fileNameIn to the given fileNameOut. If fileNameOut already exists, it will be overwritten.

Parameters:

  fileNameIn | The name of the input file
  fileNameIn | The name of the output file

Returns:
  TRUE if the file was successfully copied. FALSE otherwise

bool TeFileDelete | ( | const std::string & | fileName | ) |

Deletes a file from the the disk.

Parameters:

  fileName | The name of the file to be deleted

Returns:
  TRUE if the file was deleted. FALSE otherwise

bool TeFileExists | ( | const std::string & | fileName | ) |

Checks if the given file name exists of the disk.

Parameters:

  fileName | The name of the file

Returns:
  TRUE if the file exists. FALSE otherwise

bool TeFileRename | ( | const std::string & | oldFileName,
|  | const std::string & | newFileName
| ) |  |

Renames a file.

Parameters:

  oldFileName | The actual name of the file
  newFileName | The new name of the file

Returns:
  TRUE if the file was successfully renamed. FALSE otherwise

void TeGetAccentuatedLowerVector | ( | std::vector< std::string > & | lowerIn,
|  | std::vector< std::string > & | lowerOut
| ) |  |

Popule vectors with lower chars with accentuation and without.

Parameters:

  vectorIn | Vector with accentuation.
  vectorOut | Vector without accentuation.

Returns:
  void

void TeGetAccentuatedUpperVector | ( | std::vector< std::string > & | upperIn,
|  | std::vector< std::string > & | upperOut
| ) |  |

Popule vectors with upper chars with accentuation and without.

Parameters:

  vectorIn | Vector with accentuation.
  vectorOut | Vector without accentuation.

Returns:
  void

void TeGetEspecialCharsFixVector | ( | std::vector< std::string > & | especialIn,
|  | std::vector< std::string > & | especialOut
| ) |  |

Popule vectors with especial chars with accentuation and without.

Parameters:

  vectorIn | Vector with accentuation.
  vectorOut | Vector without accentuation.

Returns:
  void

TeUnits TeGetUnit | ( | const std::string & | unitName | ) |

From a given std::string, returns the unit enum value associated to it.

Parameters:

  units | The std::string associated to it

Returns:
  The enum value

std::string TeGetUnitName | ( | const TeUnits & | units | ) |

From a given unit enum value, returns the std::string associated to it.

Parameters:

  units | The enum value

Returns:
  The std::string associated to it

bool TeNoCaseCmp | ( | const char & | c1,
|  | const char & | c2
| ) |  |

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines