Main Page | Namespace List | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals

NWWWCodec.h

Go to the documentation of this file.
00001 00024 #ifndef MNST_H_NWWWCodec 00025 #define MNST_H_NWWWCodec 00026 #include <MonsterworksCopyright.h> 00027 00028 #include <string> 00029 #include <exception> 00030 #include <map> 00031 #include <set> 00032 00033 namespace monsterworks { 00034 namespace cgi { 00035 00037 typedef std::multimap<std::string,std::string> FormPairs; 00039 typedef std::set<std::string> QueryWords; 00040 00042 namespace NWWWCodec 00043 { 00045 class XInvalidString : public std::exception 00046 { 00047 public: 00048 XInvalidString(const std::string& inString) : myString(inString) {}; 00049 virtual ~XInvalidString() throw () {}; 00050 virtual const char* what() { return "String not in proper www-url-encoded form."; } 00051 std::string String() { return myString; }; 00052 private: 00053 std::string myString; 00054 }; 00055 00057 std::string ToWWW( const std::string& inPlainText); 00058 00060 std::string FromWWW( const std::string& inCypherText); 00061 00063 std::string EscapeHTML( const std::string& inPlainText); 00064 00066 monsterworks::cgi::FormPairs StringToPairs(const std::string& inEncodedString); 00067 00069 monsterworks::cgi::QueryWords StringToWords(const std::string& inEncodedString); 00070 }; 00071 00072 } 00073 } 00074 #endif // ifndef MNST_H_NWWWCodec

monsterworks Code by Monsterworks. Made available under the GNU Public License.
Documentation by doxygen.