URIQuery Class Reference

The query component of a URI. More...

#include <URI.hh>

Public Member Functions

 URIQuery ()
 Constructor. More...
 
 URIQuery (const std::string &_str)
 Construct a URIQuery object from a string. More...
 
 URIQuery (const URIQuery &_query)
 Copy constructor. More...
 
virtual ~URIQuery ()
 Destructor. More...
 
void Clear ()
 Remove all values of the query. More...
 
void Insert (const std::string &_key, const std::string &_value)
 Get this query with a new _key=_value pair added. More...
 
URIQueryoperator= (const URIQuery &_query)
 Equal operator. More...
 
bool operator== (const URIQuery &_query) const
 Return true if the two queries contain the same values. More...
 
bool Parse (const std::string &_string)
 Parse a string as URIQuery. More...
 
std::string Str (const std::string &_delim="&") const
 Get the query as a string. More...
 
bool Valid () const
 Check if this is a valid URI query. More...
 

Static Public Member Functions

static bool Valid (const std::string &_str)
 Check if a string is a valid URI query. More...
 

Detailed Description

The query component of a URI.

Constructor & Destructor Documentation

URIQuery ( )

Constructor.

URIQuery ( const std::string &  _str)
explicit

Construct a URIQuery object from a string.

Parameters
[in]_strA string.
URIQuery ( const URIQuery _query)

Copy constructor.

Parameters
[in]_queryAnother query component
virtual ~URIQuery ( )
virtual

Destructor.

Member Function Documentation

void Clear ( )

Remove all values of the query.

void Insert ( const std::string &  _key,
const std::string &  _value 
)

Get this query with a new _key=_value pair added.

Parameters
[in]_keyKey of the query.
[in]_valueValue of the query.
URIQuery& operator= ( const URIQuery _query)

Equal operator.

Parameters
[in]_queryanother URIQuery.
Returns
Itself.
bool operator== ( const URIQuery _query) const

Return true if the two queries contain the same values.

Parameters
[in]_queryA URI query to compare. return True if the queries match.
bool Parse ( const std::string &  _string)

Parse a string as URIQuery.

Parameters
[in]_strA string.
Returns
True if the string can be parsed as a URIQuery.
std::string Str ( const std::string &  _delim = "&") const

Get the query as a string.

Parameters
[in]_delimDelimiter used to separate each tuple of the query.
Returns
The query as a string, with each key,value pair separated by _delim.
static bool Valid ( const std::string &  _str)
static

Check if a string is a valid URI query.

Parameters
[in]_strThe string to check.
Returns
True if the string can be parsed as a URI query.
bool Valid ( ) const

Check if this is a valid URI query.

Returns
True if this can be parsed as a URI query.

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