summaryrefslogtreecommitdiff
path: root/project2/fileRows.cpp
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2011-02-01 21:13:39 +0000
committerrandomdan <randomdan@localhost>2011-02-01 21:13:39 +0000
commit417ff6847eac27b9892429173d2fa28abfe2d2a9 (patch)
tree026a2c3aac2748f089406f260b81499125da69ed /project2/fileRows.cpp
parentCall curl global cleanup when finished (diff)
downloadproject2-417ff6847eac27b9892429173d2fa28abfe2d2a9.tar.bz2
project2-417ff6847eac27b9892429173d2fa28abfe2d2a9.tar.xz
project2-417ff6847eac27b9892429173d2fa28abfe2d2a9.zip
Add lots of funky stuff to make the system (internally) type safe
Diffstat (limited to 'project2/fileRows.cpp')
-rw-r--r--project2/fileRows.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/project2/fileRows.cpp b/project2/fileRows.cpp
index 600ab7c..28de335 100644
--- a/project2/fileRows.cpp
+++ b/project2/fileRows.cpp
@@ -2,6 +2,7 @@
#include "rowProcessor.h"
#include "xmlObjectLoader.h"
#include "exceptions.h"
+#include "genericVisitor.h"
#include <boost/algorithm/string/predicate.hpp>
ElementLoaderImpl<FileRows> filerowsLoader("filerows");
@@ -117,10 +118,10 @@ FileRows::execute(const RowProcessor * rp) const
}
}
-const Glib::ustring &
+VariableType
FileRows::getCurrentValue(unsigned int col) const
{
- return *values[col];
+ return values[col];
}
bool
@@ -135,13 +136,13 @@ FileRows::isNull(const Glib::ustring & col) const
return false;
}
-const Glib::ustring &
+VariableType
FileRows::getCurrentValue(const Glib::ustring & id) const
{
Values::const_iterator v = values.begin();
for (Columns::const_iterator i = columns.begin(); i != columns.end(); i++, v++) {
if (*i == id) {
- return **v;
+ return *v;
}
}
throw RowSet::FieldDoesNotExist();
@@ -165,7 +166,7 @@ FileRows::addColumn(const Glib::ustring & rawtok) const
FileStarChannel
FileRows::doOpen() const
{
- FILE * f = fopen(path->c_str(), "r");
+ FILE * f = LexicalCall<const char *, FILE *>(boost::bind(&popen, _1, "r"), path());
if (!f) {
throw FileNotReadable();
}