#include <ipv6_address.h>
Public Member Functions | |
ipv6_address () | |
Construct null. More... | |
ipv6_address (const std::string &v) | |
Construct from string. More... | |
bool | is_null () const |
Test if null (all 0's). More... | |
std::string | string (bool compress=false) const |
Calculate string representation. More... | |
std::ostream & | write (std::ostream &os, bool compress=false) const |
Stream out. More... | |
Static Public Attributes | |
static const char | SEPARATOR_CHAR = ':' |
separator (':') More... | |
Private Member Functions | |
bool | zero_run (size_t &first, size_t &last) const |
Private Attributes | |
unsigned short | hextets_ [8] |
Friends | |
bool TECOMMONEXPORT | parse (std::string::const_iterator &first, std::string::const_iterator last, ipv6_address &v) |
Parse IP v6 address, returning whether found or not and advancing first and setting address if found. More... | |
Definition at line 52 of file ipv6_address.h.
te::common::uri::ipv6_address::ipv6_address | ( | ) |
te::common::uri::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 |
Definition at line 43 of file ipv6_address.cpp.
References parse.
bool te::common::uri::ipv6_address::is_null | ( | ) | const |
std::string te::common::uri::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.
Definition at line 78 of file ipv6_address.cpp.
References write().
std::ostream & te::common::uri::ipv6_address::write | ( | std::ostream & | os, |
bool | compress = false |
||
) | const |
Stream out.
Definition at line 83 of file ipv6_address.cpp.
References hextets_, SEPARATOR_CHAR, and zero_run().
Referenced by te::common::uri::operator<<(), and string().
|
private |
|
friend |
Parse IP v6 address, returning whether found or not and advancing first and setting address if found.
Does not skip leading space.
Definition at line 126 of file ipv6_address.cpp.
Referenced by ipv6_address().
|
private |
Definition at line 73 of file ipv6_address.h.
Referenced by ipv6_address(), is_null(), te::common::uri::parse(), write(), and zero_run().
|
static |