diff options
Diffstat (limited to 'project2/xml/xpathRows.h')
-rw-r--r-- | project2/xml/xpathRows.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/project2/xml/xpathRows.h b/project2/xml/xpathRows.h new file mode 100644 index 0000000..4b9e008 --- /dev/null +++ b/project2/xml/xpathRows.h @@ -0,0 +1,64 @@ +#ifndef XPATHROWS_H +#define XPATHROWS_H + +#include <libxml++/nodes/element.h> +#include <libxml/tree.h> +#include <boost/intrusive_ptr.hpp> +#include <map> +#include "rowSet.h" +#include "variables.h" +#include "xmlDocumentCache.h" +#include "curlHelper.h" +#include "definedColumns.h" + +/// Project2 component to create a row set based on the contents of an XML resource and specific XPaths with its hierarchy +class XPathRows : public RowSet, XmlDocumentCache, VariableCurlHelper { + public: + XPathRows(const xmlpp::Element * p); + ~XPathRows(); + + void execute(const Glib::ustring &, const RowProcessor *) const; + virtual void loadComplete(const CommonObjects *); + + const bool html; + const bool warnings; + + private: + class FilterViewColumn : public Column { + public: + FilterViewColumn(unsigned int, const xmlpp::Element *); + static FilterViewColumn * make(unsigned int, const xmlpp::Element *); + const Variable path; + }; + class FilterView : public DefinedColumns, public virtual IntrusivePtrBase { + public: + typedef std::map<const Glib::ustring, Variable> XPaths; + + FilterView(const xmlpp::Element * p); + + const Glib::ustring name; + const Variable root; + }; + typedef boost::intrusive_ptr<FilterView> FilterViewPtr; + typedef boost::intrusive_ptr<const FilterView> FilterViewCPtr; + typedef std::map<const Glib::ustring, FilterViewPtr> FilterViews; + FilterViews fvs; + + virtual CurlPtr newCurl() const; + virtual bool asHtml() const; + virtual bool withWarnings() const; + + typedef std::map<const Glib::ustring, Glib::ustring> Namespaces; + Namespaces namespaces; + class XPathState : public RowState { + public: + XPathState(FilterViewCPtr); + const Columns & getColumns() const; + private: + const FilterViewCPtr fv; + }; + const Variable encoding; +}; + +#endif + |