GCS  0.2.3
Data Structures | Public Types | Public Member Functions
gu::URI Class Reference

Utility class to parse URIs. More...

#include <gu_uri.hpp>

Data Structures

class  Authority
 

Public Types

typedef std::vector< AuthorityAuthorityList
 

Public Member Functions

 URI (const std::string &, bool strict=true)
 Construct URI from string. More...
 
const std::string & to_string () const
 Get URI string. More...
 
const std::string & get_scheme () const
 Get URI scheme. More...
 
std::string get_authority () const
 Get URI authority component. More...
 
const std::string & get_user () const
 Get "user" part of the first entry in authority list. More...
 
const std::string & get_host () const
 Get "host" part of the first entry in authority list. More...
 
const std::string & get_port () const
 Get "port" part of the first entry in authority list. More...
 
const AuthorityList & get_authority_list () const
 Get authority list. More...
 
const std::string & get_path () const
 Get URI path. More...
 
const std::string & get_fragment () const
 Get URI path. More...
 
void set_query_param (const std::string &, const std::string &, bool override)
 Add query param to URI.
 
void set_option (const std::string &key, const std::string &val)
 
void append_option (const std::string &key, const std::string &val)
 
const URIQueryListget_query_list () const
 Get URI query list.
 
const std::string & get_option (const std::string &) const
 return opton by name, More...
 
const std::string & get_option (const std::string &opt, const std::string &def) const
 

Detailed Description

Utility class to parse URIs.

Constructor & Destructor Documentation

gu::URI::URI ( const std::string &  ,
bool  strict = true 
)

Construct URI from string.

Parameters
strictif true, throw exception when scheme is not found, else use a default one
Exceptions
std::invalid_argumentif URI is not valid
std::logic_errorin case of internal error
NotSet

Member Function Documentation

std::string gu::URI::get_authority ( ) const

Get URI authority component.

Returns
URI authority substring
Exceptions
NotSet
const AuthorityList& gu::URI::get_authority_list ( ) const
inline

Get authority list.

Returns
Authority list
const std::string& gu::URI::get_fragment ( ) const
inline

Get URI path.

Returns
URI path
Exceptions
NotSet
const std::string& gu::URI::get_host ( ) const
inline

Get "host" part of the first entry in authority list.

Returns
Host substring
Exceptions
NotSet
const std::string& gu::URI::get_option ( const std::string &  ) const

return opton by name,

Exceptions
NotFound
const std::string& gu::URI::get_path ( ) const
inline

Get URI path.

Returns
URI path (always set)
const std::string& gu::URI::get_port ( ) const
inline

Get "port" part of the first entry in authority list.

Returns
Port substring
Exceptions
NotSet
const std::string& gu::URI::get_scheme ( ) const
inline

Get URI scheme.

Returns
URI scheme (always set)
Exceptions
NotSet
const std::string& gu::URI::get_user ( ) const
inline

Get "user" part of the first entry in authority list.

Returns
User substring
Exceptions
NotSet
const std::string& gu::URI::to_string ( ) const
inline

Get URI string.

Returns
URI string

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