Warning, file /include/boost/date_time/iso_format.hpp was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 #ifndef ISO_FORMAT_HPP___
0002 #define ISO_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 iso_format_base {
0020 public:
0021   
0022   static month_format_spec month_format()
0023   {
0024     return month_as_integer;
0025   }
0026 
0027   
0028   static const charT* not_a_date()
0029   {     
0030     return "not-a-date-time";
0031   }
0032   
0033   static const charT* pos_infinity()
0034   {
0035     return "+infinity";
0036   }
0037   
0038   static const charT* neg_infinity()
0039   {
0040     return "-infinity";
0041   }
0042 
0043   
0044   static charT year_sep_char()
0045   {
0046     return 'Y';
0047   }
0048   
0049   static charT month_sep_char()
0050   {
0051     return '-';
0052   }
0053   
0054   static charT day_sep_char()
0055   {
0056     return '-';
0057   }
0058   
0059   static charT hour_sep_char()
0060   {
0061     return ':';
0062   }
0063   
0064   static charT minute_sep_char()
0065   {
0066     return ':';
0067   }
0068   
0069   static charT second_sep_char()
0070   {
0071     return ':';
0072   }
0073   
0074   static charT period_start_char()
0075   {
0076     return 'P';
0077   }
0078   
0079   static charT time_start_char()
0080   {
0081     return 'T';
0082   }
0083 
0084   
0085   static charT week_start_char()
0086   {
0087     return 'W';
0088   }
0089 
0090   
0091   static charT period_sep_char()
0092   {
0093     return '/';
0094   }
0095   
0096   static charT time_sep_char()
0097   {
0098     return ':';
0099   }
0100   
0101   static charT fractional_time_sep_char()
0102   {
0103     return ',';
0104   }
0105 
0106   static bool is_component_sep(charT sep)
0107   {
0108     switch(sep) {
0109     case 'H':
0110     case 'M':
0111     case 'S':
0112     case 'W':
0113     case 'T':
0114     case 'Y':
0115     case 'D':return true;
0116     default:
0117       return false;
0118     }
0119   }
0120 
0121   static bool is_fractional_time_sep(charT sep)
0122   {
0123     switch(sep) {
0124     case ',':
0125     case '.': return true;
0126     default: return false;
0127     }
0128   }
0129   static bool is_timezone_sep(charT sep)
0130   {
0131     switch(sep) {
0132     case '+':
0133     case '-': return true;
0134     default: return false;
0135     }
0136   }
0137   static charT element_sep_char()
0138   {
0139     return '-';
0140   }
0141 
0142 };
0143 
0144 #ifndef BOOST_NO_STD_WSTRING
0145 
0146 
0147 template<>
0148 class iso_format_base<wchar_t> {
0149 public:
0150   
0151   static month_format_spec month_format()
0152   {
0153     return month_as_integer;
0154   }
0155 
0156   
0157   static const wchar_t* not_a_date()
0158   {      
0159     return L"not-a-date-time";
0160   }
0161   
0162   static const wchar_t* pos_infinity()
0163   {
0164     return L"+infinity";
0165   }
0166   
0167   static const wchar_t* neg_infinity()
0168   {
0169     return L"-infinity";
0170   }
0171 
0172   
0173   static wchar_t year_sep_char()
0174   {
0175     return 'Y';
0176   }
0177   
0178   static wchar_t month_sep_char()
0179   {
0180     return '-';
0181   }
0182   
0183   static wchar_t day_sep_char()
0184   {
0185     return '-';
0186   }
0187   
0188   static wchar_t hour_sep_char()
0189   {
0190     return ':';
0191   }
0192   
0193   static wchar_t minute_sep_char()
0194   {
0195     return ':';
0196   }
0197   
0198   static wchar_t second_sep_char()
0199   {
0200     return ':';
0201   }
0202   
0203   static wchar_t period_start_char()
0204   {
0205     return 'P';
0206   }
0207   
0208   static wchar_t time_start_char()
0209   {
0210     return 'T';
0211   }
0212 
0213   
0214   static wchar_t week_start_char()
0215   {
0216     return 'W';
0217   }
0218 
0219   
0220   static wchar_t period_sep_char()
0221   {
0222     return '/';
0223   }
0224   
0225   static wchar_t time_sep_char()
0226   {
0227     return ':';
0228   }
0229   
0230   static wchar_t fractional_time_sep_char()
0231   {
0232     return ',';
0233   }
0234 
0235   static bool is_component_sep(wchar_t sep)
0236   {
0237     switch(sep) {
0238     case 'H':
0239     case 'M':
0240     case 'S':
0241     case 'W':
0242     case 'T':
0243     case 'Y':
0244     case 'D':return true;
0245     default:
0246       return false;
0247     }
0248   }
0249 
0250   static bool is_fractional_time_sep(wchar_t sep)
0251   {
0252     switch(sep) {
0253     case ',':
0254     case '.': return true;
0255     default: return false;
0256     }
0257   }
0258   static bool is_timezone_sep(wchar_t sep)
0259   {
0260     switch(sep) {
0261     case '+':
0262     case '-': return true;
0263     default: return false;
0264     }
0265   }
0266   static wchar_t element_sep_char()
0267   {
0268     return '-';
0269   }
0270 
0271 };
0272 
0273 #endif 
0274 
0275 
0276 template<class charT>
0277 class iso_format : public iso_format_base<charT> {
0278 public:
0279   
0280   static bool has_date_sep_chars()
0281   {
0282     return false;
0283   }
0284 };
0285 
0286 
0287 template<class charT>
0288 class iso_extended_format : public iso_format_base<charT> {
0289 public:
0290   
0291   static bool has_date_sep_chars()
0292   {
0293     return true;
0294   }
0295 
0296 };
0297 
0298 } } 
0299 
0300 
0301 
0302 
0303 #endif