9#include <boost/algorithm/string.hpp>
20 template <
typename StringT>
25 template <
typename Range1T,
typename Range2T>
26 static bool StartsWith(
const Range1T &input,
const Range2T &test) {
27 return boost::algorithm::istarts_with(input, test);
30 template <
typename Range1T,
typename Range2T>
31 static bool EndsWith(
const Range1T &input,
const Range2T &test) {
32 return boost::algorithm::iends_with(input, test);
35 template <
typename WritableRangeT>
36 static void ToLower(WritableRangeT &str) {
37 boost::algorithm::to_lower(str);
40 template <
typename SequenceT>
42 return boost::algorithm::to_lower_copy(str);
45 template <
typename WritableRangeT>
46 static void ToUpper(WritableRangeT &str) {
47 boost::algorithm::to_upper(str);
50 template <
typename SequenceT>
52 return boost::algorithm::to_upper_copy(str);
55 template <
typename WritableRangeT>
56 static void Trim(WritableRangeT &str) {
57 boost::algorithm::trim(str);
60 template <
typename SequenceT>
62 return boost::algorithm::trim_copy(str);
65 template<
typename Container,
typename Range1T,
typename Range2T>
66 static void Split(Container &destination,
const Range1T &str,
const Range2T &separators) {
67 boost::split(destination, str, boost::is_any_of(separators));
71 static bool Match(
const char *str,
const char *wildcard_pattern);
74 template <
typename String1T,
typename String2T>
75 static bool Match(
const String1T &str,
const String2T &wildcard_pattern) {
static void ToUpper(WritableRangeT &str)
static bool Match(const char *str, const char *wildcard_pattern)
Match str with the Unix shell-style wildcard_pattern.
static void Split(Container &destination, const Range1T &str, const Range2T &separators)
static bool Match(const String1T &str, const String2T &wildcard_pattern)
Match str with the Unix shell-style wildcard_pattern.
static const char * ToConstCharPtr(const char *str)
static auto ToLowerCopy(const SequenceT &str)
static auto ToUpperCopy(const SequenceT &str)
static auto TrimCopy(const SequenceT &str)
static const char * ToConstCharPtr(const StringT &str)
static bool EndsWith(const Range1T &input, const Range2T &test)
static void Trim(WritableRangeT &str)
static void ToLower(WritableRangeT &str)
static bool StartsWith(const Range1T &input, const Range2T &test)
This file contains definitions of common data structures used in traffic manager.