summaryrefslogtreecommitdiff
path: root/project2/xmlPresenter.h
diff options
context:
space:
mode:
Diffstat (limited to 'project2/xmlPresenter.h')
-rw-r--r--project2/xmlPresenter.h32
1 files changed, 7 insertions, 25 deletions
diff --git a/project2/xmlPresenter.h b/project2/xmlPresenter.h
index cd63f1e..9b32c31 100644
--- a/project2/xmlPresenter.h
+++ b/project2/xmlPresenter.h
@@ -2,16 +2,17 @@
#define XMLPRESENTER_H
#include "presenter.h"
-#include "xmlScriptParser.h"
+#include "transform.h"
namespace xmlpp {
class Document;
}
-class XmlPresenter : public Presenter {
+class XmlPresenter : public ContentPresenter, public SourceOf<xmlpp::Document>, public SourceOf<xmlDoc> {
public:
typedef boost::shared_ptr<xmlpp::Document> XmlDocumentPtr;
- XmlPresenter();
+ XmlPresenter(const Glib::ustring & responseRootNodeName, const Glib::ustring & responseStyle, const Glib::ustring & contentType);
+ XmlPresenter(const xmlpp::Element * e);
~XmlPresenter();
void declareNamespace(const Glib::ustring & prefix, const Glib::ustring & ns) const;
@@ -21,34 +22,15 @@ class XmlPresenter : public Presenter {
void addText(const VariableType & value) const;
void popSub() const;
- virtual XmlDocumentPtr getDataDocument() const;
- virtual const Glib::ustring & getResponseRootNodeName() const = 0;
- virtual const Glib::ustring & getResponseStyle() const = 0;
+ operator const xmlpp::Document * () const;
+ operator const xmlDoc * () const;
private:
- void createDoc() const;
+ void createDoc(const Glib::ustring & responseRootNodeName, const Glib::ustring & responseStyle) const;
XmlDocumentPtr responseDoc;
mutable std::vector<xmlpp::Element *> nodeStack;
};
-class XmlProcessPresenter : public XmlPresenter {
- public:
- 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;
-
- const Glib::ustring responseRootNodeName;
- const Glib::ustring responseStyle;
- const Glib::ustring contentType;
-};
-
typedef boost::intrusive_ptr<XmlPresenter> XmlPresenterPtr;
#endif