-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCClmWriter.h
63 lines (47 loc) · 1.47 KB
/
CClmWriter.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
51
52
53
54
55
56
57
58
59
60
61
62
63
#include "OP2Editor.h"
class CClmWriter : public ArchiveWriter
{
public:
// IUnknown
// ********
ULONG __stdcall AddRef();
ULONG __stdcall Release();
HRESULT __stdcall QueryInterface(REFIID riid, void** ppv);
// ArchiveWriter
// *************
HRESULT STDMETHODCALLTYPE AddToArchive(
/* [in] */ BSTR fileName,
/* [in] */ SeekableStreamReader __RPC_FAR *inStream,
/* [in] */ int reserved);
HRESULT STDMETHODCALLTYPE WriteArchive(
/* [in] */ StreamWriter __RPC_FAR *outStream);
// Class specific
// **************
CClmWriter();
~CClmWriter();
private:
ULONG m_cRef;
// Private constant used for Clm loading/saving
static const char tagClmFile[32];
#pragma pack(push, 1)
struct IndexEntry
{
char fileName[8]; // Internal archive filename
int dataOffset; // Offset to data
int dataSize; // Size of data
};
#pragma pack(pop)
struct LinkedListNode
{
LinkedListNode *next; // Next node in the linked list
SeekableStreamReader *inStream; // Input stream object for file data
IndexEntry indexEntry; // Index entry to save in the index section
int streamStartOffset; // Starting offset of data in stream to store
};
LinkedListNode* SortIndex(LinkedListNode *list);
// Linked list variables
LinkedListNode *head;
int numNodes;
int unknown; // **TODO** Find out what this DWORD means
int maxDataSize;
};