Static Public Member Functions
Tonido::Util::HTTP Class Reference

Utility classes related to HTTP input/output. More...

List of all members.

Static Public Member Functions

static std::string getHTTPContentType (const std::string &a_fileName)
 Returns the type of the HTTP Content Type string, given a file name.
static void loadFile (Tonido::Data::Message::SharedPtr &a_message, const std::string &a_fileName)
 Loads a file from the file system into the given shared message.
static void loadRawData (Tonido::Data::Message::SharedPtr &a_message, const Data::RawData::SharedPtr &a_data, const std::string &a_contentType)
 Loads data from a given raw data into a message.
static void loadVfsFile (Tonido::Data::Message::SharedPtr &a_message, const std::string &a_vfsName, const std::string &a_fileName)
 Loads a file from the BootVFS into the given shared message.
static void loadVfsFile (Tonido::Data::RawData::SharedPtr &a_rawData, const std::string &a_vfsName, const std::string &a_fileName)
 Loads a file from the BootVFS into the given Raw Data.
static std::string getXMLResult (const std::string &a_type, bool a_result, const std::string &a_message="")
 Returns formatted XML commonly used for returning status of an HTTP operation.
static std::string getXMLResult (const std::string &a_type, int a_result, const std::string &a_message="")
 Returns formatted XML commonly used for returning status of an HTTP operation.
static bool parseXMLResult (const std::string &a_xml, std::string &a_type, bool &a_result, std::string &a_message)
 Parses XML result string and returns the returned status values.

Detailed Description

Utility classes related to HTTP input/output.


Member Function Documentation

std::string Tonido::Util::HTTP::getHTTPContentType ( const std::string &  a_fileName) [static]

Returns the type of the HTTP Content Type string, given a file name.

Parameters:
[in]a_fileNameinput file name
Returns:
HTTP content type
std::string Tonido::Util::HTTP::getXMLResult ( const std::string &  a_type,
bool  a_result,
const std::string &  a_message = "" 
) [static]

Returns formatted XML commonly used for returning status of an HTTP operation.

Parameters:
[in]a_typequery type
[in]a_resultquery result
[out]a_messageoptional error string or reason
Returns:
formatted XML
std::string Tonido::Util::HTTP::getXMLResult ( const std::string &  a_type,
int  a_result,
const std::string &  a_message = "" 
) [static]

Returns formatted XML commonly used for returning status of an HTTP operation.

Parameters:
[in]a_typequery type
[in]a_resultquery result
[out]a_messageoptional error string or reason
Returns:
formatted XML
void Tonido::Util::HTTP::loadFile ( Tonido::Data::Message::SharedPtr &  a_message,
const std::string &  a_fileName 
) [static]

Loads a file from the file system into the given shared message.

Parameters:
[in,out]a_messageTonido message
[in]a_fileNameinput file name
void Tonido::Util::HTTP::loadRawData ( Tonido::Data::Message::SharedPtr &  a_message,
const Data::RawData::SharedPtr &  a_data,
const std::string &  a_contentType 
) [static]

Loads data from a given raw data into a message.

Parameters:
[in,out]a_messageTonido message
[in]a_datainput buffer
[in]a_contentTypecontent type of the input buffer
void Tonido::Util::HTTP::loadVfsFile ( Tonido::Data::Message::SharedPtr &  a_message,
const std::string &  a_vfsName,
const std::string &  a_fileName 
) [static]

Loads a file from the BootVFS into the given shared message.

Parameters:
[in,out]a_messageTonido message
[in]a_vfsNamevfs name to use
[in]a_fileNameinput file name to load
void Tonido::Util::HTTP::loadVfsFile ( Tonido::Data::RawData::SharedPtr &  a_rawData,
const std::string &  a_vfsName,
const std::string &  a_fileName 
) [static]

Loads a file from the BootVFS into the given Raw Data.

Parameters:
[out]a_rawDataoutput data buffer
[in]a_vfsNamevfs name to use
[in]a_fileNameinput file name to load
bool Tonido::Util::HTTP::parseXMLResult ( const std::string &  a_xml,
std::string &  a_type,
bool &  a_result,
std::string &  a_message 
) [static]

Parses XML result string and returns the returned status values.

Parameters:
[in]a_xmlinput XML result string
[out]a_typequery type
[out]a_resultquery result
[out]a_messageoptional error string or reason
Returns:
true on successs, false otherwise

Generated on Wed Oct 12 2011 21:46:54. © CodeLathe LLC 2007-2011. All Rights Reserved.