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 std::wstring Hex2Char (wchar_t Char); 00044 00045 //--------------------------------------------------------------------------- 00046 // URL manipulation 00047 std::string URL_Encoded_Encode (const std::string& URL); 00048 std::wstring URL_Encoded_Encode (const std::wstring& URL); 00049 std::string URL_Encoded_Decode (const std::string& URL); 00050 std::wstring URL_Encoded_Decode (const std::wstring& URL); 00051 00052 //--------------------------------------------------------------------------- 00053 // Cleanup 00054 void TrimLeft (std::string& String, char ToTrim); 00055 00056 } //Namespace 00057 00058 } //Namespace 00059 00060 } //Namespace 00061 00062 #endif //ZENLIB_SERVER_HTTP_UTILS