1 #ifndef MISC_STRINGOPS_H
2 #define MISC_STRINGOPS_H
58 static bool ciLess(
const std::string &x,
const std::string &y) {
59 return std::lexicographical_compare(x.begin(), x.end(), y.begin(), y.end(),
ci());
62 static bool ciEqual(
const std::string &x,
const std::string &y) {
63 if (x.size() != y.size()) {
66 std::string::const_iterator xit = x.begin();
67 std::string::const_iterator yit = y.begin();
68 for (; xit != x.end(); ++xit, ++yit) {
76 static int ciCompareLen(
const std::string &x,
const std::string &y,
size_t len)
78 std::string::const_iterator xit = x.begin();
79 std::string::const_iterator yit = y.begin();
80 for(;xit != x.end() && yit != y.end() && len > 0;++xit,++yit,--len)
82 int res = *xit - *yit;
84 return (res > 0) ? 1 : -1;
98 for (
unsigned int i=0; i<inout.size(); ++i)
105 std::string out = in;
Definition: stringops.hpp:10
static bool ciEqual(const std::string &x, const std::string &y)
Definition: stringops.hpp:62
static bool ciLess(const std::string &x, const std::string &y)
Definition: stringops.hpp:58
static char toLower(char c)
Definition: stringops.hpp:24
static std::string lowerCase(const std::string &in)
Returns lower case copy of input string.
Definition: stringops.hpp:103
bool operator()(char x, char y) const
Definition: stringops.hpp:14
static int ciCompareLen(const std::string &x, const std::string &y, size_t len)
Definition: stringops.hpp:76
Definition: stringops.hpp:12
static void lowerCaseInPlace(std::string &inout)
Transforms input string to lower case w/o copy.
Definition: stringops.hpp:97