te::common::uri::domain_name Class Reference

Domain name. More...

#include <domain_name.h>

Public Member Functions

 domain_name ()
 Construct null. More...
 
 domain_name (const std::string &v)
 Construct from string. More...
 
bool is_null () const
 Test if null. More...
 
domain_name operator+ (const domain_name &rhs) const
 Append domain name and return result. More...
 
domain_nameoperator+= (const domain_name &rhs)
 Append domain name to this and return this. More...
 
const std::string & string () const
 Get string. More...
 

Static Public Attributes

static const char char_class [256]
 char class More...
 
static const char SEPARATOR_CHAR
 separator ('.') More...
 

Private Attributes

std::string string_
 

Friends

bool TECOMMONEXPORT parse (std::string::const_iterator &first, std::string::const_iterator last, domain_name &v)
 Parse domain name, returning whether found or not and advancing first and setting name if found. More...
 

Detailed Description

Domain name.

Syntax: "Labels" separated by '.'. Labels must start and end with a (ASCII) letter or digit, and have as interior characters only letters, digits, and hyphen. Not case sensitive, but canonical form is lower case.

See also
http://tools.ietf.org/html/rfc1034#section-3.5

Definition at line 40 of file domain_name.h.

Constructor & Destructor Documentation

te::common::uri::domain_name::domain_name ( )

Construct null.

te::common::uri::domain_name::domain_name ( const std::string &  v)

Construct from string.

This will convert to lower case and check for valid chars. Note that the string cannot be empty, it must contain valid chars.

Exceptions
std::invalid_argumentif invalid

Member Function Documentation

bool te::common::uri::domain_name::is_null ( ) const
inline

Test if null.

Definition at line 48 of file domain_name.h.

domain_name te::common::uri::domain_name::operator+ ( const domain_name rhs) const
inline

Append domain name and return result.

Definition at line 51 of file domain_name.h.

domain_name& te::common::uri::domain_name::operator+= ( const domain_name rhs)

Append domain name to this and return this.

const std::string& te::common::uri::domain_name::string ( ) const
inline

Get string.

Definition at line 49 of file domain_name.h.

Referenced by te::common::uri::operator<<().

Friends And Related Function Documentation

bool TECOMMONEXPORT parse ( std::string::const_iterator &  first,
std::string::const_iterator  last,
domain_name v 
)
friend

Parse domain name, returning whether found or not and advancing first and setting name if found.

Does not skip leading space.

Member Data Documentation

const char te::common::uri::domain_name::char_class[256]
static

char class

Definition at line 58 of file domain_name.h.

const char te::common::uri::domain_name::SEPARATOR_CHAR
static

separator ('.')

Definition at line 57 of file domain_name.h.

std::string te::common::uri::domain_name::string_
private

Definition at line 61 of file domain_name.h.


The documentation for this class was generated from the following file: