Rudiments
timezonefile.h
1 // Copyright (c) 2003 David Muse
2 // See the COPYING file for more information
3 
4 #ifndef RUDIMENTS_TIMEZONEFILE_H
5 #define RUDIMENTS_TIMEZONEFILE_H
6 
7 #include <rudiments/private/timezonefileincludes.h>
8 
9 #ifdef RUDIMENTS_NAMESPACE
10 namespace rudiments {
11 #endif
12 
13 class timezonefileprivate;
14 
15 struct ttinfo {
16  int64_t tt_gmtoff;
17  int32_t tt_isdst;
18  uint32_t tt_abbrind;
19 };
20 
23 class RUDIMENTS_DLLSPEC timezonefile {
24  public:
25 
27  timezonefile();
28 
31  timezonefile(const timezonefile &t);
32 
35  timezonefile &operator=(const timezonefile &t);
36 
38  ~timezonefile();
39 
42  bool parseFile(const char *filename);
43 
46  uint64_t getTimeCount();
47 
49  uint64_t *getTransitionTimes();
50 
52  uint64_t getTransitionTime(int32_t index);
53 
55  unsigned char *getLocalTimes();
56 
58  unsigned char getLocalTimes(int32_t index);
59 
62  uint64_t getTypeCount();
63 
65  ttinfo **getTimeTypeInfos();
66 
68  ttinfo *getTimeTypeInfo(int32_t index);
69 
72  uint64_t getLeapCount();
73 
75  uint64_t *getLeapSecondTimes();
76 
78  uint64_t getLeapSecondTime(int32_t index);
79 
81  uint64_t *getTotalLeapSeconds();
82 
84  uint64_t getTotalLeapSeconds(int32_t index);
85 
88  uint64_t getIsSTDCount();
89 
91  unsigned char *getStandardOrWallIndicators();
92 
94  unsigned char getStandardOrWallIndicator(int32_t index);
95 
98  uint64_t getIsGMTCount();
99 
101  unsigned char *getUTCOrLocalIndicators();
102 
104  unsigned char getUTCOrLocalIndicator(int32_t index);
105 
108  uint64_t getCharacterCount();
109 
111  unsigned char *getRawTimeZoneString();
112 
114  unsigned char **getTimeZoneStrings();
115 
117  unsigned char *getTimeZoneString(int32_t index);
118 
120  void print();
121 
122  #include <rudiments/private/timezonefile.h>
123 };
124 
125 #ifdef RUDIMENTS_NAMESPACE
126 }
127 #endif
128 
129 #endif