26 #ifndef INCLUDE_OLA_STRINGUTILS_H_
27 #define INCLUDE_OLA_STRINGUTILS_H_
38 enum { HEX_BIT_WIDTH = 4 };
50 std::vector<std::string> &tokens,
51 const std::string &delimiters=
" ");
79 bool StringEndsWith(
const std::string &s,
const std::string &suffix);
87 bool StripPrefix(std::string *s,
const std::string &prefix);
95 bool StripSuffix(std::string *s,
const std::string &suffix);
166 void Escape(std::string *original);
183 const std::string &find,
184 const std::string &replace);
208 bool StringToBool(
const std::string &value,
bool *output);
234 unsigned int *output,
235 bool strict =
false);
248 bool strict =
false);
261 bool strict =
false);
272 bool StringToInt(
const std::string &value,
int *output,
bool strict =
false);
285 bool strict =
false);
296 bool StringToInt(
const std::string &value, int8_t *output,
bool strict =
false);
412 unsigned int indent = 0,
413 unsigned int byte_per_line = 8);
418 template <
typename int_type>
420 if ((input.find(
"0x") != 0) && (input.find(
"0X") != 0))
422 std::string modified_input = input.substr(2);
432 std::string
StringJoin(
const std::string &delim,
const T &input) {
433 std::ostringstream str;
434 typename T::const_iterator iter = input.begin();
435 while (iter != input.end()) {
437 if (iter != input.end())
443 #endif // INCLUDE_OLA_STRINGUTILS_H_