-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit: the original DAT2 v2.32
- Loading branch information
0 parents
commit 13f100f
Showing
26 changed files
with
4,122 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
#pragma once | ||
|
||
#include "DatFileBase.h" | ||
|
||
// CFileList1 | ||
class CFileList1 : public CObject { | ||
public: | ||
CFileList1(); | ||
virtual ~CFileList1(); | ||
|
||
DECLARE_DYNAMIC(CFileList1) | ||
|
||
virtual void Serialize(CArchive& ar); | ||
INT_PTR GetSize() const; | ||
|
||
DWORD GetLength(); | ||
|
||
INT_PTR Add(const CFileDescriptorBase& newElement); | ||
void RemoveAt(INT_PTR nIndex); | ||
|
||
CFileDescriptorBase& operator [] (INT_PTR nIndex); | ||
CFileDescriptorBase operator [] (INT_PTR nIndex) const; | ||
|
||
#ifdef _DEBUG | ||
virtual void AssertValid() const; | ||
virtual void Dump(CDumpContext& dc) const; | ||
#endif | ||
|
||
private: | ||
// Assignment and copy not allowed | ||
CFileList1(const CFileList1&); | ||
CFileList1& operator = (const CFileList1&); | ||
|
||
private: | ||
// CFileDescriptorBaseArray | ||
typedef CArray<CFileDescriptorBase, const CFileDescriptorBase&> CFileDescriptorBaseArray; | ||
|
||
// CFileTreeItem | ||
class CFileTreeItem { | ||
public: | ||
CFileTreeItem(); | ||
CFileTreeItem(const CFileTreeItem& item); | ||
|
||
public: | ||
CFileTreeItem& operator = (const CFileTreeItem& item); | ||
|
||
public: | ||
CString m_strDirectoryName; | ||
CFileDescriptorBaseArray m_FileList; | ||
}; | ||
|
||
// CFileTree | ||
typedef CArray<CFileTreeItem, const CFileTreeItem&> CFileTree; | ||
|
||
CFileTree m_FileTree; | ||
}; | ||
|
||
// CDatFile1 | ||
class CDatFile1 : public CDatFileBase { | ||
public: | ||
CDatFile1(); | ||
virtual ~CDatFile1(); | ||
|
||
DECLARE_DYNAMIC(CDatFile1) | ||
|
||
virtual BOOL Open(LPCTSTR lpszFileName, UINT nOpenFlags); | ||
virtual void Close(); | ||
virtual void Flush(); | ||
|
||
virtual INT_PTR GetFileCount(); | ||
virtual CFileDescriptorBase operator [] (INT_PTR nIndex) const; | ||
|
||
virtual INT_PTR FindNext(); | ||
|
||
virtual BOOL Inflate(CArchive& ar); | ||
virtual BOOL Deflate(CArchive& ar, DWORD dwLength, LPCTSTR lpszName, int level); | ||
virtual BOOL Delete(); | ||
virtual BOOL Shrink(void (*pCallback)(INT_PTR nIndex)); | ||
|
||
private: | ||
void FreeSpaceForCatalog(); | ||
|
||
private: | ||
// Restricted operations | ||
CDatFile1(const CDatFile1&); | ||
CDatFile1& operator = (const CDatFile1&); | ||
virtual void Serialize(CArchive&) {}; | ||
|
||
private: | ||
CFileList1 m_FileList; | ||
}; |
Oops, something went wrong.