r_memo.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_MEMO_H__
00024 #define __BARRY_RECORD_MEMO_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 Memo
00038 {
00039 public:
00040 typedef std::vector<UnknownField> UnknownsType;
00041
00042 uint8_t RecType;
00043 uint32_t RecordId;
00044
00045 std::string Title;
00046 std::string Body;
00047 CategoryList Categories;
00048
00049 UnknownsType Unknowns;
00050
00051 public:
00052 const unsigned char* ParseField(const unsigned char *begin,
00053 const unsigned char *end, const IConverter *ic = 0);
00054
00055 public:
00056 Memo();
00057 ~Memo();
00058
00059
00060 uint8_t GetRecType() const { return RecType; }
00061 uint32_t GetUniqueId() const { return RecordId; }
00062 void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; }
00063 void ParseHeader(const Data &data, size_t &offset);
00064 void ParseFields(const Data &data, size_t &offset, const IConverter *ic = 0);
00065 void BuildHeader(Data &data, size_t &offset) const;
00066 void BuildFields(Data &data, size_t &offset, const IConverter *ic = 0) const;
00067
00068 void Clear();
00069
00070 void Dump(std::ostream &os) const;
00071
00072 bool operator<(const Memo &other) const;
00073
00074
00075 static const char * GetDBName() { return "Memos"; }
00076 static uint8_t GetDefaultRecType() { return 0; }
00077 };
00078
00079 BXEXPORT inline std::ostream& operator<<(std::ostream &os, const Memo &msg) {
00080 msg.Dump(os);
00081 return os;
00082 }
00083
00084 }
00085
00086 #endif
00087