MySQL 8.0.39
Source Code Documentation
uri.cc File Reference
#include "mysqlrouter/uri.h"
#include <algorithm>
#include <cctype>
#include <climits>
#include <memory>
#include <sstream>
#include <stdexcept>
#include <string>
#include "mysql/harness/string_utils.h"

Namespaces

namespace  mysqlrouter
 

Functions

static size_t mysqlrouter::match_zero_or_more (const std::string &s, const std::string &pat, size_t pos_start=0)
 
static size_t mysqlrouter::skip (size_t pos_start, size_t match_len)
 
static std::string mysqlrouter::capture (const std::string &s, size_t pos_start, size_t match_len, size_t &pos_end)
 
static bool mysqlrouter::is_eol (const std::string &s, size_t pos_start)
 
static bool mysqlrouter::match_pct_encoded (const std::string &s, size_t pos_start, size_t &pos_end, std::string &pct_enc)
 
static bool mysqlrouter::match_path_chars (const std::string &s, size_t pos_start, size_t &pos_end, std::string &path_chars)
 
static bool mysqlrouter::match_scheme (const std::string &s, size_t pos_start, size_t &pos_end, std::string &scheme)
 
static bool mysqlrouter::match_colon (const std::string &s, size_t pos_start, size_t &pos_end)
 
static bool mysqlrouter::match_double_colon (const std::string &s, size_t pos_start, size_t &pos_end)
 
static bool mysqlrouter::match_userinfo (const std::string &s, size_t pos_start, size_t &pos_end, std::string &user_info)
 
static void mysqlrouter::split_userinfo (const std::string &user_info, std::string &username, std::string &password)
 
static bool mysqlrouter::match_port (const std::string &s, size_t pos_start, size_t &pos_end, std::string &port)
 
static bool mysqlrouter::match_reg_name (const std::string &s, size_t pos_start, size_t &pos_end, std::string &reg_name, bool with_pct_encoded)
 
static bool mysqlrouter::match_dec_octet (const std::string &s, size_t pos_start, size_t &pos_end, std::string &dec_octet)
 
static bool mysqlrouter::match_ipv4 (const std::string &s, size_t pos_start, size_t &pos_end, std::string &ipv4_addr)
 
static bool mysqlrouter::match_ipv6_h16 (const std::string &s, size_t pos_start, size_t &pos_end, std::string &h16)
 
static bool mysqlrouter::match_ipv6_ls32 (const std::string &s, size_t pos_start, size_t &pos_end, std::string &ls32)
 
static bool mysqlrouter::match_ipv6_h16_colon (const std::string &s, size_t pos_start, size_t &pos_end, std::string &h16_colon)
 
static bool mysqlrouter::match_ipv6_1 (const std::string &s, size_t pos_start, size_t &pos_end, std::string &ipv6_addr)
 
static bool mysqlrouter::match_ipv6_2 (const std::string &s, size_t pos_start, size_t &pos_end, std::string &ipv6_addr)
 
static bool mysqlrouter::match_ipv6_h16_colon_prefix (const std::string &s, size_t pos_start, size_t max_pre_double_colon, size_t &pos_end, std::string &ipv6_addr)
 
static bool mysqlrouter::match_ipv6_3 (const std::string &s, size_t pos_start, size_t max_pre_double_colon, size_t &pos_end, std::string &ipv6_addr)
 
static bool mysqlrouter::match_ipv6_8 (const std::string &s, size_t pos_start, size_t max_pre_double_colon, size_t &pos_end, std::string &ipv6_addr)
 
static bool mysqlrouter::match_ipv6_zoneid (const std::string &s, size_t pos_start, size_t &pos_end, std::string &zoneid, bool with_pct_encoded)
 
static bool mysqlrouter::match_ipv6 (const std::string &s, size_t pos_start, size_t &pos_end, std::string &ipv6_addr)
 
static bool mysqlrouter::match_ip_literal (const std::string &s, size_t pos_start, size_t &pos_end, std::string &ip_literal, bool with_pct_encoded)
 
static bool mysqlrouter::match_host (const std::string &s, size_t pos_start, size_t &pos_end, std::string &host, bool with_pct_encoded)
 
static bool mysqlrouter::match_authority (const std::string &s, size_t pos_start, size_t &pos_end, std::string &tmp_host, std::string &tmp_port, std::string &tmp_username, std::string &tmp_password)
 
static bool mysqlrouter::match_path_segment (const std::string &s, size_t pos_start, size_t &pos_end, std::string &segment)
 
static bool mysqlrouter::match_path_empty (const std::string &s, size_t pos_start, size_t &pos_end, std::string &path)
 
static bool mysqlrouter::match_path_absolute (const std::string &s, size_t pos_start, size_t &pos_end, std::string &path)
 
static bool mysqlrouter::match_path_absolute_or_empty (const std::string &s, size_t pos_start, size_t &pos_end, std::string &path)
 
static bool mysqlrouter::match_path_rootless (const std::string &s, size_t pos_start, size_t &pos_end, std::string &path)
 
static bool mysqlrouter::match_fragment_query_chars (const std::string &s, size_t pos_start, size_t &pos_end, std::string &chars)
 
static bool mysqlrouter::match_fragment (const std::string &s, size_t pos_start, size_t &pos_end, std::string &fragment)
 
static bool mysqlrouter::match_query (const std::string &s, size_t pos_start, size_t &pos_end, std::string &query)
 
static std::string mysqlrouter::pct_decode (const std::string &s)
 
static URIQuery mysqlrouter::split_query (const std::string &s)
 
static bool mysqlrouter::is_ipv6 (const std::string &s)
 
static std::string mysqlrouter::pct_encode (const std::string &s, const std::string &allowed_chars)
 
std::ostream & mysqlrouter::operator<< (std::ostream &strm, const URI &uri)
 

Variables

const std::string kDigit = "0123456789"
 
const std::string kHexLower = "abcdef"
 
const std::string kHexUpper = "ABCDEF"
 
const std::string kAlphaLower = kHexLower + "ghijklmnopqrstuvwxyz"
 
const std::string kAlphaUpper = kHexUpper + "GHIJKLMNOPQRSTUVWXYZ"
 
const std::string kAlpha = kAlphaLower + kAlphaUpper
 
const std::string kUnreserved = kAlpha + kDigit + "-" + "." + "_" + "~"
 
const std::string kHexDigit = kDigit + kHexLower + kHexUpper
 
const std::string kGenDelims = ":/?#[]@"
 
const std::string kSubDelims = "!$&'()*+,;="
 
const std::string kReserved = kGenDelims + kSubDelims
 
const std::string kPathCharNoPctEncoded = kUnreserved + kSubDelims + ":" + "@"
 
const std::string kFragmentOrQuery = "/?"
 

Variable Documentation

◆ kAlpha

const std::string kAlpha = kAlphaLower + kAlphaUpper

◆ kAlphaLower

const std::string kAlphaLower = kHexLower + "ghijklmnopqrstuvwxyz"

◆ kAlphaUpper

const std::string kAlphaUpper = kHexUpper + "GHIJKLMNOPQRSTUVWXYZ"

◆ kDigit

const std::string kDigit = "0123456789"

◆ kFragmentOrQuery

const std::string kFragmentOrQuery = "/?"

◆ kGenDelims

const std::string kGenDelims = ":/?#[]@"

◆ kHexDigit

const std::string kHexDigit = kDigit + kHexLower + kHexUpper

◆ kHexLower

const std::string kHexLower = "abcdef"

◆ kHexUpper

const std::string kHexUpper = "ABCDEF"

◆ kPathCharNoPctEncoded

const std::string kPathCharNoPctEncoded = kUnreserved + kSubDelims + ":" + "@"

◆ kReserved

const std::string kReserved = kGenDelims + kSubDelims

◆ kSubDelims

const std::string kSubDelims = "!$&'()*+,;="

◆ kUnreserved

const std::string kUnreserved = kAlpha + kDigit + "-" + "." + "_" + "~"