diff options
Diffstat (limited to 'project2/files/fileRows.cpp')
-rw-r--r-- | project2/files/fileRows.cpp | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/project2/files/fileRows.cpp b/project2/files/fileRows.cpp deleted file mode 100644 index bb0c059..0000000 --- a/project2/files/fileRows.cpp +++ /dev/null @@ -1,50 +0,0 @@ -#include <pch.hpp> -#include "fileRows.h" -#include "logger.h" -#include "scopeObject.h" -#include "rowProcessor.h" -#include "scriptLoader.h" -#include "exceptions.h" -#include <boost/algorithm/string/predicate.hpp> - -DECLARE_LOADER("filerows", FileRows); - -FileRows::FileRows(ScriptNodePtr p) : - StreamRows(p), - path(p, "path") -{ -} - -FileRows::~FileRows() -{ -} - -void -FileRows::setFilter(const Glib::ustring &) -{ - throw NotSupported(__PRETTY_FUNCTION__); -} - -void -FileRows::execute(const Glib::ustring &, const RowProcessor * rp) const -{ - Glib::RefPtr<Glib::IOChannel> c(doOpen()); - ScopeObject so(boost::bind(&FileRows::doClose, this, c)); - c->set_encoding(encoding); - gunichar ch; - ParseState ps(this, rp); - while (c->read(ch) == Glib::IO_STATUS_NORMAL) { - this->pushChar(ch, ps); - } -} - -Glib::RefPtr<Glib::IOChannel> -FileRows::doOpen() const -{ - return Glib::IOChannel::create_from_file(path(), "r"); -} - -void -FileRows::doClose(Glib::RefPtr<Glib::IOChannel> c) const { - c->close(); -} |