26#ifndef MYSQLROUTER_UTILS_INCLUDED
27#define MYSQLROUTER_UTILS_INCLUDED
151 const std::string &
name,
152 const std::string &value);
161 const std::string &to);
174rename_file(
const std::string &from,
const std::string &to);
179 std::string &err_msg);
195 signed int default_result = 0) noexcept;
212strtoui_checked(const
char *value,
unsigned int default_result = 0) noexcept;
Definition: expected.h:286
Header for compiler-dependent features.
static int count
Definition: myisam_ftdump.cc:45
static char * path
Definition: mysqldump.cc:149
bool my_check_access(const std::string &path)
Definition: utils.cc:78
mode_t perm_mode
Definition: utils.h:52
void ROUTER_UTILS_EXPORT copy_file(const std::string &from, const std::string &to)
Copy contents of one file to another.
Definition: utils.cc:86
unsigned ROUTER_UTILS_EXPORT strtoui_checked(const char *value, unsigned int default_result=0) noexcept
Converts char array to unsigned integer, intuitively.
Definition: utils.cc:407
int ROUTER_UTILS_EXPORT strtoi_checked(const char *value, signed int default_result=0) noexcept
Converts char array to signed integer, intuitively.
Definition: utils.cc:403
uint16_t ROUTER_UTILS_EXPORT get_tcp_port(const std::string &data)
Validates a string containing a TCP port.
Definition: utils.cc:187
uint64_t ROUTER_UTILS_EXPORT strtoull_checked(const char *value, uint64_t default_result=0) noexcept
Definition: utils.cc:412
bool ROUTER_UTILS_EXPORT is_valid_socket_name(const std::string &socket, std::string &err_msg)
Returns whether the socket name passed as parameter is valid.
Definition: utils.cc:303
bool ROUTER_UTILS_EXPORT substitute_envvar(std::string &line) noexcept
Substitutes placeholders of environment variables in a string.
Definition: utils.cc:131
std::string ROUTER_UTILS_EXPORT substitute_variable(const std::string &s, const std::string &name, const std::string &value)
Definition: utils.cc:161
const perm_mode ROUTER_UTILS_EXPORT kStrictDirectoryPerm
Constant for directory accessible only for the owner.
Definition: utils.cc:73
void ROUTER_UTILS_EXPORT set_prompt_password(const std::function< std::string(const std::string &)> &f)
Override default prompt password function.
Definition: utils.cc:267
stdx::expected< void, std::error_code > ROUTER_UTILS_EXPORT rename_file(const std::string &from, const std::string &to)
renames file.
Definition: utils.cc:108
std::string ROUTER_UTILS_EXPORT ms_to_seconds_string(const std::chrono::milliseconds &msec)
Definition: utils.cc:179
std::string hexdump(const unsigned char *buffer, size_t count)
Dumps buffer as hex values.
std::string ROUTER_UTILS_EXPORT prompt_password(const std::string &prompt)
Prompts for a password from the console.
Definition: utils.cc:272
std::string ROUTER_CLUSTER_EXPORT to_string(const MetadataSchemaVersion &version)
Definition: cluster_metadata.cc:418
stdx::expected< native_handle_type, error_type > socket(int family, int sock_type, int protocol)
Definition: socket.h:63
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:418
std::basic_ostringstream< char, std::char_traits< char >, ut::allocator< char > > ostringstream
Specialization of basic_ostringstream which uses ut::allocator.
Definition: ut0new.h:2872
#define ROUTER_UTILS_EXPORT
Definition: router_utils_export.h:15
case opt name
Definition: sslopt-case.h:29