26#ifndef MYSQL_HARNESS_STRING_UTILS_INCLUDED
27#define MYSQL_HARNESS_STRING_UTILS_INCLUDED
29#include "harness_export.h"
33#include <system_error>
52std::vector<std::string>
split_string(
const std::string_view &data,
54 bool allow_empty =
true);
86HARNESS_EXPORT
bool ieq(
const std::string_view &a,
const std::string_view &b);
101std::string
limit_lines(
const std::string &
str,
const size_t limit,
102 const std::string &replace_with =
"");
Definition: expected.h:286
const char * delimiter
Definition: mysqlslap.cc:160
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1117
HARNESS_EXPORT stdx::expected< bool, std::error_code > bool_from_string(std::string str)
Returns a boolean value parsed from a string.
Definition: string_utils.cc:142
HARNESS_EXPORT std::vector< std::string > split_string(const std::string_view &data, const char delimiter, bool allow_empty=true)
Splits a string using a delimiter.
Definition: string_utils.cc:36
HARNESS_EXPORT bool ieq(const std::string_view &a, const std::string_view &b)
Compares two string values for equality (case insensitive).
Definition: string_utils.cc:75
HARNESS_EXPORT void left_trim(std::string &str)
Removes leading whitespaces from the string.
Definition: string_utils.cc:61
HARNESS_EXPORT void trim(std::string &str)
Removes both leading and trailing whitespaces from the string.
Definition: string_utils.cc:70
HARNESS_EXPORT std::string limit_lines(const std::string &str, const size_t limit, const std::string &replace_with="")
Returns the input string with number of lines reduced to selected value.
Definition: string_utils.cc:109
HARNESS_EXPORT void right_trim(std::string &str)
Removes trailing whitespaces from the string.
Definition: string_utils.cc:65