1 #ifndef DATE_TIME_SIMPLE_FORMAT_HPP___
2 #define DATE_TIME_SIMPLE_FORMAT_HPP___
4 /* Copyright (c) 2002,2003 CrystalClear Software, Inc.
5 * Use, modification and distribution is subject to the
6 * Boost Software License, Version 1.0. (See accompanying
7 * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
8 * Author: Jeff Garland, Bart Garst
12 #include "boost/date_time/parse_format_base.hpp"
17 //! Class to provide simple basic formatting rules
22 //! String used printed is date is invalid
23 static const charT
* not_a_date()
25 return "not-a-date-time";
27 //! String used to for positive infinity value
28 static const charT
* pos_infinity()
32 //! String used to for positive infinity value
33 static const charT
* neg_infinity()
37 //! Describe month format
38 static month_format_spec
month_format()
40 return month_as_short_string
;
42 static ymd_order_spec
date_order()
44 return ymd_order_iso
; //YYYY-MM-DD
46 //! This format uses '-' to separate date elements
47 static bool has_date_sep_chars()
52 static charT
year_sep_char()
56 //! char between year-month
57 static charT
month_sep_char()
61 //! Char to separate month-day
62 static charT
day_sep_char()
66 //! char between date-hours
67 static charT
hour_sep_char()
71 //! char between hour and minute
72 static charT
minute_sep_char()
77 static charT
second_sep_char()
84 #ifndef BOOST_NO_STD_WSTRING
86 //! Specialization of formmating rules for wchar_t
88 class simple_format
<wchar_t> {
91 //! String used printed is date is invalid
92 static const wchar_t* not_a_date()
94 return L
"not-a-date-time";
96 //! String used to for positive infinity value
97 static const wchar_t* pos_infinity()
101 //! String used to for positive infinity value
102 static const wchar_t* neg_infinity()
106 //! Describe month format
107 static month_format_spec
month_format()
109 return month_as_short_string
;
111 static ymd_order_spec
date_order()
113 return ymd_order_iso
; //YYYY-MM-DD
115 //! This format uses '-' to separate date elements
116 static bool has_date_sep_chars()
121 static wchar_t year_sep_char()
125 //! char between year-month
126 static wchar_t month_sep_char()
130 //! Char to separate month-day
131 static wchar_t day_sep_char()
135 //! char between date-hours
136 static wchar_t hour_sep_char()
140 //! char between hour and minute
141 static wchar_t minute_sep_char()
146 static wchar_t second_sep_char()
153 #endif // BOOST_NO_STD_WSTRING
154 } } //namespace date_time