28#ifndef _LOG4TANGO_STRINGUTIL_H
29#define _LOG4TANGO_STRINGUTIL_H
49 static std::string
vform(
const char* format, va_list args);
55 static std::string
trim(
const std::string& s);
70 static unsigned int split(std::vector<std::string>& v,
71 const std::string& s,
char delimiter,
72 unsigned int maxSegments = INT_MAX);
85 static unsigned int split(T& output,
86 const std::string& s,
char delimiter,
87 unsigned int maxSegments = INT_MAX)
89 std::string::size_type left = 0;
91 for (i = 1; i < maxSegments; i++) {
92 std::string::size_type right = s.find(delimiter, left);
93 if (right == std::string::npos) {
96 *output++ = s.substr(left, right - left);
99 *output++ = s.substr(left);
Definition: StringUtil.hh:40
static unsigned int split(std::vector< std::string > &v, const std::string &s, char delimiter, unsigned int maxSegments=INT_MAX)
splits a string into a vector of string segments based on the given delimiter.
Definition: StringUtil.cpp:98
static std::string vform(const char *format, va_list args)
Returns a string constructed from the a format specifier and a va_list of arguments,...
Definition: StringUtil.cpp:57
static std::string trim(const std::string &s)
Returns a string identical to the given string but without leading or trailing HTABs or spaces.
Definition: StringUtil.cpp:81
static unsigned int split(T &output, const std::string &s, char delimiter, unsigned int maxSegments=INT_MAX)
splits a string into string segments based on the given delimiter and assigns the segments through an...
Definition: StringUtil.hh:85
Definition: Appender.hh:40