-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCVolWriter.h
68 lines (55 loc) · 1.86 KB
/
CVolWriter.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
64
65
66
67
68
#include "OP2Editor.h"
class CVolWriter : 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
// **************
CVolWriter();
~CVolWriter();
private:
ULONG m_cRef;
#pragma pack(push, 1)
struct SectionHeader
{
int tag; // Identifies this section with a 4 byte (ASCII) tag
int sectionSize:31; // Size of this section in bytes
int alignment:1; // Determines if section is to be treated as WORD or DWORD aligned
};
struct IndexEntry
{
int fileNameOffset; // Offset to filename in string table
int dataOffset; // Offset in VOL file of this file's data
int fileSize; // Size of this file
char encoding; // Compression used to store the file
char bUsed; // Indicates if this IndexEntry is used
};
#pragma pack(pop)
struct LinkedListNode
{
LinkedListNode *next; // Next node in the linked list
SeekableStreamReader *inStream; // Input stream object for file data
int startStreamOffset; // Starting offset of data in this stream to store
int fileNameLength; // Length of filename, including the NULL terminator
char *fileName; // Internal archive filename
IndexEntry indexEntry; // Index entry for this file
};
LinkedListNode* SortIndex(LinkedListNode *list);
// Linked list variables
LinkedListNode *head;
int numNodes;
int stringTableSize;
int maxBufferSize;
};