uripp::ipv6_address Class Reference

List of all members.

Detailed Description

IP v6 address.

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
 
See also:
http://tools.ietf.org/html/rfc3986#section-3.2.2


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)


Constructor & Destructor Documentation

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.

Exceptions:
std::invalid_argument if invalid


Member Function Documentation

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.

See also:
string()


Friends And Related Function Documentation

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.


Generated on Wed May 13 09:06:22 2009 for uripp by  doxygen 1.4.7