Syntax: Note that leading 0's are not valid.
IPv6address = 6( h16 ":" ) ls32 | "::" 5( h16 ":" ) ls32 | [ h16 ] "::" 4( h16 ":" ) ls32 | [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32 | [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32 | [ *3( h16 ":" ) h16 ] "::" h16 ":" ls32 | [ *4( h16 ":" ) h16 ] "::" ls32 | [ *5( h16 ":" ) h16 ] "::" h16 | [ *6( h16 ":" ) h16 ] "::" ls32 = ( h16 ":" h16 ) | IPv4address ; least-significant 32 bits of address h16 = 1*4HEXDIG ; 16 bits of address represented in hexadecimal
Public Member Functions | |
ipv6_address () | |
ipv6_address (const std::string &v) | |
bool | is_null () const |
Test if null (all 0's). | |
std::string | string (bool compress=false) const |
std::ostream & | write (std::ostream &os, bool compress=false) const |
Static Public Attributes | |
static const char | SEPARATOR_CHAR |
separator (':') | |
Friends | |
bool URIPP_API | parse (std::string::const_iterator &first, std::string::const_iterator last, ipv6_address &v) |
uripp::ipv6_address::ipv6_address | ( | ) |
Construct null.
uripp::ipv6_address::ipv6_address | ( | const std::string & | v | ) |
Construct from string. Note that the string cannot be empty, it must contain valid chars.
std::invalid_argument | if invalid |
std::string uripp::ipv6_address::string | ( | bool | compress = false |
) | const |
Calculate string representation. Leading zeros are dropped, i.e. "3F" instead of "003F". Compress the longest run of 0's into "::" if compress
is true.
std::ostream& uripp::ipv6_address::write | ( | std::ostream & | os, | |
bool | compress = false | |||
) | const |
Stream out.
bool URIPP_API parse | ( | std::string::const_iterator & | first, | |
std::string::const_iterator | last, | |||
ipv6_address & | v | |||
) | [friend] |
Parse IP v6 address, returning whether found or not and advancing first and setting address if found. Does not skip leading space.