URI syntax declarations. More...
Classes | |
struct | traits |
Traits used for parsing and encoding components. More... | |
Enumerations | |
enum | char_class_e { CINV = -2, CEND = -1, CVAL = 0, CVA2 = 1 } |
Char class. More... | |
Functions | |
void | convertPlus2Space (std::string &s) |
bool | decode (std::string &s) |
Decode the pct-encoded (hex) sequences, if any, return success. More... | |
std::string | encode (const traits &ts, const std::string &comp) |
Encode the URI (sub) component. More... | |
bool | parse (const traits &ts, std::string::const_iterator &first, std::string::const_iterator last, std::string &comp, char *endc=0) |
Parse the URI componet, returning whether successful and setting the string and end char and advancing if so. More... | |
Variables | |
const traits | AUTHORITY_TRAITS |
authority traits More... | |
const char | ENCODE_BEGIN_CHAR = '%' |
encode begin char ('%') More... | |
const traits | FRAGMENT_TRAITS |
fragment traits More... | |
const traits | PATH_TRAITS |
path traits More... | |
const traits | QUERY_TRAITS |
query traits More... | |
const traits | SCHEME_TRAITS |
scheme traits More... | |
URI syntax declarations.
void TECOMMONEXPORT te::common::uri::urisyn::convertPlus2Space | ( | std::string & | s | ) |
Definition at line 196 of file urisyn.cpp.
Referenced by decode().
bool TECOMMONEXPORT te::common::uri::urisyn::decode | ( | std::string & | s | ) |
Decode the pct-encoded (hex) sequences, if any, return success.
Does not change string on error.
Definition at line 171 of file urisyn.cpp.
References convertPlus2Space(), and te::common::uri::parse_hex().
Referenced by te::qt::af::ApplicationController::initialize(), te::common::uri::parse(), te::qt::plugins::layout::Plugin::startup(), te::qt::plugins::attributefill::Plugin::startup(), te::qt::plugins::addressgeocoding::Plugin::startup(), and te::qt::plugins::vp::Plugin::startup().
std::string TECOMMONEXPORT te::common::uri::urisyn::encode | ( | const traits & | ts, |
const std::string & | comp | ||
) |
Encode the URI (sub) component.
Note that this should be used on the subcomponents before appending to subdelimiter chars, if any.
From the RFC: URI producing applications should percent-encode data octets that correspond to characters in the reserved set unless these characters are specifically allowed by the URI scheme to represent data in that component. If a reserved character is found in a URI component and no delimiting role is known for that character, then it must be interpreted as representing the data octet corresponding to that character's encoding in US-ASCII.
Definition at line 157 of file urisyn.cpp.
References te::common::uri::append_hex(), te::common::uri::urisyn::traits::char_class, CVAL, and ENCODE_BEGIN_CHAR.
Referenced by te::common::uri::fragment::encoding(), te::common::uri::query::encoding(), te::common::uri::path::encoding(), te::qt::af::XMLFormatter::format(), te::qt::af::XMLFormatter::formatDataSourceInfos(), and te::common::URL::setFragmentString().
bool TECOMMONEXPORT te::common::uri::urisyn::parse | ( | const traits & | ts, |
std::string::const_iterator & | first, | ||
std::string::const_iterator | last, | ||
std::string & | comp, | ||
char * | endc = 0 |
||
) |
Parse the URI componet, returning whether successful and setting the string and end char and advancing if so.
This looks for end chars either returning the string up to, but not including, the end char or returning the string up to the first character that is not valid for the component. The arg first
is advanced after the end char if there is one. The arg endc
is set to either 0 if no end char found or to the end char. If the first char is an end char then true is returned and the string will be empty. Leading white space is not skipped.
The component is not decoded and should not be decoded until after futher parsing with the component's subdelimiters, if any.
Definition at line 136 of file urisyn.cpp.
References CEND, te::common::uri::urisyn::traits::char_class, CVA2, and CVAL.
Referenced by te::common::uri::parse().
const traits TECOMMONEXPORT te::common::uri::urisyn::AUTHORITY_TRAITS |
authority traits
Definition at line 52 of file urisyn.cpp.
Referenced by te::common::uri::uri::operator<<(), and te::common::uri::parse().
const char TECOMMONEXPORT te::common::uri::urisyn::ENCODE_BEGIN_CHAR = '%' |
const traits TECOMMONEXPORT te::common::uri::urisyn::FRAGMENT_TRAITS |
fragment traits
Definition at line 115 of file urisyn.cpp.
Referenced by te::common::uri::fragment::encoding(), te::common::uri::uri::operator<<(), te::common::uri::parse(), and te::common::URL::setFragmentString().
const traits TECOMMONEXPORT te::common::uri::urisyn::PATH_TRAITS |
path traits
Definition at line 73 of file urisyn.cpp.
Referenced by te::common::uri::path::encoding(), and te::common::uri::parse().
const traits TECOMMONEXPORT te::common::uri::urisyn::QUERY_TRAITS |
query traits
Definition at line 94 of file urisyn.cpp.
Referenced by te::common::uri::query::encoding(), te::common::uri::uri::operator<<(), and te::common::uri::parse().
const traits TECOMMONEXPORT te::common::uri::urisyn::SCHEME_TRAITS |
scheme traits
Definition at line 31 of file urisyn.cpp.
Referenced by te::common::uri::uri::operator<<(), and te::common::uri::parse().