#include <util.h>
Static Public Member Functions | |
static int | splitString (const std::string &input, const std::string &delimiter, std::vector< std::string > &results, bool skipEmpty=false) |
Splits a delimiter delimited string into a vector of strings. | |
static std::string | joinStrings (std::vector< std::string > strings, const std::string &delimiter) |
Concatenates strings using a delimiter. | |
static std::map< std::string, std::string > | createParamMap (const std::string ¶mStr) |
Converts a string of format "key1=value1;key2=value2" into a STL map. | |
static std::string | join (const char *string1, const char *string2) |
Concatenates two strings (no delimiter). | |
static std::string | removeFileExt (std::string fileName) |
Removes file extension from a file name. | |
static int | parseInt (const std::string &input) |
Parses integer from a string. | |
static bool | parseBool (const std::string &input) |
Parses a boolean value from a string. | |
static std::string | toString (int i) |
Converts an integer value to string. |
static int iopc::StringUtil::splitString | ( | const std::string & | input, | |
const std::string & | delimiter, | |||
std::vector< std::string > & | results, | |||
bool | skipEmpty = false | |||
) | [static] |
Splits a delimiter delimited string into a vector of strings.
[in] | input | The string containing delimiter delimited values |
[in] | delimiter | The delimiting string |
[out] | results | Vector containing the substrings from input |
[in] | skipEmpty | Determines whether to skip empty substrings (two delimiters in sequence). Default is false. |
static std::string iopc::StringUtil::joinStrings | ( | std::vector< std::string > | strings, | |
const std::string & | delimiter | |||
) | [static] |
Concatenates strings using a delimiter.
strings | The list of strings to be concatenated | |
delimiter | The strings are concatenated using this delimiter. |
static std::map<std::string, std::string> iopc::StringUtil::createParamMap | ( | const std::string & | paramStr | ) | [static] |
Converts a string of format "key1=value1;key2=value2" into a STL map.
Key-value pair delimiter is specified by the IOPC_PARAM_DELIMITER macro defined in iopccommon/util.h
paramStr | The string to be converted |
static std::string iopc::StringUtil::removeFileExt | ( | std::string | fileName | ) | [inline, static] |
Removes file extension from a file name.
fileName | The file name. May include a path |
int iopc::StringUtil::parseInt | ( | const std::string & | input | ) | [static] |
Parses integer from a string.
bool iopc::StringUtil::parseBool | ( | const std::string & | input | ) | [static] |
Parses a boolean value from a string.