All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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.

Definition at line 31 of file fragment.cpp.

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

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

Definition at line 32 of file fragment.cpp.

References parse.

Member Function Documentation

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

Test if null/empty.

Definition at line 49 of file fragment.h.

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

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

Calculate encoded string.

Definition at line 39 of file fragment.cpp.

References te::common::uri::urisyn::encode(), te::common::uri::urisyn::FRAGMENT_TRAITS, and 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 '').

Definition at line 42 of file fragment.cpp.

Referenced by fragment().

Member Data Documentation

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

Definition at line 55 of file fragment.h.

Referenced by encoding(), and te::common::uri::parse().


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