version 0.1.7
[fms.git] / include / http / ipagehandler.h
index 7624c4a..313aa56 100644 (file)
@@ -1,13 +1,18 @@
 #ifndef _ipagehandler_\r
 #define _ipagehandler_\r
 \r
-#include <shttpd.h>\r
+#include <cstdlib>\r
 #include <string>\r
 #include <map>\r
+#include <vector>\r
+#include <shttpd.h>\r
 \r
 class IPageHandler\r
 {\r
 public:\r
+       IPageHandler()  {}\r
+       IPageHandler(const std::string &templatestr)    { m_template=templatestr; }\r
+       virtual ~IPageHandler() {}\r
 \r
        /**\r
                \brief Handles request for a page\r
@@ -22,6 +27,12 @@ private:
        virtual const bool WillHandleURI(const std::string &uri)=0;\r
        virtual const std::string GeneratePage(const std::string &method, const std::map<std::string,std::string> &queryvars)=0;\r
        \r
+protected:\r
+       // converts from basename[#] query args into a vector where the vector pos is the index pos #\r
+       void CreateArgArray(const std::map<std::string,std::string> &vars, const std::string &basename, std::vector<std::string> &args);\r
+\r
+       std::string m_template;\r
+\r
 };\r
 \r
 #endif // _ipagehandler_\r