10Duke Enterprise C++ Client
|
#include <URLBuilder.h>
Very simple URL-builder.
Only part of URL-construction implemented.
Public Member Functions | |
URLBuilder (std::shared_ptr< const tenduke::net::URLEncoder > urlEncoder) | |
Constructs new instance. | |
std::string | buildString () |
Builds to URL into a string. | |
URLBuilder & | baseURL (const std::string &url) |
Sets the base URL. | |
URLBuilder & | queryParameter (const std::string &name, const std::string &value="") |
Adds an encoded query parameter. | |
URLBuilder & | queryParameters (const std::map< std::string, std::string > &pParameters) |
Sets multiple query parameters. | |
URLBuilder & | queryParameterUnencoded (const std::string &name, const std::string &value="") |
Adds an unencoded query parameter. | |
std::string | pctEncode (const std::string &value) |
PCT-encodes given string. | |
|
explicit |
Constructs new instance.
urlEncoder | - |
xdnet::URLBuilder & tenduke::net::URLBuilder::baseURL | ( | const std::string & | url | ) |
std::string tenduke::net::URLBuilder::pctEncode | ( | const std::string & | value | ) |
PCT-encodes given string.
value | - |
xdnet::URLBuilder & tenduke::net::URLBuilder::queryParameter | ( | const std::string & | name, |
const std::string & | value = "" |
||
) |
Adds an encoded query parameter.
Both the name and value will be PCT-encoded.
name | name of the parameter |
value | value of the parameter. Optional. If not present, a parameter without value will be created. |
xdnet::URLBuilder & tenduke::net::URLBuilder::queryParameters | ( | const std::map< std::string, std::string > & | pParameters | ) |
Sets multiple query parameters.
Both the names and values of the parameters will be PCT-encoded.
pParameters | - |
xdnet::URLBuilder & tenduke::net::URLBuilder::queryParameterUnencoded | ( | const std::string & | name, |
const std::string & | value = "" |
||
) |
Adds an unencoded query parameter.
Neither name nor the value will be PCT-encoded.
name | name of the parameter |
value | value of the parameter. Optional. If not present, a parameter without value will be created. |