lokinet/llarp/util/str.hpp
Jason Rhinelander 00a624ab40 Fix and rename CaselessCmp -> CaselessLessThan
The comparison done here was really weird: by comparing lengths *before*
contents "zz" would sort before "aaa".  It wasn't invalid for the
specific purpose being used here (looking for true/false values), but
would be highly broken if someone tried to use it elsewhere.

Also renamed it because it really is just a `<` implementation, not a
full cmp implementation.
2020-02-24 14:27:44 -04:00

26 lines
357 B
C++

#ifndef LLARP_STR_HPP
#define LLARP_STR_HPP
#include <util/string_view.hpp>
namespace llarp
{
bool
StrEq(const char *s1, const char *s2);
bool
IsFalseValue(string_view str);
struct CaselessLessThan
{
bool
operator()(string_view lhs, string_view rhs) const;
};
bool
IsTrueValue(string_view str);
} // namespace llarp
#endif