From 9c8bfbdc9f005f0a70dc4e0cbafe84a6c69d2a17 Mon Sep 17 00:00:00 2001 From: Jeff Garland Date: Sat, 2 Nov 2002 23:43:38 +0000 Subject: [PATCH] add date period ostream operator [SVN r16076] --- .../boost/date_time/gregorian/greg_facet.hpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/include/boost/date_time/gregorian/greg_facet.hpp b/include/boost/date_time/gregorian/greg_facet.hpp index 9470e74..7338182 100644 --- a/include/boost/date_time/gregorian/greg_facet.hpp +++ b/include/boost/date_time/gregorian/greg_facet.hpp @@ -91,6 +91,25 @@ namespace gregorian { return os; } + //! operator<< for gregorian::date_period typical output: [2002-Jan-01/2002-Jan-31] + /*! Uses the date facet to determine output string as well as selection of long + * or short string fr dates. + * Default if no facet is installed is to output a 3 char english string for the + * day of the week. + */ + template + inline + std::basic_ostream& + operator<<(std::basic_ostream& os, const date_period& dp) + { + os << '['; //TODO: facet or manipulator for periods? + os << dp.begin(); + os << '/'; //TODO: facet or manipulator for periods? + os << dp.last(); + os << ']'; + return os; + } + } } //namespace gregorian