123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- #ifndef DATE_TIME_SIMPLE_FORMAT_HPP___
- #define DATE_TIME_SIMPLE_FORMAT_HPP___
- #include "boost/date_time/parse_format_base.hpp"
- namespace boost {
- namespace date_time {
- template<class charT>
- class simple_format {
- public:
-
- static const charT* not_a_date()
- {
- return "not-a-date-time";
- }
-
- static const charT* pos_infinity()
- {
- return "+infinity";
- }
-
- static const charT* neg_infinity()
- {
- return "-infinity";
- }
-
- static month_format_spec month_format()
- {
- return month_as_short_string;
- }
- static ymd_order_spec date_order()
- {
- return ymd_order_iso;
- }
-
- static bool has_date_sep_chars()
- {
- return true;
- }
-
- static charT year_sep_char()
- {
- return '-';
- }
-
- static charT month_sep_char()
- {
- return '-';
- }
-
- static charT day_sep_char()
- {
- return '-';
- }
-
- static charT hour_sep_char()
- {
- return ' ';
- }
-
- static charT minute_sep_char()
- {
- return ':';
- }
-
- static charT second_sep_char()
- {
- return ':';
- }
- };
- #ifndef BOOST_NO_STD_WSTRING
- template<>
- class simple_format<wchar_t> {
- public:
-
- static const wchar_t* not_a_date()
- {
- return L"not-a-date-time";
- }
-
- static const wchar_t* pos_infinity()
- {
- return L"+infinity";
- }
-
- static const wchar_t* neg_infinity()
- {
- return L"-infinity";
- }
-
- static month_format_spec month_format()
- {
- return month_as_short_string;
- }
- static ymd_order_spec date_order()
- {
- return ymd_order_iso;
- }
-
- static bool has_date_sep_chars()
- {
- return true;
- }
-
- static wchar_t year_sep_char()
- {
- return '-';
- }
-
- static wchar_t month_sep_char()
- {
- return '-';
- }
-
- static wchar_t day_sep_char()
- {
- return '-';
- }
-
- static wchar_t hour_sep_char()
- {
- return ' ';
- }
-
- static wchar_t minute_sep_char()
- {
- return ':';
- }
-
- static wchar_t second_sep_char()
- {
- return ':';
- }
- };
- #endif
- } }
- #endif
|