r_folder.h
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_FOLDER_H__
00024 #define __BARRY_RECORD_FOLDER_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 Folder
00038 {
00039 public:
00040 typedef std::vector<UnknownField> UnknownsType;
00041 uint8_t RecType;
00042 uint32_t RecordId;
00043
00044 std::string FolderName;
00045 uint16_t FolderNumber;
00046 uint16_t FolderLevel;
00047
00048 enum FolderTypeEnum {
00049 FolderSubtree = 0,
00050 FolderDeleted,
00051 FolderInbox,
00052 FolderOutbox,
00053 FolderSent,
00054 FolderOther,
00055 FolderDraft = 0x0a
00056 };
00057 FolderTypeEnum FolderType;
00058
00059 enum FolderStatusType {
00060 FolderOrphan = 0x50,
00061 FolderUnfiled,
00062 FolderFiled
00063 };
00064
00065 UnknownsType Unknowns;
00066
00067 public:
00068 Folder();
00069 ~Folder();
00070
00071 const unsigned char* ParseField(const unsigned char *begin,
00072 const unsigned char *end, const IConverter *ic = 0);
00073 uint8_t GetRecType() const { return RecType; }
00074 uint32_t GetUniqueId() const { return RecordId; }
00075 void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; }
00076 void ParseHeader(const Data &data, size_t &offset);
00077 void ParseFields(const Data &data, size_t &offset, const IConverter *ic = 0);
00078 void BuildHeader(Data &data, size_t &offset) const;
00079
00080 void Clear();
00081
00082 void Dump(std::ostream &os) const;
00083 bool operator<(const Folder &other) const { return FolderName < other.FolderName; }
00084
00085
00086 static const char * GetDBName() { return "Folders"; }
00087 static uint8_t GetDefaultRecType() { return 0; }
00088
00089 };
00090
00091 BXEXPORT inline std::ostream& operator<<(std::ostream &os, const Folder &msg) {
00092 msg.Dump(os);
00093 return os;
00094 }
00095
00096 }
00097
00098 #endif // __BARRY_RECORD_FOLDER_H__
00099
00100