Samchon Framework for CPP  1.0.0
samchon::library::URLVariables Class Reference

URLVariables class is for representing variables of HTTP. More...

#include <URLVariables.hpp>

Collaboration diagram for samchon::library::URLVariables:

Public Member Functions

 URLVariables ()
 Default Constructor. More...
 
 URLVariables (const WeakString &flashVars)
 Constructor by a string representing encoded properties. More...
 
auto toString () const -> std::string
 Get the string representing URLVariables. More...
 
- Public Member Functions inherited from samchon::HashMap< std::string, std::string >
auto has (const std::string &key) const -> bool
 Whether have the item or not. More...
 
auto get (const std::string &key) -> std::string &
 Get element. More...
 
void set (const std::string &key, const std::string &val)
 Set element. More...
 
auto pop (const std::string &key) -> std::string
 Pop item. More...
 

Static Public Member Functions

static auto encode (const WeakString &wstr) -> std::string
 Encode a string into a valid URI. More...
 
static auto decode (const WeakString &wstr) -> std::string
 Decode a URI string. More...
 

Detailed Description

URLVariables class is for representing variables of HTTP.

URLVariables class allows you to transfer variables between an application and server. When transfering, URLVariables will be converted to a URI string.

  • URI: Uniform Resource Identifier

Use URLVariabels objects with methods of HTTPLoader class.

Class Diagram

Example code

Author
Jeongho Nam http://samchon.org

Definition at line 28 of file URLVariables.hpp.

Constructor & Destructor Documentation

samchon::library::URLVariables::URLVariables ( )
inline

Default Constructor.

Definition at line 41 of file URLVariables.hpp.

samchon::library::URLVariables::URLVariables ( const WeakString flashVars)
inline

Constructor by a string representing encoded properties.

Converts the variable string to properties of the specified URLVariables object.

Parameters
Auri-encoded string containing pair of properties

Definition at line 53 of file URLVariables.hpp.

References decode(), samchon::WeakString::find(), samchon::WeakString::split(), and samchon::WeakString::substr().

Here is the call graph for this function:

Member Function Documentation

static auto samchon::library::URLVariables::encode ( const WeakString wstr) -> std::string
inlinestatic

Encode a string into a valid URI.

Encodes a string to follow URI standard format.

Parameters
Astring to encode to URI
Returns
A string converted to URI

Definition at line 79 of file URLVariables.hpp.

Referenced by samchon::library::HTTPLoader::load(), and toString().

Here is the caller graph for this function:

static auto samchon::library::URLVariables::decode ( const WeakString wstr) -> std::string
inlinestatic

Decode a URI string.

Decodes a URI string to its original

Parameters
Astring encoded
Returns
A string decoded from URI

Definition at line 116 of file URLVariables.hpp.

Referenced by URLVariables().

Here is the caller graph for this function:

auto samchon::library::URLVariables::toString ( ) const -> std::string
inline

Get the string representing URLVariables.

Returns a string object representing URLVariables following the URI

  • URLVariables({{"id", "jhnam88"}, {"name", "Jeongho Nam <http://samchon.org>"}}).toString() => "id=jhnam88&name=Jeongho+Nam"
Returns
A string representing URLVariables following the URI

Definition at line 177 of file URLVariables.hpp.

References encode().

Here is the call graph for this function:


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