Web framework C++  2.0.0
Simple web framework on c++ designed to easily create web pages, etc
Public Member Functions | List of all members
URI Class Reference

class represents http uri More...

#include <uri.h>

Collaboration diagram for URI:
Collaboration graph

Public Member Functions

 URI ()
 
 URI (std::string &uri)
 
bool getValueFromParam (const char *key, std::string &value)
 
void setParamsAndUri (std::string &uri)
 
std::string getPath ()
 
std::string getRawData ()
 
std::unordered_map< std::string, std::string > getParams ()
 

Detailed Description

class represents http uri

URI consist of uri - a string of uri without arguments, and map of key-value pairs which are deserialized parameters of uri

Constructor & Destructor Documentation

URI::URI ( )

Create empty URI object

URI::URI ( std::string &  uri)

Construct URI object from string, deserialize all params and decode input string

Parameters
urihttp uri string

Member Function Documentation

std::unordered_map<std::string, std::string> URI::getParams ( )

get deserialized and decoded map of http uri params

Returns
map of key-value pairs from uri params
std::string URI::getPath ( )

get decoded uri path without params

Returns
http uri string without params
std::string URI::getRawData ( )

get unchanged uri string with params

Returns
http uri string
bool URI::getValueFromParam ( const char *  key,
std::string &  value 
)

get value by key from uri

Parameters
keykey in params of http uri
valueout param, where will be written value if exists or do nothing otherwise
Returns
true if key exists in map, false otherwise
void URI::setParamsAndUri ( std::string &  uri)

deserialize and decode input http uri into path and params

Parameters
urihttp uri string

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