File indexing completed on 2025-01-18 09:30:40
0001 #ifndef DATE_TIME_TIME_ZONE_NAMES_HPP__
0002 #define DATE_TIME_TIME_ZONE_NAMES_HPP__
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #include <string>
0013
0014 namespace boost {
0015 namespace date_time {
0016
0017 template<class CharT>
0018 struct default_zone_names {
0019 public:
0020 typedef CharT char_type;
0021 static const char_type standard_name[9];
0022 static const char_type standard_abbrev[11];
0023 static const char_type non_dst_identifier[7];
0024 };
0025 template <class CharT>
0026 const typename default_zone_names<CharT>::char_type
0027 default_zone_names<CharT>::standard_name[9] =
0028 {'s','t','d','_','n','a','m','e'};
0029
0030 template <class CharT>
0031 const typename default_zone_names<CharT>::char_type
0032 default_zone_names<CharT>::standard_abbrev[11] =
0033 {'s','t','d','_','a','b','b','r','e','v'};
0034
0035 template <class CharT>
0036 const typename default_zone_names<CharT>::char_type
0037 default_zone_names<CharT>::non_dst_identifier[7] =
0038 {'n','o','-','d','s','t'};
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048 template<class CharT>
0049 class time_zone_names_base
0050 {
0051 public:
0052 typedef std::basic_string<CharT> string_type;
0053 time_zone_names_base() :
0054 std_zone_name_(default_zone_names<CharT>::standard_name),
0055 std_zone_abbrev_(default_zone_names<CharT>::standard_abbrev),
0056 dst_zone_name_(default_zone_names<CharT>::non_dst_identifier),
0057 dst_zone_abbrev_(default_zone_names<CharT>::non_dst_identifier)
0058 {}
0059 time_zone_names_base(const string_type& std_zone_name_str,
0060 const string_type& std_zone_abbrev_str,
0061 const string_type& dst_zone_name_str,
0062 const string_type& dst_zone_abbrev_str) :
0063 std_zone_name_(std_zone_name_str),
0064 std_zone_abbrev_(std_zone_abbrev_str),
0065 dst_zone_name_(dst_zone_name_str),
0066 dst_zone_abbrev_(dst_zone_abbrev_str)
0067 {}
0068 string_type dst_zone_abbrev() const
0069 {
0070 return dst_zone_abbrev_;
0071 }
0072 string_type std_zone_abbrev() const
0073 {
0074 return std_zone_abbrev_;
0075 }
0076 string_type dst_zone_name() const
0077 {
0078 return dst_zone_name_;
0079 }
0080 string_type std_zone_name() const
0081 {
0082 return std_zone_name_;
0083 }
0084 private:
0085 string_type std_zone_name_;
0086 string_type std_zone_abbrev_;
0087 string_type dst_zone_name_;
0088 string_type dst_zone_abbrev_;
0089
0090 };
0091
0092
0093
0094
0095 } }
0096
0097
0098 #endif