My Project
|
build a url string. More...
#include <HttpUtility.h>
Public Member Functions | |
const string & | ToString () |
get the final string. More... | |
void | SetBaseURL (const string &baseurl) |
the url without parameter part | |
const string & | GetBaseUrl () |
the url without parameter part | |
void | AppendParam (const string &name, const string &value) |
append a param name and value pair | |
void | InsertParam (int nIndex, const char *name, const char *value) |
insert a given url at the given index. More... | |
const char * | GetParam (const string &name) |
get param by it name. More... | |
bool | HasParams () |
return true if it has at least one parameter. More... | |
build a url string.
It keeps the name value paire structure internally.
const char * ParaEngine::CUrlBuilder::GetParam | ( | const string & | name | ) |
get param by it name.
return NULL if not found.
bool ParaEngine::CUrlBuilder::HasParams | ( | ) |
return true if it has at least one parameter.
void ParaEngine::CUrlBuilder::InsertParam | ( | int | nIndex, |
const char * | name, | ||
const char * | value | ||
) |
insert a given url at the given index.
it will replace the one if there already one at the index. one can insert at nIndex in any order, and the function ensures that the output params are ordered from low to high.
name | if NULL, it will not update the name portion. |
value | if NULL, it will not update the name portion. |
const string & ParaEngine::CUrlBuilder::ToString | ( | ) |
get the final string.
this can be called multiple times efficiently. it caches the result internally. It ensures that name and value are converted using URLEncode