#include "../include/base.h"
#include <string>
Include dependency graph for string_tools.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Defines | |
#define | STRING_TOOLS__H |
Functions | |
bool | str2long (const std::string &txt, long &valeur) |
bool | str2int (const std::string &txt, int &valeur) |
bool | str2double (const std::string &txt, double &valeur) |
bool | str2bool (const std::string &str, bool &value) |
std::string | long2str (long x) |
std::string | ulong2str (ulong x) |
std::string | double2str (ulong x) |
std::string | bool2str (bool x) |
#define STRING_TOOLS__H |
Definition at line 23 of file string_tools.h.
std::string bool2str | ( | bool | x | ) |
std::string double2str | ( | ulong | x | ) |
std::string long2str | ( | long | x | ) |
bool str2bool | ( | const std::string & | str, | |
bool & | value | |||
) |
Definition at line 49 of file string_tools.cpp.
00050 { 00051 // Try to convert str to a boolean value 00052 // return true and set the value on succeed 00053 // return if false its not a boolean 00054 if(str=="1" || str=="true" || str=="on") 00055 { 00056 value = true; 00057 return true; 00058 } 00059 if(str=="0" || str=="false" || str=="off") 00060 { 00061 value = false; 00062 return true; 00063 } 00064 return false; 00065 }
Here is the caller graph for this function:
bool str2double | ( | const std::string & | txt, | |
double & | valeur | |||
) |
bool str2int | ( | const std::string & | txt, | |
int & | valeur | |||
) |
bool str2long | ( | const std::string & | txt, | |
long & | valeur | |||
) |
std::string ulong2str | ( | ulong | x | ) |