diff options
Diffstat (limited to 'project2/xmlPresenter.h')
-rw-r--r-- | project2/xmlPresenter.h | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/project2/xmlPresenter.h b/project2/xmlPresenter.h index effa713..8ced38f 100644 --- a/project2/xmlPresenter.h +++ b/project2/xmlPresenter.h @@ -2,11 +2,16 @@ #define XMLPRESENTER_H #include "presenter.h" +#include "xmlScriptParser.h" + +namespace xmlpp { + class Document; +} class XmlPresenter : public Presenter { public: typedef boost::shared_ptr<xmlpp::Document> XmlDocumentPtr; - XmlPresenter(const std::string & group, const std::string & file); + XmlPresenter(); ~XmlPresenter(); void pushSub(const Glib::ustring & name, const Glib::ustring & ns) const; @@ -15,22 +20,33 @@ class XmlPresenter : public Presenter { void popSub() const; virtual XmlDocumentPtr getDataDocument() const; + virtual const Glib::ustring & getResponseRootNodeName() const = 0; + virtual const Glib::ustring & getResponseStyle() const = 0; protected: - xmlpp::DomParser present; + void initDoc(); + XmlDocumentPtr responseDoc; + + private: + mutable std::vector<xmlpp::Element *> nodeStack; +}; +class XmlProcessPresenter : public XmlPresenter { public: - const Glib::ustring responseRootNodeName; - const Glib::ustring responseStyle; - const Glib::ustring contentType; + XmlProcessPresenter(const std::string & group, const std::string & file, bool isInclusion); + ~XmlProcessPresenter(); protected: + const Glib::ustring & getResponseRootNodeName() const; + const Glib::ustring & getResponseStyle() const; + + XmlScriptParser present; typedef Storage<ParamChecker>::Objects ParamCheckers; ParamCheckers parameterChecks; - private: - XmlDocumentPtr responseDoc; - mutable std::vector<xmlpp::Element *> nodeStack; + const Glib::ustring responseRootNodeName; + const Glib::ustring responseStyle; + const Glib::ustring contentType; }; typedef boost::intrusive_ptr<XmlPresenter> XmlPresenterPtr; |