-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbmwBESTObject.h
50 lines (37 loc) · 1.24 KB
/
bmwBESTObject.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//
// Created by lpcvoid on 2020-02-06.
//
#ifndef BESTVMTEST_BMWBESTOBJECT_H
#define BESTVMTEST_BMWBESTOBJECT_H
#include <string>
#include <vector>
#include <map>
#include "../common/bmwTypes.h"
#include "bmwBESTTable.h"
#include "bmwBESTJob.h"
#include "../common/bmwMemoryBuffer.hpp"
#pragma pack(push, 1)
typedef struct { uint8 v[3]; } bmwBESTVerison;
typedef struct { uint16 v[2]; } bmwBESTRevision;
#pragma pack(pop)
enum bmwBESTDescriptionEntryType {
bmwBESTDescriptionEntryType_result, bmwBESTDescriptionEntryType_result_type, bmwBESTDescriptionEntryType_result_comment
};
struct bmwBESTDescriptionEntry {
std::string desc_name;
std::string desc_comment;
std::vector<std::pair<bmwBESTDescriptionEntryType, std::string>> desc_lines;
};
struct bmwBESTObject {
bmwBESTRevision rev;
bmwBESTVerison version;
std::string last_changed;
std::string filename;
std::map<std::string, std::string> desc;
std::map<std::string, bmwBESTDescriptionEntry*> desc_jobs;
std::map<std::string, bmwBESTTable*> tables;
std::map<std::string, bmwBESTJob*> jobs;
};
bool SerializeBESTObject(bmwMemoryBuffer& buf, bmwBESTObject* bo);
bmwBESTObject* DeserializeBESTObject(bmwMemoryBuffer& buf);
#endif //BESTVMTEST_BMWBESTOBJECT_H