ocssw
V2022
|
StringUtils.hpp
Go to the documentation of this file.
69 static std::string replace_all(const std::string& haystack, const char *needle, const char *replacement);
79 static std::string& replace_all(std::string& haystack, const char *needle, const char *replacement);
92 static std::string strip_enclosure(const std::string& haystack, const char first, const char last);
177 static std::vector<T> stov(std::string& str, const std::string& delims=",", bool merge_multiple_delims=false, T default_value=T{});
196 static std::vector<T> stov(std::string& str, const std::string& delims, bool merge_multiple_delims, T default_value, std::function<T(const std::string&)> parser);
198 // TODO: provide things like this, to make it easier to customize? (All this does is reorder the params and provide some defaults.
static std::string insert_oc_roots(const std::string &str)
Replace paths in the input with $OCSSWROOT, $OCDATAROOT, etc, (returns a copy)
Definition: argpar.c:27
static std::string replace_all(const std::string &haystack, const char *needle, const char *replacement)
Replace all occurrences of a string (returns a copy)
static std::string replace_oc_roots(const std::string &str)
Replace $OCSSWROOT, $OCDATAROOT, etc, in string (returns a copy)
static std::string strip_enclosure(const std::string &haystack, const char first, const char last)
Remove start/end characters from ends of a string (returns a copy)
static std::vector< T > stov(std::string &str, const std::string &delims=",", bool merge_multiple_delims=false, T default_value=T{})
Convert delimited string to vector.
static std::string strip_brackets(const std::string &haystack)
Remove square brackets from ends of input string (returns a copy)
static std::string strip_quotes(const std::string &haystack)
Remove single- and double-quotes from ends of input string (returns a copy)
Static functions for parsing/processing/modifying strings.
Definition: StringUtils.hpp:26
Definition: DataProvider.hpp:16