IP address. More...
#include <ip_address.h>
Public Member Functions | |
| ip_address () | |
| Construct null. More... | |
| ip_address (const std::string &v) | |
| Construct from string. More... | |
| bool | is_null () const |
| Test if null (all 0's). More... | |
| std::ostream & | operator<< (std::ostream &os) const |
| Stream out. More... | |
| std::string | string () const |
| Calculate string. More... | |
Static Public Attributes | |
| static const char | SEPARATOR_CHAR = '.' |
| separator ('.') More... | |
Private Attributes | |
| unsigned char | octets_ [4] |
Friends | |
| bool TECOMMONEXPORT | parse (std::string::const_iterator &first, std::string::const_iterator last, ip_address &v) |
| Parse IP address, returning whether found or not and advancing first and setting address if found. More... | |
| 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... | |
IP address.
Syntax: Note that leading 0's are not valid.
IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet
dec-octet = DIGIT ; 0-9
| %x31-39 DIGIT ; 10-99
| "1" 2DIGIT ; 100-199
| "2" %x30-34 DIGIT ; 200-249
| "25" %x30-35 ; 250-255
Definition at line 46 of file ip_address.h.
| te::common::uri::ip_address::ip_address | ( | ) |
| te::common::uri::ip_address::ip_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 38 of file ip_address.cpp.
References parse.
|
inline |
Test if null (all 0's).
Definition at line 54 of file ip_address.h.
| std::ostream & te::common::uri::ip_address::operator<< | ( | std::ostream & | os | ) | const |
Stream out.
Definition at line 48 of file ip_address.cpp.
References octets_, and SEPARATOR_CHAR.
Referenced by string().
| std::string te::common::uri::ip_address::string | ( | ) | const |
|
friend |
Parse IP address, returning whether found or not and advancing first and setting address if found.
Does not skip leading space.
Definition at line 51 of file ip_address.cpp.
Referenced by ip_address().
|
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.
|
private |
Definition at line 61 of file ip_address.h.
Referenced by ip_address(), operator<<(), and te::common::uri::parse().
|
static |
separator ('.')
Definition at line 57 of file ip_address.h.
Referenced by operator<<(), and te::common::uri::parse().