summaryrefslogtreecommitdiff
path: root/project2/fileRows.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'project2/fileRows.cpp')
-rw-r--r--project2/fileRows.cpp27
1 files changed, 15 insertions, 12 deletions
diff --git a/project2/fileRows.cpp b/project2/fileRows.cpp
index f28c96d..2f4d6cf 100644
--- a/project2/fileRows.cpp
+++ b/project2/fileRows.cpp
@@ -1,10 +1,12 @@
#include "fileRows.h"
-#include <stdexcept>
+#include "xmlObjectLoader.h"
+#include "exceptions.h"
-ElementLoaderImpl<_FileIterate> fileiterateLoader("fileiterate");
-ElementLoaderImpl<_FileView> fileviewLoader("fileview");
+ElementLoaderImpl<_FileRows> filerowsLoader("filerows");
_FileRows::_FileRows(const xmlpp::Element * p) :
+ _SourceObject(p),
+ PerRowValues(p),
path(p->get_attribute_value("path")),
fieldSep(p->get_attribute_value("fieldSep")[0]),
quoteChar(p->get_attribute_value("quoteChar")[0]),
@@ -24,10 +26,16 @@ _FileRows::~_FileRows()
}
void
-_FileRows::loadComplete()
+_FileRows::loadComplete(const CommonObjects *)
{
}
+void
+_FileRows::setFilter(const Glib::ustring &)
+{
+ throw NotSupported(__PRETTY_FUNCTION__);
+}
+
unsigned int
_FileRows::columnCount() const
{
@@ -41,7 +49,7 @@ _FileRows::getColumnName(unsigned int col) const
}
void
-_FileRows::execute() const
+_FileRows::execute(const RowProcessor * rp) const
{
FileStarChannel c(doOpen());
c.set_encoding(encoding);
@@ -96,7 +104,7 @@ _FileRows::execute() const
values.push_back(ValPtr(new Glib::ustring()));
curCol++;
}
- rowReady();
+ rp->rowReady();
}
values.clear();
}
@@ -146,13 +154,8 @@ _FileRows::doOpen() const
{
FILE * f = fopen(path->c_str(), "r");
if (!f) {
- throw std::runtime_error("Could not open file");
+ throw FileNotReadable();
}
return FileStarChannel(f, true, fclose);
}
-#include "view.hpp"
-template class _GenericView<_FileRows>;
-#include "iterate.hpp"
-template class _GenericIterate<_FileRows>;
-