2018-12-12 02:17:40 +00:00
|
|
|
#ifndef LLARP_STR_HPP
|
|
|
|
#define LLARP_STR_HPP
|
|
|
|
|
2019-07-02 21:28:28 +00:00
|
|
|
#include <util/string_view.hpp>
|
|
|
|
|
2018-12-12 02:17:40 +00:00
|
|
|
namespace llarp
|
|
|
|
{
|
|
|
|
bool
|
|
|
|
StrEq(const char *s1, const char *s2);
|
|
|
|
|
|
|
|
bool
|
2019-07-02 21:28:28 +00:00
|
|
|
IsFalseValue(string_view str);
|
|
|
|
|
2020-02-22 19:21:08 +00:00
|
|
|
struct CaselessLessThan
|
2019-07-02 21:28:28 +00:00
|
|
|
{
|
|
|
|
bool
|
|
|
|
operator()(string_view lhs, string_view rhs) const;
|
|
|
|
};
|
2019-07-02 09:06:29 +00:00
|
|
|
|
2018-12-12 02:17:40 +00:00
|
|
|
bool
|
2019-07-02 21:28:28 +00:00
|
|
|
IsTrueValue(string_view str);
|
2018-12-12 02:17:40 +00:00
|
|
|
|
2020-02-23 02:23:19 +00:00
|
|
|
/// Trim leading and trailing (ascii) whitespace from the given string;
|
|
|
|
/// returns a string_view of the trimmed part of the string.
|
|
|
|
#ifdef __GNUG__
|
2020-02-23 19:37:44 +00:00
|
|
|
[[gnu::warn_unused_result]]
|
2020-02-23 02:23:19 +00:00
|
|
|
#endif
|
|
|
|
string_view
|
2020-02-23 03:08:27 +00:00
|
|
|
TrimWhitespace(string_view str);
|
2020-02-22 19:55:53 +00:00
|
|
|
|
2018-12-12 02:17:40 +00:00
|
|
|
} // namespace llarp
|
|
|
|
|
|
|
|
#endif
|