26#ifndef MYSQL_HARNESS_UTILITIES_INCLUDED
27#define MYSQL_HARNESS_UTILITIES_INCLUDED
34#include "harness_export.h"
99template <
typename Range>
104 typename Range::reverse_iterator
begin() {
return range_.rbegin(); }
106 typename Range::const_reverse_iterator
begin()
const {
110 typename Range::reverse_iterator
end() {
return range_.rend(); }
112 typename Range::const_reverse_iterator
end()
const {
return range_.rend(); }
131template <
typename Range>
139 const typename Map::key_type::first_type &first,
140 typename Map::iterator
start) {
141 typename Map::iterator finish =
start;
142 while (finish != assoc.end() && finish->first.first == first) ++finish;
143 return make_pair(
start, finish);
149 const typename Map::key_type::first_type &first) {
150 typedef typename Map::key_type::second_type SType;
152 assoc.lower_bound(make_pair(first, SType())));
156std::pair<typename Map::const_iterator, typename Map::const_iterator>
158 const typename Map::key_type::first_type &first,
159 typename Map::const_iterator
start) {
160 typename Map::const_iterator finish =
start;
161 while (finish != assoc.end() && finish->first.first == first) ++finish;
162 return make_pair(
start, finish);
166std::pair<typename Map::const_iterator, typename Map::const_iterator>
168 const typename Map::key_type::first_type &first) {
169 typedef typename Map::key_type::second_type SType;
171 assoc.lower_bound(make_pair(first, SType())));
180void strip(std::string *
str,
const char *chars =
" \t\n\r\f\v");
182std::string
strip_copy(std::string
str,
const char *chars =
" \t\n\r\f\v");
184bool matches_glob(
const std::string &word,
const std::string &pattern);
Class for creating a reverse range from another range.
Definition: utilities.h:100
Range & range_
Definition: utilities.h:115
Range::const_reverse_iterator end() const
Definition: utilities.h:112
Range::const_reverse_iterator begin() const
Definition: utilities.h:106
Range::reverse_iterator end()
Definition: utilities.h:110
Range::reverse_iterator begin()
Definition: utilities.h:104
RangeReverse(Range &range)
Definition: utilities.h:102
Definition: utilities.h:49
bool operator!=(const iterator &rhs)
Definition: utilities.h:60
bool operator==(const iterator &rhs)
Definition: utilities.h:58
iterator(Type *ptr)
Definition: utilities.h:51
Type & operator*()
Definition: utilities.h:62
Type * ptr_
Definition: utilities.h:67
const Type & operator*() const
Definition: utilities.h:64
iterator & operator++()
Definition: utilities.h:53
Class to turn C array into range.
Definition: utilities.h:47
iterator begin()
Definition: utilities.h:72
iterator end()
Definition: utilities.h:74
Range(Type *ptr, size_t length)
Definition: utilities.h:70
Type * start_
Definition: utilities.h:77
Type * finish_
Definition: utilities.h:78
static void start(mysql_harness::PluginFuncEnv *env)
Definition: http_auth_backend_plugin.cc:177
static char * path
Definition: mysqldump.cc:137
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1052
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:76
bool regex_pattern_matches(const std::string &s, const std::string &pattern)
Definition: utilities-posix.cc:44
std::string dirname(const std::string &path)
Definition: utilities.cc:38
void strip(std::string *str, const char *chars)
Remove starting and trailing delimiters from string.
Definition: utilities.cc:54
Range< Type > make_range(Type *ptr, size_t length)
Create a range from a plain C array.
Definition: utilities.h:91
std::string strip_copy(std::string str, const char *chars)
Definition: utilities.cc:59
bool matches_glob(const std::string &word, const std::string &pattern)
Definition: utilities-posix.cc:38
std::pair< typename Map::iterator, typename Map::iterator > find_range_first(Map &assoc, const typename Map::key_type::first_type &first, typename Map::iterator start)
Definition: utilities.h:137
RangeReverse< Range > reverse(Range &x)
Iterate over a range in reverse.
Definition: utilities.h:132
std::string basename(const std::string &path)
Definition: utilities.cc:46
Type
Definition: resource_group_basic_types.h:33
Definition: gen_lex_token.cc:149