File indexing completed on 2025-01-18 09:30:37
0001 #ifndef DATE_TIME_SIMPLE_FORMAT_HPP___
0002 #define DATE_TIME_SIMPLE_FORMAT_HPP___
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #include "boost/date_time/parse_format_base.hpp"
0013
0014 namespace boost {
0015 namespace date_time {
0016
0017
0018 template<class charT>
0019 class simple_format {
0020 public:
0021
0022
0023 static const charT* not_a_date()
0024 {
0025 return "not-a-date-time";
0026 }
0027
0028 static const charT* pos_infinity()
0029 {
0030 return "+infinity";
0031 }
0032
0033 static const charT* neg_infinity()
0034 {
0035 return "-infinity";
0036 }
0037
0038 static month_format_spec month_format()
0039 {
0040 return month_as_short_string;
0041 }
0042 static ymd_order_spec date_order()
0043 {
0044 return ymd_order_iso;
0045 }
0046
0047 static bool has_date_sep_chars()
0048 {
0049 return true;
0050 }
0051
0052 static charT year_sep_char()
0053 {
0054 return '-';
0055 }
0056
0057 static charT month_sep_char()
0058 {
0059 return '-';
0060 }
0061
0062 static charT day_sep_char()
0063 {
0064 return '-';
0065 }
0066
0067 static charT hour_sep_char()
0068 {
0069 return ' ';
0070 }
0071
0072 static charT minute_sep_char()
0073 {
0074 return ':';
0075 }
0076
0077 static charT second_sep_char()
0078 {
0079 return ':';
0080 }
0081
0082 };
0083
0084 #ifndef BOOST_NO_STD_WSTRING
0085
0086
0087 template<>
0088 class simple_format<wchar_t> {
0089 public:
0090
0091
0092 static const wchar_t* not_a_date()
0093 {
0094 return L"not-a-date-time";
0095 }
0096
0097 static const wchar_t* pos_infinity()
0098 {
0099 return L"+infinity";
0100 }
0101
0102 static const wchar_t* neg_infinity()
0103 {
0104 return L"-infinity";
0105 }
0106
0107 static month_format_spec month_format()
0108 {
0109 return month_as_short_string;
0110 }
0111 static ymd_order_spec date_order()
0112 {
0113 return ymd_order_iso;
0114 }
0115
0116 static bool has_date_sep_chars()
0117 {
0118 return true;
0119 }
0120
0121 static wchar_t year_sep_char()
0122 {
0123 return '-';
0124 }
0125
0126 static wchar_t month_sep_char()
0127 {
0128 return '-';
0129 }
0130
0131 static wchar_t day_sep_char()
0132 {
0133 return '-';
0134 }
0135
0136 static wchar_t hour_sep_char()
0137 {
0138 return ' ';
0139 }
0140
0141 static wchar_t minute_sep_char()
0142 {
0143 return ':';
0144 }
0145
0146 static wchar_t second_sep_char()
0147 {
0148 return ':';
0149 }
0150
0151 };
0152
0153 #endif
0154 } }
0155
0156
0157
0158
0159 #endif