All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
te::common::uri::scheme Class Reference

URI scheme component. More...

#include <scheme.h>

Public Member Functions

bool empty () const
 Test if null/empty. More...
 
bool is_null () const
 Test if null/empty. More...
 
 scheme ()
 Construct null. More...
 
 scheme (const std::string &v)
 Construct from string. More...
 
const std::string & string () const
 Get string. More...
 

Private Attributes

std::string string_
 

Friends

bool TECOMMONEXPORT parse (std::string::const_iterator &first, std::string::const_iterator last, scheme &v, char *endc)
 Parse URI scheme, returning whether found or not and advancing first and setting scheme and end char if found. More...
 

Detailed Description

URI scheme component.

Syntax:

scheme = ALPHA *( ALPHA | DIGIT | "+" | "-" | "." )
See also
http://tools.ietf.org/html/rfc3986#section-3.1

Definition at line 40 of file scheme.h.

Constructor & Destructor Documentation

te::common::uri::scheme::scheme ( )

Construct null.

Definition at line 32 of file scheme.cpp.

Referenced by te::common::URL::setProtocol().

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

Construct from string.

This will convert to lower case and check for valid chars. Does not include the ":". Note that the string cannot be empty, it must contain chars that are valid for the scheme.

Exceptions
std::invalid_argumentif invalid

Definition at line 33 of file scheme.cpp.

References parse.

Member Function Documentation

bool te::common::uri::scheme::empty ( ) const
inline

Test if null/empty.

Definition at line 49 of file scheme.h.

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

Test if null/empty.

Definition at line 50 of file scheme.h.

Referenced by te::common::uri::uri::is_null(), and te::common::uri::uri::operator<<().

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

Get string.

Definition at line 51 of file scheme.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,
scheme v,
char *  endc 
)
friend

Parse URI scheme, returning whether found or not and advancing first and setting scheme and end char if found.

Does not skip leading space.

Definition at line 39 of file scheme.cpp.

Referenced by scheme().

Member Data Documentation

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

Definition at line 54 of file scheme.h.

Referenced by te::common::uri::parse().


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