tnt::QueryParams Class Reference

Container for GET and POST parameters. More...

#include <tnt/query_params.h>

Inheritance diagram for tnt::QueryParams:
cxxtools::QueryParams

Public Member Functions

 QueryParams ()
 Create an empty QueryParams object.
 QueryParams (const QueryParams &src)
 QueryParams (const std::string &url)
QueryParamsoperator= (const QueryParams &src)
 ~QueryParams ()
ScopegetScope ()
const std::locale & locale () const
 Get the locale used for parsing floating-point numbers.
void locale (const std::locale &loc)
 Set the locale used for parsing floating-point numbers.
template<typename Type >
Type arg (const std::string &name, const Type &def=Type()) const
template<typename Type >
Type argt (const std::string &name, const char *typeName=0) const
template<typename Type >
Type argn (const std::string &name, size_type n, const Type &def=Type()) const
template<typename Type >
Type argnt (const std::string &name, size_type n, const char *typeName=0) const
template<typename Type >
Type argt (const std::string &name, size_type n, const char *typeName=0) const
template<typename Type >
Type arg (size_type n, const Type &def=Type()) const
template<typename Type >
Type argt (size_type n, const char *typeName=0) const
template<typename Type >
std::vector< Type > args (const std::string &name, const Type &def=Type()) const
template<typename Type >
std::vector< Type > argst (const std::string &name, const char *typeName) const
template<typename Type >
QueryParamsadd (const std::string &name, const Type &value)
QueryParamsadd (const std::string &name, const char *value)
QueryParamsadd (const cxxtools::QueryParams &q)
- Public Member Functions inherited from cxxtools::QueryParams
 QueryParams (const char *url)
void parse_url (const std::string &url)
 read parameters from url
void parse_url (const char *url)
 read parameters from url
void parse_url (std::istream &url_stream)
 read parameters from stream
const std::string & param (size_type n) const
 get unnamed parameter by number (no range-check!)
size_type paramcount () const
 get number of unnamed parameters
const std::string & operator[] (size_type n) const
 get unnamed parameter with operator[] (no range-check!)
QueryParamsadd (const std::string &value)
 add unnamed parameter
QueryParamsremove ()
 remove unnamed parameter
QueryParamsset (const std::string &value)
 set unnamed parameter
const std::string & param (const std::string &name, size_type n=0) const
 get nth named parameter.
std::string param (const std::string &name, size_type n, const std::string &def) const
 get nth named parameter with default value.
std::string param (const std::string &name, const std::string &def) const
 get named parameter or default value.
size_type paramcount (const std::string &name) const
 get number of parameters with the given name
std::string operator[] (const std::string &name) const
 get first named parameter with operator[]
bool has (const std::string &name) const
 checks if the named parameter exists
QueryParamsadd (const std::string &name, const std::string &value)
 add named parameter
QueryParamsremove (const std::string &name)
 remove named parameter
QueryParamsset (const std::string &name, const std::string &value)
 sets named parameter
template<typename output_iterator >
void getNames (output_iterator o) const
 returns all names of parameters
void clear ()
 removes all data
bool empty () const
 returns true, when no parameters exist (named and unnamed)
const_iterator begin () const
 get iterator to unnamed parameters
const_iterator begin (const std::string &name) const
 get iterator to named parameter
const_iterator end () const
 get end-iterator (named and unnamed)
std::string getUrl () const
 get parameters as url

Additional Inherited Members

- Public Types inherited from cxxtools::QueryParams
typedef std::vector< value_typevalues_type
typedef values_type::size_type size_type

Detailed Description

Container for GET and POST parameters.

Constructor & Destructor Documentation

tnt::QueryParams::QueryParams ( )
inline

Create an empty QueryParams object.

Reimplemented from cxxtools::QueryParams.

tnt::QueryParams::QueryParams ( const QueryParams src)
inline
tnt::QueryParams::QueryParams ( const std::string &  url)
inlineexplicit

Reimplemented from cxxtools::QueryParams.

tnt::QueryParams::~QueryParams ( )
inline

Member Function Documentation

template<typename Type >
QueryParams& tnt::QueryParams::add ( const std::string &  name,
const Type &  value 
)
inline
QueryParams& tnt::QueryParams::add ( const std::string &  name,
const char *  value 
)
inline
QueryParams& tnt::QueryParams::add ( const cxxtools::QueryParams q)
inline

Reimplemented from cxxtools::QueryParams.

template<typename Type >
Type tnt::QueryParams::arg ( const std::string &  name,
const Type &  def = Type() 
) const
inline
template<typename Type >
Type tnt::QueryParams::arg ( size_type  n,
const Type &  def = Type() 
) const
inline
template<typename Type >
Type tnt::QueryParams::argn ( const std::string &  name,
size_type  n,
const Type &  def = Type() 
) const
inline
template<typename Type >
Type tnt::QueryParams::argnt ( const std::string &  name,
size_type  n,
const char *  typeName = 0 
) const
inline
template<typename Type >
std::vector<Type> tnt::QueryParams::args ( const std::string &  name,
const Type &  def = Type() 
) const
inline
template<typename Type >
std::vector<Type> tnt::QueryParams::argst ( const std::string &  name,
const char *  typeName 
) const
inline
template<typename Type >
Type tnt::QueryParams::argt ( const std::string &  name,
const char *  typeName = 0 
) const
inline
template<typename Type >
Type tnt::QueryParams::argt ( const std::string &  name,
size_type  n,
const char *  typeName = 0 
) const
inline
template<typename Type >
Type tnt::QueryParams::argt ( size_type  n,
const char *  typeName = 0 
) const
inline
Scope& tnt::QueryParams::getScope ( )
inline
const std::locale& tnt::QueryParams::locale ( ) const
inline

Get the locale used for parsing floating-point numbers.

void tnt::QueryParams::locale ( const std::locale &  loc)
inline

Set the locale used for parsing floating-point numbers.

QueryParams& tnt::QueryParams::operator= ( const QueryParams src)
inline

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