MySQL 9.0.0
Source Code Documentation
tcp_address.cc File Reference
#include "tcp_address.h"
#include <sstream>
#include <system_error>
#include <type_traits>
#include "mysql/harness/net_ts/internet.h"
#include "mysql/harness/stdx/expected.h"

Namespaces

namespace  mysql_harness
 

Functions

static constexpr int8_t from_digit (char c)
 
template<class T >
static std::enable_if_t< std::is_unsigned< T >::value, stdx::expected< T, std::error_code > > from_chars (const std::string &value, int base=10)
 convert a numeric string to a number. More...
 
static stdx::expected< TCPAddress, std::error_code > mysql_harness::make_tcp_address_ipv6 (const std::string &endpoint)
 
HARNESS_EXPORT stdx::expected< TCPAddress, std::error_code > mysql_harness::make_tcp_address (const std::string &endpoint)
 create TCPAddress from endpoint string. More...
 

Function Documentation

◆ from_chars()

template<class T >
static std::enable_if_t< std::is_unsigned< T >::value, stdx::expected< T, std::error_code > > from_chars ( const std::string &  value,
int  base = 10 
)
static

convert a numeric string to a number.

variant for unsigned integers like port numbers.

Contrary to strtol() it

  • has no locale support
  • '-0' doesn't parse as valid (as strtol() does)
  • does not handle prefixes like 0x for hex, no 0 for octal.

◆ from_digit()

static constexpr int8_t from_digit ( char  c)
staticconstexpr