mirror of
https://github.com/ondra-novak/gates_of_skeldal.git
synced 2025-07-09 16:10:27 -04:00
github publish
This commit is contained in:
commit
506e23bf32
542 changed files with 120675 additions and 0 deletions
45
DDLReader/DDLFile.h
Normal file
45
DDLReader/DDLFile.h
Normal file
|
@ -0,0 +1,45 @@
|
|||
#pragma once
|
||||
|
||||
#include "WString.h"
|
||||
|
||||
class IDDLFileEnumerator
|
||||
{
|
||||
public:
|
||||
virtual bool File(WString name, int group, unsigned long offset)=0;
|
||||
};
|
||||
|
||||
struct DDLData
|
||||
{
|
||||
void *data;
|
||||
size_t sz;
|
||||
|
||||
DDLData():data(0),sz(0) {}
|
||||
~DDLData() {free(data);}
|
||||
DDLData(const DDLData &other):data(other.data),sz(other.sz)
|
||||
{
|
||||
DDLData &dother=const_cast<DDLData &>(other);
|
||||
dother.data=0;dother.sz=0;
|
||||
}
|
||||
DDLData& operator =(const DDLData &other)
|
||||
{
|
||||
DDLData &dother=const_cast<DDLData &>(other);
|
||||
data=other.data;sz=other.sz;
|
||||
dother.data=0;dother.sz=0;
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
class DDLFile
|
||||
{
|
||||
HANDLE _hFile;
|
||||
|
||||
bool ReadFile(void *data, size_t sz);
|
||||
public:
|
||||
DDLFile(void);
|
||||
~DDLFile(void);
|
||||
|
||||
bool OpenDDLFile(WString filename);
|
||||
bool EnumFiles(IDDLFileEnumerator &enmClass);
|
||||
DDLData ExtractFile(unsigned long offset);
|
||||
unsigned long GetFileSize(unsigned long offset);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue