WoW Model Viewer
Your premiere tool for viewing, equipping and animating World of Warcraft models.
Loading...
Searching...
No Matches
CASCFile Class Reference

GameFile implementation that reads from a CASC storage archive. More...

#include <CASCFile.h>

Inheritance diagram for CASCFile:
[legend]
Collaboration diagram for CASCFile:
[legend]

Public Member Functions

 CASCFile (std::string path, int id=-1)
 
 ~CASCFile ()
 
size_t read (void *dest, size_t bytes)
 Read bytes from the file into dest.
 
void seek (size_t offset)
 Seek to an absolute byte offset.
 
void dumpStructure ()
 
- Public Member Functions inherited from GameFile
 GameFile (std::string path, int id=-1)
 
virtual ~GameFile ()=default
 
size_t getSize ()
 Total size of the file in bytes.
 
size_t getPos ()
 Current read position.
 
unsigned char * getBuffer () const
 Pointer to the start of the internal buffer.
 
unsigned char * getPointer ()
 Pointer to the current read position within the buffer.
 
bool isEof ()
 True if the read pointer has reached the end of the file.
 
void seekRelative (size_t offset)
 Advance the read pointer by offset bytes.
 
bool open (bool useMemoryBuffer=true)
 Open the file, optionally loading into a memory buffer.
 
bool close ()
 Close the file and release the internal buffer.
 
void setFullName (const std::string &name)
 
const std::string & fullname () const
 
int fileDataId ()
 
void allocate (unsigned long long size)
 Allocate (or reallocate) the internal buffer to the given size.
 
bool setChunk (std::string chunkName, bool resetToStart=true)
 Switch the active read window to the named chunk.
 
bool isChunked ()
 True if the file has been parsed into named chunks.
 
- Public Member Functions inherited from Component
 Component ()
 
virtual ~Component ()
 
virtual bool addChild (Component *)
 Add a child component to this node.
 
virtual bool removeChild (Component *)
 Remove a child component from this node.
 
virtual void removeAllChildren ()
 
virtual unsigned int nbChildren () const
 
virtual bool findChildComponent (Component *, bool)
 
virtual ComponentgetChild (unsigned int)
 
virtual const ComponentgetChild (unsigned int) const
 
void setParentComponent (Component *)
 Set the parent of this component.
 
virtual void onParentSet (Component *)
 Called after the parent has been set; override for custom logic.
 
const Componentparent () const
 Get the parent component (const).
 
Componentparent ()
 Get the parent component.
 
template<class DataType >
const DataType * firstParentOfType ()
 Walk up the parent chain and return the first ancestor of the given type.
 
void ref ()
 Increment the reference counter.
 
void unref ()
 Decrement the reference counter; deletes this when it reaches zero.
 
void setName (const std::string &name)
 
std::string name () const
 
virtual void onNameChanged ()
 
void print (int l_depth=0)
 
virtual void doPrint ()
 
void copy (const Component &component, bool)
 

Protected Member Functions

virtual bool openFile ()
 
virtual bool isAlreadyOpened ()
 
virtual bool getFileSize (unsigned long long &s)
 
virtual unsigned long readFile ()
 
virtual void doPostOpenOperation ()
 
virtual bool doPostCloseOperation ()
 

Private Attributes

HANDLE m_handle
 

Additional Inherited Members

- Protected Attributes inherited from GameFile
bool eof
 
unsigned char * buffer
 
unsigned long long pointer
 
unsigned long long size
 
std::string filepath
 
int m_fileDataId
 
std::vector< Chunkchunks
 
bool m_useMemoryBuffer
 

Detailed Description

GameFile implementation that reads from a CASC storage archive.

Definition at line 19 of file CASCFile.h.

Constructor & Destructor Documentation

◆ CASCFile()

CASCFile::CASCFile ( std::string  path,
int  id = -1 
)

Definition at line 13 of file CASCFile.cpp.

◆ ~CASCFile()

CASCFile::~CASCFile ( )

Definition at line 17 of file CASCFile.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ doPostCloseOperation()

bool CASCFile::doPostCloseOperation ( )
protectedvirtual

Implements GameFile.

Reimplemented in HardDriveFile.

Definition at line 117 of file CASCFile.cpp.

◆ doPostOpenOperation()

void CASCFile::doPostOpenOperation ( )
protectedvirtual

Implements GameFile.

Definition at line 97 of file CASCFile.cpp.

Here is the call graph for this function:

◆ dumpStructure()

void CASCFile::dumpStructure ( )
virtual

Reimplemented from GameFile.

Definition at line 139 of file CASCFile.cpp.

Here is the call graph for this function:

◆ getFileSize()

bool CASCFile::getFileSize ( unsigned long long &  s)
protectedvirtual

Implements GameFile.

Reimplemented in HardDriveFile.

Definition at line 70 of file CASCFile.cpp.

◆ isAlreadyOpened()

bool CASCFile::isAlreadyOpened ( )
protectedvirtual

Implements GameFile.

Reimplemented in HardDriveFile.

Definition at line 62 of file CASCFile.cpp.

◆ openFile()

bool CASCFile::openFile ( )
protectedvirtual

Implements GameFile.

Reimplemented in HardDriveFile.

Definition at line 51 of file CASCFile.cpp.

◆ read()

size_t CASCFile::read ( void *  dest,
size_t  bytes 
)
virtual

Read bytes from the file into dest.

Returns
Number of bytes actually read.

Reimplemented from GameFile.

Definition at line 22 of file CASCFile.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readFile()

unsigned long CASCFile::readFile ( )
protectedvirtual

Implements GameFile.

Reimplemented in HardDriveFile.

Definition at line 87 of file CASCFile.cpp.

◆ seek()

void CASCFile::seek ( size_t  offset)
virtual

Seek to an absolute byte offset.

Reimplemented from GameFile.

Definition at line 38 of file CASCFile.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_handle

HANDLE CASCFile::m_handle
private

Definition at line 39 of file CASCFile.h.


The documentation for this class was generated from the following files: