31 char*
strtok(
char* str,
const char* strDelimit,
char** context) noexcept;
49 template <
class OUT_CONTAINER>
51 const std::string& inString,
const std::string& inDelimiters,
52 OUT_CONTAINER& outTokens,
bool skipBlankTokens =
true) noexcept;
56 const
std::
string& inString, const
std::
string& inDelimiters,
57 std::deque<
std::
string>& outTokens,
bool skipBlankTokens) noexcept;
59 const
std::
string& inString, const
std::
string& inDelimiters,
60 std::vector<
std::
string>& outTokens,
bool skipBlankTokens) noexcept;
77 void decodeUTF8(const
std::
string& strUTF8,
std::vector<uint16_t>& out_uniStr);
88 const
std::vector<uint8_t>& inputData,
std::
string& outString);
100 const
double val,
int nDecimalDigits = 2,
bool middle_space = true);
104 const
std::
string& str, const
size_t total_len,
105 bool truncate_if_larger = false);
108 bool strCmp(const
std::
string& s1, const
std::
string& s2);
124 template <typename T>
127 std::string ret =
"[";
129 for (; it != V.end();)
133 if (it != V.end()) ret +=
",";
141 const std::vector<std::string>& lst, std::string&
out,
142 const std::string& newline =
"\r\n");
145 const std::deque<std::string>& lst, std::string&
out,
146 const std::string& newline =
"\r\n");
152 template <
typename T>
155 std::stringstream sin;
std::string std::string format(std::string_view fmt, ARGS &&... args)
bool strStartsI(const std::string &str, const std::string &subStr)
Return true if "str" starts with "subStr" (case insensitive)
void decodeUTF8(const std::string &strUTF8, std::vector< uint16_t > &out_uniStr)
Decodes a UTF-8 string into an UNICODE string.
bool strCmp(const std::string &s1, const std::string &s2)
Return true if the two strings are equal (case sensitive)
void stringListAsString(const std::vector< std::string > &lst, std::string &out, const std::string &newline="\")
Convert a string list to one single string with new-lines.
void encodeUTF8(const std::vector< uint16_t > &input, std::string &output)
Encodes a 2-bytes UNICODE string into a UTF-8 string.
void tokenize(const std::string &inString, const std::string &inDelimiters, OUT_CONTAINER &outTokens, bool skipBlankTokens=true) noexcept
Tokenizes a string according to a set of delimiting characters.
bool decodeBase64(const std::string &inString, std::vector< uint8_t > &outData)
Decode a base-64 string into the original sequence of bytes.
std::string lowerCase(const std::string &str)
Returns an lower-case version of a string.
char * strtok(char *str, const char *strDelimit, char **context) noexcept
An OS-independent method for tokenizing a string.
std::string unitsFormat(const double val, int nDecimalDigits=2, bool middle_space=true)
This function implements formatting with the appropriate SI metric unit prefix: 1e-12->'p', 1e-9->'n', 1e-6->'u', 1e-3->'m', 1->'', 1e3->'K', 1e6->'M', 1e9->'G', 1e12->'T'.
void encodeBase64(const std::vector< uint8_t > &inputData, std::string &outString)
Encode a sequence of bytes as a string in base-64.
mrpt::vision::TStereoCalibResults out
T str2num(std::string const &value)
Original code snippet found in http://stackoverflow.com/a/30357710.
std::string upperCase(const std::string &str)
Returns a upper-case version of a string.
bool strStarts(const std::string &str, const std::string &subStr)
Return true if "str" starts with "subStr" (case sensitive)
std::string trim(const std::string &str)
Removes leading and trailing spaces.
std::string rightPad(const std::string &str, const size_t total_len, bool truncate_if_larger=false)
Enlarge the string with spaces up to the given length.
bool strCmpI(const std::string &s1, const std::string &s2)
Return true if the two strings are equal (case insensitive)
std::string sprintf_container(const char *fmt, const T &V)
Generates a string for a container in the format [A,B,C,...], and the fmt string for each vector elem...