Go to the documentation of this file.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 IConverter;
00036
00037 class BXEXPORT Timezone
00038 {
00039 public:
00040 typedef Barry::UnknownsType UnknownsType;
00041
00042 uint8_t RecType;
00043 uint32_t RecordId;
00044
00045 uint8_t TZType;
00046 uint32_t DSTOffset;
00047 int32_t Index;
00048 int32_t Offset;
00049 int32_t OffsetFraction;
00050 uint32_t StartMonth;
00051 uint32_t EndMonth;
00052 bool Left;
00053 bool UseDST;
00054
00055 std::string TimeZoneName;
00056
00057 UnknownsType Unknowns;
00058
00059 public:
00060
00061 Timezone();
00062 virtual ~Timezone();
00063
00064 const unsigned char* ParseField(const unsigned char *begin,
00065 const unsigned char *end, const IConverter *ic = 0);
00066 void ParseRecurrenceData(const void *data);
00067 void BuildRecurrenceData(void *data);
00068 uint8_t GetRecType() const { return RecType; }
00069 uint32_t GetUniqueId() const { return RecordId; }
00070 void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; }
00071 void ParseHeader(const Data &data, size_t &offset);
00072 void ParseFields(const Data &data, size_t &offset, const IConverter *ic = 0);
00073 void BuildHeader(Data &data, size_t &offset) const;
00074
00075 void Clear();
00076
00077 void Dump(std::ostream &os) const;
00078 bool operator<(const Timezone &other) const { return TimeZoneName < other.TimeZoneName; }
00079
00080
00081 static const char * GetDBName() { return "Time Zones"; }
00082 static uint8_t GetDefaultRecType() { return 2; }
00083 };
00084
00085 BXEXPORT inline std::ostream& operator<<(std::ostream &os, const Timezone &msg) {
00086 msg.Dump(os);
00087 return os;
00088 }
00089 }
00090
00091 #endif