summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2011-02-18 12:51:53 +0000
committerrandomdan <randomdan@localhost>2011-02-18 12:51:53 +0000
commit050ccbd481e1c3d4f671995f8b501326784acc2c (patch)
tree5000a9b1b14d5a1c69c3976601892388c5cb6f85
parentDon't require the (probably repeated) inclusion of datasource definitions, ha... (diff)
downloadproject2-050ccbd481e1c3d4f671995f8b501326784acc2c.tar.bz2
project2-050ccbd481e1c3d4f671995f8b501326784acc2c.tar.xz
project2-050ccbd481e1c3d4f671995f8b501326784acc2c.zip
Don't convert everything to a string to print it, use boost apply_visitor and do it properly
-rw-r--r--project2/console/consoleAppEngine.cpp6
-rw-r--r--project2/sqlRows.cpp3
2 files changed, 4 insertions, 5 deletions
diff --git a/project2/console/consoleAppEngine.cpp b/project2/console/consoleAppEngine.cpp
index 3c99f74..c0eac5e 100644
--- a/project2/console/consoleAppEngine.cpp
+++ b/project2/console/consoleAppEngine.cpp
@@ -139,7 +139,7 @@ ConsoleApplicationEngine::addAttr(const Glib::ustring & name, const Glib::ustrin
fprintf(stdout, "%s::", ns.c_str());
}
fprintf(stdout, "@%s = ", name.c_str());
- out(value);
+ boost::apply_visitor(out, value);
fprintf(stdout, "\n");
}
@@ -151,7 +151,7 @@ ConsoleApplicationEngine::addField(const Glib::ustring & name, const Glib::ustri
fprintf(stdout, "%s::", ns.c_str());
}
fprintf(stdout, "%s = ", name.c_str());
- out(value);
+ boost::apply_visitor(out, value);
fprintf(stdout, "\n");
}
@@ -159,7 +159,7 @@ void
ConsoleApplicationEngine::setText(const VariableType & value) const
{
fprintf(stdout, "%*s<local> = ", indent, "");
- out(value);
+ boost::apply_visitor(out, value);
fprintf(stdout, "\n");
}
diff --git a/project2/sqlRows.cpp b/project2/sqlRows.cpp
index d33a09f..22dafa9 100644
--- a/project2/sqlRows.cpp
+++ b/project2/sqlRows.cpp
@@ -57,8 +57,7 @@ class HandleAsVariableType : public DB::HandleField {
void floatingpoint(double d) {
variable = d;
}
- void timestamp(const struct tm & t)
- {
+ void timestamp(const struct tm & t) {
variable = boost::shared_ptr<boost::posix_time::ptime>(new boost::posix_time::ptime(boost::posix_time::ptime_from_tm(t)));
}
VariableType variable;