40 #if (defined (UNIX) || defined(CYGWIN)) && !defined(ANDROID) 48 std::string
trim(
const std::string& s)
52 string::size_type b = s.find_first_not_of(
" \t\n");
53 string::size_type e = s.find_last_not_of(
" \t\n");
56 return std::string(s, b, e - b + 1);
63 string::size_type b = s.find_first_not_of(
" \t\n");
64 string::size_type e = s.length() - 1;
67 return std::string(s, b, e - b + 1);
74 string::size_type b = 0;
75 string::size_type e = s.find_last_not_of(
" \t\n");
78 return std::string(s, b, e - b + 1);
84 std::transform(s.begin(), s.end(), back_inserter(ret), (int(*)(int)) std::tolower);
91 std::transform(s.begin(), s.end(), back_inserter(ret), (int(*)(int)) std::toupper);
99 va_start(arg_list, fmt);
100 int numChar = vasprintf(&auxPtr, fmt, arg_list);
116 va_start(arg_list, fmt);
117 int numChars = vasprintf(&auxPtr, fmt, arg_list);
126 #if (defined (UNIX) || defined(CYGWIN)) && !defined(ANDROID) 127 string result = filename;
130 wordexp(filename.c_str(), &p, 0);
132 result = p.we_wordv[0];
139 return std::string();
143 std::vector<std::string>
strSplit(
const std::string& str,
const std::string& delimiters)
145 std::vector<std::string> tokens;
146 string::size_type lastPos = 0;
147 string::size_type pos = 0;
150 pos = str.find_first_of(delimiters, lastPos);
151 tokens.push_back(str.substr(lastPos, pos - lastPos));
153 }
while (string::npos != pos);
160 if (s.size() < start.size())
162 return equal(start.begin(), start.end(), s.begin());
167 if (s.size() < end.size())
169 return equal(end.rbegin(), end.rend(), s.rbegin());
172 int readLine(std::istream& is, std::stringstream& currentLine)
178 is.get(*currentLine.rdbuf());
182 return static_cast<int>(currentLine.str().size());
#define __PRETTY_FUNCTION__
std::string strExpandFilename(const std::string &filename)
std::string trimLeft(const std::string &s)
void transform(PlaneList &l, const SE3Quat &t)
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,...)
std::string formatString(const char *fmt,...)
bool strStartsWith(const std::string &s, const std::string &start)
int readLine(std::istream &is, std::stringstream ¤tLine)
std::string strToUpper(const std::string &s)
std::string strToLower(const std::string &s)
bool strEndsWith(const std::string &s, const std::string &end)