te::common::uri::fragment Class Reference

URI fragment component. More...

#include <fragment.h>

Public Member Functions

bool empty () const
 Test if null/empty. More...
 
std::string encoding () const
 Calculate encoded string. More...
 
 fragment ()
 Construct. More...
 
 fragment (const std::string &v)
 Construct from encoded string. More...
 
bool is_null () const
 Test if null/empty. More...
 
const std::string & string () const
 Get decoded string. More...
 

Private Attributes

std::string string_
 

Friends

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

Detailed Description

URI fragment component.

Syntax (see uri_path for additional definitions): String is pct-decoded after parsing.

fragment = *( pchar | "/" | "?" )
See also
http://tools.ietf.org/html/rfc3986#section-3.5

Definition at line 41 of file fragment.h.

Constructor & Destructor Documentation

te::common::uri::fragment::fragment ( )

Construct.

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

Construct from encoded string.

Note that this should not contain the leading '#'. See parse() for less strict construction.

Exceptions
std::invalid_argumentif invalid encoding

Member Function Documentation

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

Test if null/empty.

Definition at line 49 of file fragment.h.

std::string te::common::uri::fragment::encoding ( ) const

Calculate encoded string.

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

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

Test if null/empty.

Definition at line 50 of file fragment.h.

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

Get decoded string.

Definition at line 51 of file fragment.h.

Friends And Related Function Documentation

bool TECOMMONEXPORT parse ( std::string::const_iterator &  first,
std::string::const_iterator  last,
fragment v,
std::string *  errs 
)
friend

Parse URI fragment, returning whether found or not and advancing first and setting fragment if found.

Does not skip leading space.

If errs is specified the following take place:

  • Errors in decoding the string do not cause an immediate false return and and error message is reported in the error string errs. The string is used without decoding (i.e. assumes an unencoded '').

Member Data Documentation

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

Definition at line 55 of file fragment.h.


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