Chris@16: #ifndef DATE_TIME_TIME_ZONE_NAMES_HPP__ Chris@16: #define DATE_TIME_TIME_ZONE_NAMES_HPP__ Chris@16: Chris@16: /* Copyright (c) 2002-2003,2005 CrystalClear Software, Inc. Chris@16: * Use, modification and distribution is subject to the Chris@16: * Boost Software License, Version 1.0. (See accompanying Chris@16: * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) Chris@16: * Author: Jeff Garland Chris@101: * $Date$ Chris@16: */ Chris@16: Chris@16: #include Chris@16: Chris@16: namespace boost { Chris@16: namespace date_time { Chris@16: Chris@16: template Chris@16: struct default_zone_names { Chris@16: public: Chris@16: typedef CharT char_type; Chris@16: static const char_type standard_name[9]; Chris@16: static const char_type standard_abbrev[11]; Chris@16: static const char_type non_dst_identifier[7]; Chris@16: }; Chris@16: template Chris@16: const typename default_zone_names::char_type Chris@16: default_zone_names::standard_name[9] = Chris@16: {'s','t','d','_','n','a','m','e'}; Chris@16: Chris@16: template Chris@16: const typename default_zone_names::char_type Chris@16: default_zone_names::standard_abbrev[11] = Chris@16: {'s','t','d','_','a','b','b','r','e','v'}; Chris@16: Chris@16: template Chris@16: const typename default_zone_names::char_type Chris@16: default_zone_names::non_dst_identifier[7] = Chris@16: {'n','o','-','d','s','t'}; Chris@16: Chris@16: //! Base type that holds various string names for timezone output. Chris@16: /*! Class that holds various types of strings used for timezones. Chris@16: * For example, for the western United States there is the full Chris@16: * name: Pacific Standard Time and the abbreviated name: PST. Chris@16: * During daylight savings there are additional names: Chris@16: * Pacific Daylight Time and PDT. Chris@16: *@parm CharT Allows class to support different character types Chris@16: */ Chris@16: template Chris@16: class time_zone_names_base Chris@16: { Chris@16: public: Chris@16: typedef std::basic_string string_type; Chris@16: time_zone_names_base() : Chris@16: std_zone_name_(default_zone_names::standard_name), Chris@16: std_zone_abbrev_(default_zone_names::standard_abbrev), Chris@16: dst_zone_name_(default_zone_names::non_dst_identifier), Chris@16: dst_zone_abbrev_(default_zone_names::non_dst_identifier) Chris@16: {} Chris@16: time_zone_names_base(const string_type& std_zone_name_str, Chris@16: const string_type& std_zone_abbrev_str, Chris@16: const string_type& dst_zone_name_str, Chris@16: const string_type& dst_zone_abbrev_str) : Chris@16: std_zone_name_(std_zone_name_str), Chris@16: std_zone_abbrev_(std_zone_abbrev_str), Chris@16: dst_zone_name_(dst_zone_name_str), Chris@16: dst_zone_abbrev_(dst_zone_abbrev_str) Chris@16: {} Chris@16: string_type dst_zone_abbrev() const Chris@16: { Chris@16: return dst_zone_abbrev_; Chris@16: } Chris@16: string_type std_zone_abbrev() const Chris@16: { Chris@16: return std_zone_abbrev_; Chris@16: } Chris@16: string_type dst_zone_name() const Chris@16: { Chris@16: return dst_zone_name_; Chris@16: } Chris@16: string_type std_zone_name() const Chris@16: { Chris@16: return std_zone_name_; Chris@16: } Chris@16: private: Chris@16: string_type std_zone_name_; Chris@16: string_type std_zone_abbrev_; Chris@16: string_type dst_zone_name_; Chris@16: string_type dst_zone_abbrev_; Chris@16: Chris@16: }; Chris@16: Chris@16: //! Specialization of timezone names for standard char. Chris@16: //typedef time_zone_names_base time_zone_names; Chris@16: Chris@16: } } //namespace Chris@16: Chris@16: Chris@16: #endif