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);
194int strtoi_checked(
const char *value,
signed int default_result = 0) noexcept;
211strtoui_checked(const
char *value,
unsigned int default_result = 0) noexcept;
Definition: expected.h:944
Header for compiler-dependent features.
static int count
Definition: myisam_ftdump.cc:43
static char * path
Definition: mysqldump.cc:137
bool my_check_access(const std::string &path)
Definition: utils.cc:78
mode_t perm_mode
Definition: utils.h:52
void ROUTER_LIB_EXPORT copy_file(const std::string &from, const std::string &to)
Copy contents of one file to another.
Definition: utils.cc:86
unsigned ROUTER_LIB_EXPORT strtoui_checked(const char *value, unsigned int default_result=0) noexcept
Converts char array to unsigned integer, intuitively.
Definition: utils.cc:408
int strtoi_checked(const char *value, signed int default_result=0) noexcept
Converts char array to signed integer, intuitively.
Definition: utils.cc:404
uint16_t ROUTER_LIB_EXPORT get_tcp_port(const std::string &data)
Validates a string containing a TCP port.
Definition: utils.cc:188
uint64_t ROUTER_LIB_EXPORT strtoull_checked(const char *value, uint64_t default_result=0) noexcept
Definition: utils.cc:413
bool ROUTER_LIB_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:304
bool ROUTER_LIB_EXPORT substitute_envvar(std::string &line) noexcept
Substitutes placeholders of environment variables in a string.
Definition: utils.cc:132
std::string ROUTER_LIB_EXPORT substitute_variable(const std::string &s, const std::string &name, const std::string &value)
Definition: utils.cc:162
const perm_mode ROUTER_LIB_EXPORT kStrictDirectoryPerm
Constant for directory accessible only for the owner.
Definition: utils.cc:73
void ROUTER_LIB_EXPORT set_prompt_password(const std::function< std::string(const std::string &)> &f)
Override default prompt password function.
Definition: utils.cc:268
stdx::expected< void, std::error_code > ROUTER_LIB_EXPORT rename_file(const std::string &from, const std::string &to)
renames file.
Definition: utils.cc:108
std::string ROUTER_LIB_EXPORT ms_to_seconds_string(const std::chrono::milliseconds &msec)
Definition: utils.cc:180
std::string hexdump(const unsigned char *buffer, size_t count)
Dumps buffer as hex values.
std::string ROUTER_LIB_EXPORT prompt_password(const std::string &prompt)
Prompts for a password from the console.
Definition: utils.cc:273
std::string ROUTER_LIB_EXPORT to_string(const MetadataSchemaVersion &version)
Definition: cluster_metadata.cc:460
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:420
std::basic_ostringstream< char, std::char_traits< char >, ut::allocator< char > > ostringstream
Specialization of basic_ostringstream which uses ut::allocator.
Definition: ut0new.h:2871
#define ROUTER_LIB_EXPORT
Definition: router_export.h:15
case opt name
Definition: sslopt-case.h:33