27 #ifndef G2O_STRING_TOOLS_H 28 #define G2O_STRING_TOOLS_H 76 template <
typename OutputIterator>
77 OutputIterator
readInts(
const char* str, OutputIterator out)
79 char* cl = (
char*)str;
82 long int id = strtol(cl, &cle, 10);
95 template <
typename OutputIterator>
96 OutputIterator
readFloats(
const char* str, OutputIterator out)
98 char* cl = (
char*)str;
101 double val = strtod(cl, &cle);
125 bool convertString(
const std::string& s, T& x,
bool failIfLeftoverChars =
true)
127 std::istringstream i(s);
129 if (!(i >> x) || (failIfLeftoverChars && i.get(c)))
OutputIterator readFloats(const char *str, OutputIterator out)
std::string strExpandFilename(const std::string &filename)
T stringToType(const std::string &s, bool failIfLeftoverChars=true)
std::string trimLeft(const std::string &s)
#define G2O_ATTRIBUTE_FORMAT12
std::string trimRight(const std::string &s)
std::string trim(const std::string &s)
std::vector< std::string > strSplit(const std::string &str, const std::string &delimiters)
int strPrintf(std::string &str, const char *fmt,...)
bool convertString(const std::string &s, T &x)
std::string formatString(const char *fmt,...)
bool strStartsWith(const std::string &s, const std::string &start)
int readLine(std::istream &is, std::stringstream ¤tLine)
OutputIterator readInts(const char *str, OutputIterator out)
std::string strToUpper(const std::string &s)
#define G2O_ATTRIBUTE_FORMAT23
std::string strToLower(const std::string &s)
bool strEndsWith(const std::string &s, const std::string &end)