summaryrefslogtreecommitdiff
path: root/project2/json
diff options
context:
space:
mode:
Diffstat (limited to 'project2/json')
-rw-r--r--project2/json/conversion.cpp3
-rw-r--r--project2/json/conversion.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/project2/json/conversion.cpp b/project2/json/conversion.cpp
index 1fae0d3..8f7fc55 100644
--- a/project2/json/conversion.cpp
+++ b/project2/json/conversion.cpp
@@ -2,6 +2,9 @@
#include "conversion.h"
#include <boost/date_time/posix_time/posix_time.hpp>
+json::Value Project2ToJson::operator()(const boost::posix_time::time_duration & i) const {
+ return boost::posix_time::to_simple_string(i);
+}
json::Value Project2ToJson::operator()(const boost::posix_time::ptime & i) const {
return boost::posix_time::to_iso_extended_string(i);
}
diff --git a/project2/json/conversion.h b/project2/json/conversion.h
index d875462..51a8938 100644
--- a/project2/json/conversion.h
+++ b/project2/json/conversion.h
@@ -8,6 +8,7 @@
class ConversionNotSupported { };
class Project2ToJson : public boost::static_visitor<json::Value> {
public:
+ json::Value operator()(const boost::posix_time::time_duration & i) const;
json::Value operator()(const boost::posix_time::ptime & i) const;
json::Value operator()(const Null & c) const;
json::Value operator()(const Glib::ustring & c) const;