summaryrefslogtreecommitdiff
path: root/project2/files/streamRows.h
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2011-08-31 21:48:04 +0000
committerrandomdan <randomdan@localhost>2011-08-31 21:48:04 +0000
commit05b8bed896e5fe8c1841869e5d6e8e837e72c10a (patch)
tree77abf662b898321a61058fb0a0da603e336bcad9 /project2/files/streamRows.h
parentAdds RDBMS table caching solution (diff)
downloadproject2-05b8bed896e5fe8c1841869e5d6e8e837e72c10a.tar.bz2
project2-05b8bed896e5fe8c1841869e5d6e8e837e72c10a.tar.xz
project2-05b8bed896e5fe8c1841869e5d6e8e837e72c10a.zip
The big reshuffle
Diffstat (limited to 'project2/files/streamRows.h')
-rw-r--r--project2/files/streamRows.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/project2/files/streamRows.h b/project2/files/streamRows.h
new file mode 100644
index 0000000..2d10116
--- /dev/null
+++ b/project2/files/streamRows.h
@@ -0,0 +1,46 @@
+#ifndef STREAMROWS_H
+#define STREAMROWS_H
+
+#include "variables.h"
+#include "definedColumns.h"
+
+class RowProcessor;
+
+/// Base class for Project2 components that create a row set based on the contents of a byte stream
+class StreamRows : public DefinedColumns, public RowSet {
+ public:
+ StreamRows(const xmlpp::Element * p);
+ ~StreamRows();
+
+ protected:
+ class ParseState : public ColumnValues {
+ public:
+ ParseState(const StreamRows *, const RowProcessor *);
+ ~ParseState();
+
+ const StreamRows * sr;
+ const RowProcessor * rp;
+ size_t skipheader;
+ bool inQuotes;
+ bool prevWasQuote;
+ Glib::ustring tok;
+ FieldValues::iterator curCol;
+
+ friend class StreamRows;
+ };
+ void pushChar(gunichar ch, ParseState &) const;
+ void end(ParseState &) const;
+
+ public:
+ const gunichar fieldSep;
+ const gunichar quoteChar;
+ const bool keepBlankRows;
+ const bool countBlankRows;
+ const Glib::ustring newline;
+ const Glib::ustring newlin;
+ const std::string encoding;
+ const size_t skipheader;
+};
+
+#endif
+