From 2c80227339538154ad0869e746f52db805325589 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 25 Oct 2009 05:13:21 -0400 Subject: Added basic foundation for XML reporting --- src/times.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/times.h') diff --git a/src/times.h b/src/times.h index 9387320e..c2c2530e 100644 --- a/src/times.h +++ b/src/times.h @@ -116,6 +116,18 @@ 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) +{ + push_xml x(out, "datetime"); + out << format_datetime(when, FMT_WRITTEN); +} + +inline void to_xml(std::ostream& out, const date_t& when) +{ + push_xml x(out, "date"); + out << format_date(when, FMT_WRITTEN); +} + class date_interval_t : public equality_comparable { public: -- cgit v1.2.3