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

NForm.h

Go to the documentation of this file.
00001 00023 #ifndef MNST_H_NForm 00024 #define MNST_H_NForm 00025 #include <MonsterworksCopyright.h> 00026 00027 #include <NWWWCodec.h> 00028 00029 #include <string> 00030 #include <exception> 00031 00032 namespace monsterworks { 00033 namespace cgi { 00034 00036 namespace NForm 00037 { 00038 00040 enum EDataSources { 00041 EDataSource_StdInput, 00042 EDataSource_Query 00043 }; 00044 00046 class XMissingValue : public std::exception 00047 { 00048 public: 00049 XMissingValue(const std::string& inName) : myName(inName) {}; 00050 virtual ~XMissingValue() throw () {}; 00051 virtual const char* what() { return myName.c_str(); }; 00052 std::string Name() { return myName; }; 00053 private: 00054 std::string myName; 00055 }; 00056 00058 class XMalformedValue : public std::exception 00059 { 00060 public: 00061 XMalformedValue(const std::string& inName, const std::string& inValue) : myName(inName), myValue(inValue) {}; 00062 virtual ~XMalformedValue() throw() {}; 00063 virtual const char* what() { return myName.c_str(); }; 00064 std::string Name() { return myName; }; 00065 std::string Value() { return myValue; }; 00066 private: 00067 std::string myName; 00068 std::string myValue; 00069 }; 00070 00072 std::string GetString( const std::string& inName, EDataSources inSource = EDataSource_StdInput); 00073 00075 int GetInt( const std::string& inName, EDataSources inSource = EDataSource_StdInput); 00076 00078 const std::string& GetPostData(); 00079 00081 const monsterworks::cgi::FormPairs& GetFormPairs(); 00082 00084 const monsterworks::cgi::QueryWords& GetQueryWords(); 00085 00087 const monsterworks::cgi::FormPairs& GetQueryPairs(); 00088 }; 00089 00090 } 00091 } 00092 00093 #endif //ifndef MNST_H_NForm

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