X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=include%2Fhttp%2Fipagehandler.h;h=be707e5791ce47bbcc6cc678edc31de7cdf70a87;hb=b9c3763a932cebaa015a27fe111017f6f34dfbaa;hp=7624c4a4d811fee4447a32c3774a971a7e1562b5;hpb=d8ccfe2b3944adf07d35534459cdda19d15217c8;p=fms.git diff --git a/include/http/ipagehandler.h b/include/http/ipagehandler.h index 7624c4a..be707e5 100644 --- a/include/http/ipagehandler.h +++ b/include/http/ipagehandler.h @@ -1,13 +1,18 @@ #ifndef _ipagehandler_ #define _ipagehandler_ -#include +#include #include #include +#include +#include class IPageHandler { public: + IPageHandler() {} + IPageHandler(const std::string &templatestr) { m_template=templatestr; } + virtual ~IPageHandler() {} /** \brief Handles request for a page @@ -17,11 +22,18 @@ public: const bool Handle(shttpd_arg *arg); private: - void HandlePost(shttpd_arg *arg); - void HadleGet(shttpd_arg *arg); virtual const bool WillHandleURI(const std::string &uri)=0; virtual const std::string GeneratePage(const std::string &method, const std::map &queryvars)=0; +protected: + // converts from basename[#] query args into a vector where the vector pos is the index pos # + void CreateArgArray(const std::map &vars, const std::string &basename, std::vector &args); + + // replaces html control characters with elements (i.e. < becomes <) + const std::string SanitizeOutput(const std::string &input); + + std::string m_template; + }; #endif // _ipagehandler_