Resource::DatabasePackedFile class

A DatabasePackedFile is a type of file used in Spore to store and index multiple files inside a single container (usually in the .package extension).

This class contains all the necessary methods for accessing files and loading/saving DBPF files.

Base classes

class IResourceContainer
class Object
This class represents a basic reference counted object.

Public static variables

static const uint32_t kDefaultType
static const uint32_t TYPE

Constructors, destructors, conversion operators

DatabasePackedFile(const char16_t* pPath, ICoreAllocator* pAllocator)
~DatabasePackedFile() virtual

Public functions

auto AddRef() -> int override
auto Release() -> int override
auto Cast(uint32_t type) const -> void* override
auto NeedsToRelease() -> bool virtual
auto ReleaseResources() -> bool virtual
auto GetType() const -> uint32_t virtual
auto GetReferenceCount() const -> int virtual
auto UseIndexMutex(bool bLock) -> int virtual
auto Load(int nDesiredAccess = IO::kAccessFlagRead, int nCreateDisposition = IO::kCDDefault, bool arg_8 = false) -> bool virtual
auto Save() -> bool virtual
auto GetAccessFlags() const -> int virtual
auto Write() -> bool virtual
auto GetPath() const -> char16_t* virtual
auto SetPath(const char16_t* path) -> bool virtual
auto GetFiles(vector<ResourceKey>& dstVector, IResourceFilter* filter = nullptr) -> size_t virtual
auto GetFile(const ResourceKey& name, IPFRecord** ppDst, int nDesiredAccess = IO::kAccessFlagRead, int nCreateDisposition = IO::kCDDefault, bool arg_10 = true, DBPFItem* pDstInfo = nullptr) -> bool virtual
auto func38h(int) -> int virtual
auto func3Ch(IPFRecord* pRecord) -> bool virtual
auto RemoveFile(ResourceKey& name) -> bool virtual
auto SetResourceManager(bool, cResourceManager* pResourceMan, bool) -> bool virtual
auto GetAllocator() const -> ICoreAllocator* virtual
auto GetStream() -> IO::IStream* virtual
auto SetStream(IO::IStream* pStream) -> bool virtual

Public variables

EAIOZoneObject_AMBIGOUS_DECLARATION

Protected types

struct Unknown

Protected functions

auto CreatePFRecordRead(int nDesiredAccess, DBPFItem* info, ResourceKey& key) -> PFRecordRead* virtual
auto CreatePFRecordReadCopy(int nDesiredAccess, PFRecordRead* pOther, ResourceKey& key) -> PFRecordRead* virtual
auto CreatePFRecordWriteData(int nDesiredAccess, void* pData, size_t nSize, ResourceKey& key) -> PFRecordWrite* virtual
auto CreatePFRecordWrite(int nDesiredAccess, size_t nChunkOffset, size_t nSize, ResourceKey& key) -> PFRecordWrite* virtual
auto Read() -> bool virtual
auto ReadHeader() -> bool virtual
auto Reset() -> bool virtual
auto IsReadyForWrite() -> bool virtual
auto IsValidHeader(char* header) -> bool virtual
auto ReadIndex() -> bool virtual
auto WriteIndex() -> bool virtual
auto StreamCanContainFileData() -> bool virtual
Tells whether the file stream has enough space to fit the data of the index files.
auto CreatePFIndexModifiable(int nDesiredAccess = IO::kAccessFlagReadWrite) -> PFIndexModifiable* virtual
void ReleaseObject(IO::EAIOZoneObject* pObject) virtual
void RenovateIndex() virtual
Creates a new index that has the same information as the current one, which will be deleted.
auto func90h() -> bool virtual
auto ReadBytes(void* pDst, size_t nSize) -> int
auto ReadData(void* pDst, size_t nChunkOffset, size_t nSize) -> bool

Protected variables

int mnRefCount
bool mbNeedsToRelease
ICoreAllocator* mpAllocator
int mnFileAccess
int field_18
bool field_1C
bool field_1D
string16 mFilePath
IO::FileStream mFileStream
size_t mFileOffset
intrusive_ptr<IO::IStream> mpCurrentStream
char* mpDataBuffer
size_t mpBufferSize
size_t mnBufferOffset
Mutex mIndexMutex
Mutex mReadWriteMutex
PFIndexModifiable* mpIndex
bool field_2D4
int field_2D8
int field_2DC
bool field_2E0
float field_2E4
map<ResourceKey, IPFRecord*, less<ResourceKey>, ICoreAllocatorAdapter> field_2E8
int field_308
int field_30C
int field_310
int field_314
int field_318
int field_31C
int field_320
size_t mnIndexOffset
size_t mnIndexCount
size_t mnIndexSize
bool field_330
int field_334
float field_338
Unknown field_33C
Unknown field_35C
bool field_37C
bool field_37D
cResourceManager* mpResourceMan
int field_384