MySQL 9.0.0
Source Code Documentation
mysql_harness::utility Namespace Reference

Classes

class  Range
 Class to turn C array into range. More...
 
class  RangeReverse
 Class for creating a reverse range from another range. More...
 

Functions

std::vector< std::string > HARNESS_EXPORT wrap_string (const std::string &to_wrap, std::size_t width, std::size_t indent_size)
 
bool HARNESS_EXPORT ends_with (const std::string &str, const std::string &suffix)
 Checks whether string ends with the specified suffix. More...
 
bool HARNESS_EXPORT starts_with (const std::string &str, const std::string &prefix)
 Checks whether string starts with the specified prefix. More...
 
HARNESS_EXPORT std::string string_format (const char *format,...)
 
bool matches_glob (const std::string &word, const std::string &pattern)
 
void sleep_seconds (unsigned int seconds)
 
bool regex_pattern_matches (const std::string &s, const std::string &pattern)
 
std::string dirname (const std::string &path)
 
std::string basename (const std::string &path)
 
void strip (std::string *str, const char *chars=" \t\n\r\f\v")
 Remove starting and trailing delimiters from string. More...
 
std::string strip_copy (std::string str, const char *chars)
 
std::vector< std::string > wrap_string (const std::string &to_wrap, size_t width, size_t indent_size)
 
template<class Type >
Range< Type > make_range (Type *ptr, size_t length)
 Create a range from a plain C array. More...
 
template<typename Range >
RangeReverse< Rangereverse (Range &x)
 Iterate over a range in reverse. More...
 
template<class Map >
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)
 
template<class Map >
std::pair< typename Map::iterator, typename Map::iterator > find_range_first (Map &assoc, const typename Map::key_type::first_type &first)
 
template<class Map >
std::pair< typename Map::const_iterator, typename Map::const_iterator > find_range_first (const Map &assoc, const typename Map::key_type::first_type &first, typename Map::const_iterator start)
 
template<class Map >
std::pair< typename Map::const_iterator, typename Map::const_iterator > find_range_first (const Map &assoc, const typename Map::key_type::first_type &first)
 

Function Documentation

◆ basename()

std::string mysql_harness::utility::basename ( const std::string &  path)

◆ dirname()

std::string mysql_harness::utility::dirname ( const std::string &  path)

◆ ends_with()

bool mysql_harness::utility::ends_with ( const std::string &  str,
const std::string &  suffix 
)

Checks whether string ends with the specified suffix.

Returns true if the string ends with the given suffix.

Returns
bool

◆ find_range_first() [1/4]

template<class Map >
std::pair< typename Map::const_iterator, typename Map::const_iterator > mysql_harness::utility::find_range_first ( const Map &  assoc,
const typename Map::key_type::first_type &  first 
)

◆ find_range_first() [2/4]

template<class Map >
std::pair< typename Map::const_iterator, typename Map::const_iterator > mysql_harness::utility::find_range_first ( const Map &  assoc,
const typename Map::key_type::first_type &  first,
typename Map::const_iterator  start 
)

◆ find_range_first() [3/4]

template<class Map >
std::pair< typename Map::iterator, typename Map::iterator > mysql_harness::utility::find_range_first ( Map &  assoc,
const typename Map::key_type::first_type &  first 
)

◆ find_range_first() [4/4]

template<class Map >
std::pair< typename Map::iterator, typename Map::iterator > mysql_harness::utility::find_range_first ( Map &  assoc,
const typename Map::key_type::first_type &  first,
typename Map::iterator  start 
)

◆ make_range()

template<class Type >
Range< Type > mysql_harness::utility::make_range ( Type *  ptr,
size_t  length 
)

Create a range from a plain C array.

This function create a range from a plain array so that arrays can be used in range-based loops.

See also
Range

◆ matches_glob()

bool mysql_harness::utility::matches_glob ( const std::string &  word,
const std::string &  pattern 
)

◆ regex_pattern_matches()

bool mysql_harness::utility::regex_pattern_matches ( const std::string &  s,
const std::string &  pattern 
)

◆ reverse()

template<typename Range >
RangeReverse< Range > mysql_harness::utility::reverse ( Range x)

Iterate over a range in reverse.

Function take a range, which can be any sequence container, and return a reverse range that iterate the sequence in reverse.

Typical use-case is:

for (auto item : reverse_iterate(my_list)) {
...
}

◆ sleep_seconds()

void mysql_harness::utility::sleep_seconds ( unsigned int  seconds)

◆ starts_with()

bool mysql_harness::utility::starts_with ( const std::string &  str,
const std::string &  prefix 
)

Checks whether string starts with the specified prefix.

Returns true if the string begins with the given prefix.

Returns
bool

◆ string_format()

std::string mysql_harness::utility::string_format ( const char *  format,
  ... 
)

◆ strip()

void mysql_harness::utility::strip ( std::string *  str,
const char *  chars 
)

Remove starting and trailing delimiters from string.

◆ strip_copy()

HARNESS_EXPORT std::string mysql_harness::utility::strip_copy ( std::string  str,
const char *  chars 
)

◆ wrap_string() [1/2]

std::vector< std::string > mysql_harness::utility::wrap_string ( const std::string &  to_wrap,
size_t  width,
size_t  indent_size 
)

◆ wrap_string() [2/2]

std::vector< std::string > HARNESS_EXPORT mysql_harness::utility::wrap_string ( const std::string &  to_wrap,
std::size_t  width,
std::size_t  indent_size 
)