My Project
Classes | Public Member Functions | List of all members
ParaEngine::CUrlBuilder Class Reference

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...
 

Detailed Description

build a url string.

It keeps the name value paire structure internally.

Member Function Documentation

§ GetParam()

const char * ParaEngine::CUrlBuilder::GetParam ( const string &  name)

get param by it name.

return NULL if not found.

§ HasParams()

bool ParaEngine::CUrlBuilder::HasParams ( )

return true if it has at least one parameter.

§ InsertParam()

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.

Parameters
nameif NULL, it will not update the name portion.
valueif NULL, it will not update the name portion.

§ ToString()

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


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