source: NonGTP/Boost/boost/date_time/time_zone_names.hpp @ 857

Revision 857, 2.0 KB checked in by igarcia, 19 years ago (diff)
Line 
1#ifndef DATE_TIME_TIME_ZONE_NAMES_HPP__
2#define DATE_TIME_TIME_ZONE_NAMES_HPP__
3
4/* Copyright (c) 2002,2003 CrystalClear Software, Inc.
5 * Use, modification and distribution is subject to the
6 * Boost Software License, Version 1.0. (See accompanying
7 * file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0)
8 * Author: Jeff Garland
9 * $Date: 2004/09/02 04:16:18 $
10 */
11
12#include <string>
13
14namespace boost {
15namespace date_time {
16
17  //! Base type that holds various string names for timezone output.
18  /*! Class that holds various types of strings used for timezones.
19   *  For example, for the western United States there is the full
20   *  name: Pacific Standard Time and the abbreviated name: PST.
21   *  During daylight savings there are additional names:
22   *  Pacific Daylight Time and PDT.
23   *@parm CharT Allows class to support different character types
24   */
25  template<class CharT = char>
26  class time_zone_names_base
27  {
28  public:
29    typedef std::basic_string<CharT> string_type;
30    time_zone_names_base(const string_type& std_zone_name,
31                         const string_type& std_zone_abbrev,
32                         const string_type& dst_zone_name,
33                         const string_type& dst_zone_abbrev) :
34      std_zone_name_(std_zone_name),
35      std_zone_abbrev_(std_zone_abbrev),
36      dst_zone_name_(dst_zone_name),
37      dst_zone_abbrev_(dst_zone_abbrev)
38    {}
39    string_type dst_zone_abbrev() const
40    {
41      return dst_zone_abbrev_;
42    }
43    string_type std_zone_abbrev() const
44    {
45      return std_zone_abbrev_;
46    }
47    string_type dst_zone_name() const
48    {
49      return dst_zone_name_;
50    }
51    string_type std_zone_name() const
52    {
53      return std_zone_name_;
54    }
55  private:
56    string_type std_zone_name_;
57    string_type std_zone_abbrev_;
58    string_type dst_zone_name_;
59    string_type dst_zone_abbrev_;
60   
61  };
62 
63  //! Specialization of timezone names for standard char.
64  typedef time_zone_names_base<char> time_zone_names;
65
66} } //namespace
67
68
69#endif
Note: See TracBrowser for help on using the repository browser.