Go to the documentation of this file.
26 #include <SimoxUtility/algorithm/string/string_tools.h>
28 std::vector<std::string>
30 const std::string& splitBy,
32 bool removeEmptyElements)
37 std::vector<std::string>
39 const std::string& splitBy,
41 bool removeEmptyElements)
59 armarx::Contains(
const std::string& haystack,
const std::string& needle,
bool caseInsensitive)
61 std::string haystackToSearch = (caseInsensitive) ? simox::alg::to_lower(haystack) : haystack;
62 std::string needleToSearchFor = (caseInsensitive) ? simox::alg::to_lower(needle) : needle;
64 return haystackToSearch.find(needleToSearchFor) != std::string::npos;
71 buffer.reserve(
data.size());
72 for (
size_t pos = 0; pos !=
data.size(); ++pos)
77 buffer.append(
"&");
80 buffer.append(
""");
83 buffer.append(
"'");
86 buffer.append(
"<");
89 buffer.append(
">");
92 buffer.append(&
data[pos], 1);
102 std::stringstream ss;
104 ss.imbue(std::locale::classic());
113 std::stringstream ss;
115 ss.imbue(std::locale::classic());
124 long long l = std::stoll(
input,
nullptr, 0);
127 std::stringstream ss;
128 ss <<
"Could not parse " <<
input <<
" to unsigned int";
129 throw std::out_of_range(ss.str());
131 return static_cast<unsigned int>(l);
unsigned int toUInt(const std::string &input)
int toInt(const std::string &input)
bool Contains(const ContainerType &container, const ElementType &searchElement)
std::vector< std::string > Split(const std::string &source, const std::string &splitBy, bool trimElements=false, bool removeEmptyElements=false)
float toFloat(const std::string &input)
Converts a string to float and uses always dot as seperator.
std::string Encode(const std::string &data)
bool starts_with(const std::string &haystack, const std::string &needle)
ReaderT::InputType & input
Vertex source(const detail::edge_base< Directed, Vertex > &e, const PCG &)
bool ends_with(const std::string &haystack, const std::string &needle)
std::vector< std::string > split(const std::string &source, const std::string &splitBy, bool trimElements=false, bool removeEmptyElements=false)