diff options
author | randomdan <randomdan@localhost> | 2011-02-18 12:51:53 +0000 |
---|---|---|
committer | randomdan <randomdan@localhost> | 2011-02-18 12:51:53 +0000 |
commit | 35df326d74c411fcd59d4617d89d5d7fe5efbde2 (patch) | |
tree | 5000a9b1b14d5a1c69c3976601892388c5cb6f85 | |
parent | Don't require the (probably repeated) inclusion of datasource definitions, ha... (diff) | |
download | project2-35df326d74c411fcd59d4617d89d5d7fe5efbde2.tar.bz2 project2-35df326d74c411fcd59d4617d89d5d7fe5efbde2.tar.xz project2-35df326d74c411fcd59d4617d89d5d7fe5efbde2.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.cpp | 6 | ||||
-rw-r--r-- | project2/sqlRows.cpp | 3 |
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; |