ZenLib
|
00001 /* Copyright (c) MediaArea.net SARL. All Rights Reserved. 00002 * 00003 * Use of this source code is governed by a zlib-style license that can 00004 * be found in the License.txt file in the root of the source tree. 00005 */ 00006 00007 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00008 // 00009 // HTTP utils 00010 // 00011 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00012 00013 //--------------------------------------------------------------------------- 00014 #ifndef ZenLib_Server_Http_UtilsH 00015 #define ZenLib_Server_Http_UtilsH 00016 //--------------------------------------------------------------------------- 00017 00018 //--------------------------------------------------------------------------- 00019 #include <string> 00020 #include <ctime> 00021 #include <map> 00022 #include <vector> 00023 //--------------------------------------------------------------------------- 00024 00025 namespace ZenLib 00026 { 00027 00028 namespace Format 00029 { 00030 00031 namespace Http 00032 { 00033 00034 //*************************************************************************** 00035 // 00036 //*************************************************************************** 00037 00038 //--------------------------------------------------------------------------- 00039 // Character manipulation 00040 unsigned char Char2Hex (unsigned char Char); 00041 wchar_t Char2Hex (wchar_t Char); 00042 std::string Hex2Char (unsigned char Char); 00043 #ifndef WSTRING_MISSING 00044 std::wstring Hex2Char (wchar_t Char); 00045 #endif //WSTRING_MISSING 00046 00047 //--------------------------------------------------------------------------- 00048 // URL manipulation 00049 std::string URL_Encoded_Encode (const std::string& URL); 00050 #ifndef WSTRING_MISSING 00051 std::wstring URL_Encoded_Encode (const std::wstring& URL); 00052 #endif //WSTRING_MISSING 00053 std::string URL_Encoded_Decode (const std::string& URL); 00054 #ifndef WSTRING_MISSING 00055 std::wstring URL_Encoded_Decode (const std::wstring& URL); 00056 #endif //WSTRING_MISSING 00057 00058 //--------------------------------------------------------------------------- 00059 // Cleanup 00060 void TrimLeft (std::string& String, char ToTrim); 00061 00062 } //Namespace 00063 00064 } //Namespace 00065 00066 } //Namespace 00067 00068 #endif //ZENLIB_SERVER_HTTP_UTILS