00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __BARRY_RECORD_TIMEZONE_H__
00024 #define __BARRY_RECORD_TIMEZONE_H__
00025
00026 #include "dll.h"
00027 #include "record.h"
00028 #include <vector>
00029 #include <string>
00030 #include <stdint.h>
00031
00032 namespace Barry
00033 {
00034
00035 class BXEXPORT Timezone
00036 {
00037 public:
00038 typedef std::vector<UnknownField> UnknownsType;
00039
00040 uint8_t RecType;
00041 uint32_t RecordId;
00042
00043 uint8_t TZType;
00044 uint32_t DSTOffset;
00045 int32_t Index;
00046 int32_t Offset;
00047 int32_t OffsetFraction;
00048 uint32_t StartMonth;
00049 uint32_t EndMonth;
00050 bool Left;
00051 bool UseDST;
00052
00053 std::string TimeZoneName;
00054
00055 UnknownsType Unknowns;
00056
00057 public:
00058
00059 Timezone();
00060 virtual ~Timezone();
00061
00062 const unsigned char* ParseField(const unsigned char *begin,
00063 const unsigned char *end);
00064 void ParseRecurrenceData(const void *data);
00065 void BuildRecurrenceData(void *data);
00066 uint8_t GetRecType() const { return RecType; }
00067 uint32_t GetUniqueId() const { return RecordId; }
00068 void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; }
00069 void ParseHeader(const Data &data, size_t &offset);
00070 void ParseFields(const Data &data, size_t &offset);
00071 void BuildHeader(Data &data, size_t &offset) const;
00072
00073 void Clear();
00074
00075 void Dump(std::ostream &os) const;
00076 bool operator<(const Timezone &other) const { return TimeZoneName < other.TimeZoneName; }
00077
00078
00079 static const char * GetDBName() { return "Time Zones"; }
00080 static uint8_t GetDefaultRecType() { return 2; }
00081 };
00082
00083 BXEXPORT inline std::ostream& operator<<(std::ostream &os, const Timezone &msg) {
00084 msg.Dump(os);
00085 return os;
00086 }
00087 }
00088
00089 #endif