27 #ifndef G2O_STRING_TOOLS_H 28 #define G2O_STRING_TOOLS_H 49 std::string
trim(
const std::string& s);
54 std::string
trimLeft(
const std::string& s);
59 std::string
trimRight(
const std::string& s);
75 template <
typename OutputIterator>
76 OutputIterator
readInts(
const char* str, OutputIterator out)
78 char* cl = (
char*)str;
81 int id = strtol(cl, &cle, 10);
94 template <
typename OutputIterator>
95 OutputIterator
readFloats(
const char* str, OutputIterator out)
97 char* cl = (
char*)str;
100 double val = strtod(cl, &cle);
124 bool convertString(
const std::string& s, T& x,
bool failIfLeftoverChars =
true)
126 std::istringstream i(s);
128 if (!(i >> x) || (failIfLeftoverChars && i.get(c)))
148 bool strStartsWith(
const std::string & str,
const std::string& substr);
153 bool strEndsWith(
const std::string & str,
const std::string& substr);
164 std::vector<std::string>
strSplit(
const std::string&
s,
const std::string& delim);
170 int readLine(std::istream& is, std::stringstream& currentLine);
OutputIterator readFloats(const char *str, OutputIterator out)
int readLine(std::istream &is, std::stringstream ¤tLine)
T stringToType(const std::string &s, bool failIfLeftoverChars=true)
#define G2O_ATTRIBUTE_FORMAT12
std::vector< std::string > strSplit(const std::string &str, const std::string &delimiters)
std::string trim(const std::string &s)
std::string trimLeft(const std::string &s)
bool strStartsWith(const std::string &s, const std::string &start)
std::string strExpandFilename(const std::string &filename)
std::string trimRight(const std::string &s)
std::string strToLower(const std::string &s)
OutputIterator readInts(const char *str, OutputIterator out)
int strPrintf(std::string &str, const char *fmt,...)
bool convertString(const std::string &s, T &x, bool failIfLeftoverChars=true)
TFSIMD_FORCE_INLINE const tfScalar & x() const
#define G2O_ATTRIBUTE_FORMAT23
std::string strToUpper(const std::string &s)
bool strEndsWith(const std::string &s, const std::string &end)
std::string formatString(const char *fmt,...)