-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathItem.h
45 lines (34 loc) · 1.11 KB
/
Item.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
#pragma once
#include "Header.h"
#include "DataTable.h"
#include "ContentTable.h"
#include "TagRefTable.h"
#include "DataRefTable.h"
#include "logger/logger.h"
#include "module/ModuleItem.h"
#include <string>
#include "TagRefFieldTable.h"
class TagManager;
class Item{
public:
ModuleItem* moduleItem; // this is still needed, as it contains useful information like resource count and references
Header header;
DataTable dataTable;
ContentTable contentTable;
TagRefFieldTable tagRefFieldTable;
TagRefTable tagRefTable;
DataRefTable dataRefTable;
Logger* logger;
TagManager* tagManager;
std::string name;
std::string path;
// the data will be copied into a new buffer,
Item(uint8_t* data, uint32_t length, Logger* logger, std::string name, std::string path, ModuleItem* moduleItem);
~Item();
// returns a pointer to the start of this blocks data. The data does not get copied again, so this pointer is only valid as long as this item exists
void* getDataBlock(DataTableEntry* entry);
uint32_t getDataBlockOffset(DataTableEntry* entry);
void* getRefDataBlock(ContentTableEntry* entry);
private:
uint8_t* data;
};