summaryrefslogtreecommitdiffstats
path: root/src/core/Directory.h
blob: 0fef080f4bc074a028f714b225c1e526d3f05c51 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#pragma once

class CDirectory
{
public:
	struct DirectoryInfo {
		uint32 offset;
		uint32 size;
		char name[24];
	};
	DirectoryInfo *entries;
	int32 maxEntries;
	int32 numEntries;

	CDirectory(int32 maxEntries);
	~CDirectory(void);

	void ReadDirFile(const char *filename);
	bool WriteDirFile(const char *filename);
	void AddItem(const DirectoryInfo &dirinfo);
	void AddItem(const DirectoryInfo &dirinfo, int32 imgId);
	bool FindItem(const char *name, uint32 &offset, uint32 &size);
};