summaryrefslogtreecommitdiff
path: root/project2/xml/xmlRows.h
diff options
context:
space:
mode:
Diffstat (limited to 'project2/xml/xmlRows.h')
-rw-r--r--project2/xml/xmlRows.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/project2/xml/xmlRows.h b/project2/xml/xmlRows.h
new file mode 100644
index 0000000..3ab889e
--- /dev/null
+++ b/project2/xml/xmlRows.h
@@ -0,0 +1,41 @@
+#ifndef XMLROWS_H
+#define XMLROWS_H
+
+#include <libxml++/nodes/element.h>
+#include <boost/intrusive_ptr.hpp>
+#include <map>
+#include "rowSet.h"
+
+/// Project2 component to create a row set based on the contents of an XML file
+class XmlRows : public RowSet {
+ public:
+ typedef std::vector<std::string> Path;
+ typedef std::map<Path, unsigned int> Interests;
+
+ XmlRows(const xmlpp::Element * p);
+ ~XmlRows();
+
+ void execute(const Glib::ustring &, const RowProcessor *) const;
+ virtual void loadComplete(const CommonObjects *);
+
+ const Glib::ustring recordRoot;
+ const Glib::ustring recordTrigger;
+ const std::string filename;
+
+ private:
+ class XmlState : public RowState {
+ public:
+ XmlState(const XmlRows *);
+ const Columns & getColumns() const;
+ const XmlRows * rs;
+ };
+
+ Path root;
+ Path trigger;
+ Interests fields;
+ bool anyInterestingAttributes;
+ Columns fieldNames;
+};
+
+#endif
+