diff options
Diffstat (limited to 'src/times.h')
-rw-r--r-- | src/times.h | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/src/times.h b/src/times.h index 3bb95903..d6ab542d 100644 --- a/src/times.h +++ b/src/times.h @@ -111,26 +111,20 @@ std::string format_date(const date_t& when, void set_date_format(const char * format); void set_input_date_format(const char * format); -inline void to_xml(std::ostream& out, const datetime_t& when, - bool wrap = true) -{ - if (wrap) { - push_xml x(out, "datetime"); - out << format_datetime(when, FMT_WRITTEN); - } else { - out << format_datetime(when, FMT_WRITTEN); - } +inline void put_datetime(property_tree::ptree& pt, const datetime_t& when, + bool wrap = true) { + if (wrap) + pt.put("datetime", format_datetime(when, FMT_WRITTEN)); + else + pt.put_value(format_datetime(when, FMT_WRITTEN)); } -inline void to_xml(std::ostream& out, const date_t& when, - bool wrap = true) -{ - if (wrap) { - push_xml x(out, "date"); - out << format_date(when, FMT_WRITTEN); - } else { - out << format_date(when, FMT_WRITTEN); - } +inline void put_date(property_tree::ptree& pt, const date_t& when, + bool wrap = true) { + if (wrap) + pt.put("date", format_date(when, FMT_WRITTEN)); + else + pt.put_value(format_date(when, FMT_WRITTEN)); } struct date_traits_t |