MySQL 9.1.0
Source Code Documentation
utils.cc File Reference
#include "mysqlrouter/utils.h"
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cstdarg>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <stdexcept>
#include <system_error>
#include <fcntl.h>
#include <grp.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/un.h>
#include <termios.h>
#include <unistd.h>
#include "mysql/harness/filesystem.h"
#include "mysql/harness/net_ts/internet.h"
#include "mysql/harness/stdx/expected.h"
#include "mysql/harness/string_utils.h"
#include "mysql/harness/utility/string.h"

Namespaces

namespace  mysqlrouter
 

Functions

bool mysqlrouter::my_check_access (const std::string &path)
 
void ROUTER_UTILS_EXPORT mysqlrouter::copy_file (const std::string &from, const std::string &to)
 Copy contents of one file to another. More...
 
stdx::expected< void, std::error_code > ROUTER_UTILS_EXPORT mysqlrouter::rename_file (const std::string &from, const std::string &to)
 renames file. More...
 
bool ROUTER_UTILS_EXPORT mysqlrouter::substitute_envvar (std::string &line) noexcept
 Substitutes placeholders of environment variables in a string. More...
 
std::string ROUTER_UTILS_EXPORT mysqlrouter::substitute_variable (const std::string &s, const std::string &name, const std::string &value)
 
std::string ROUTER_UTILS_EXPORT mysqlrouter::ms_to_seconds_string (const std::chrono::milliseconds &msec)
 
uint16_t ROUTER_UTILS_EXPORT mysqlrouter::get_tcp_port (const std::string &data)
 Validates a string containing a TCP port. More...
 
static std::string mysqlrouter::default_prompt_password (const std::string &prompt)
 
void ROUTER_UTILS_EXPORT mysqlrouter::set_prompt_password (const std::function< std::string(const std::string &)> &f)
 Override default prompt password function. More...
 
std::string ROUTER_UTILS_EXPORT mysqlrouter::prompt_password (const std::string &prompt)
 Prompts for a password from the console. More...
 
bool ROUTER_UTILS_EXPORT mysqlrouter::is_valid_socket_name (const std::string &socket, std::string &err_msg)
 Returns whether the socket name passed as parameter is valid. More...
 
template<typename RET >
static RET mysqlrouter::strtoX_checked_common (const char *value, RET default_value) noexcept
 
int ROUTER_UTILS_EXPORT mysqlrouter::strtoi_checked (const char *value, signed int default_result=0) noexcept
 Converts char array to signed integer, intuitively. More...
 
unsigned ROUTER_UTILS_EXPORT mysqlrouter::strtoui_checked (const char *value, unsigned int default_result=0) noexcept
 Converts char array to unsigned integer, intuitively. More...
 
uint64_t ROUTER_UTILS_EXPORT mysqlrouter::strtoull_checked (const char *value, uint64_t default_result=0) noexcept
 

Variables

const char kValidPortChars [] = "0123456789"
 
static std::function< std::string(const std::string &)> mysqlrouter::g_prompt_password
 

Variable Documentation

◆ kValidPortChars

const char kValidPortChars[] = "0123456789"