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

GameFolder implementation backed by a CASC archive. More...

#include <WoWFolder.h>

Inheritance diagram for wow::WoWFolder:
[legend]
Collaboration diagram for wow::WoWFolder:
[legend]

Public Member Functions

 WoWFolder (const std::string &path)
 
virtual ~WoWFolder ()
 
void init () override
 
void initFromListfile (const std::string &file) override
 
void addCustomFiles (const std::string &path, bool bypassOriginalFiles) override
 
GameFilegetFile (int id) override
 
bool openFile (int id, HANDLE *result) override
 
bool openFile (std::string file, HANDLE *result) override
 
std::string version () override
 
int majorVersion () override
 
std::string locale () override
 
bool setConfig (core::GameConfig config) override
 
std::vector< core::GameConfigconfigsFound () override
 
int lastError () override
 
void onChildAdded (GameFile *) override
 
void onChildRemoved (GameFile *) override
 
std::string fileName (int id)
 
int fileID (const std::string &fileName)
 
- Public Member Functions inherited from core::GameFolder
 GameFolder (std::string path)
 
virtual ~GameFolder ()
 
std::string getFullPathForFile (const std::string &file)
 
void getFilesForFolder (std::vector< GameFile * > &fileNames, const std::string &folderPath, const std::string &extension="")
 
void getFilteredFiles (std::set< GameFile * > &dest, const std::string &filter)
 
GameFilegetFile (const std::string &filename)
 
virtual bool openFile (std::string file, void **result)=0
 
virtual bool openFile (int id, void **result)=0
 
const std::string & path () const
 
void setProgressCallback (ProgressCallback cb)
 
- Public Member Functions inherited from Container< GameFile >
 Container ()
 
virtual ~Container ()
 
virtual bool addChild (GameFile *child)
 
virtual bool removeChild (GameFile *child)
 
void removeAllChildren ()
 
int removeAllChildrenOfType ()
 
unsigned int nbChildren () const
 
bool findChildComponent (Component *child, bool recursive=false)
 
ComponentgetChild (unsigned int index)
 
const ComponentgetChild (unsigned int index) const
 
iterator begin ()
 
iterator end ()
 
- 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.
 
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)
 

Private Attributes

CASCFolder m_CASCFolder
 
std::map< int, GameFile * > m_idMap
 
std::map< int, std::string > m_idNameMap
 
std::map< std::string, int > m_nameIdMap
 

Additional Inherited Members

- Public Types inherited from Container< GameFile >
typedef std::unordered_set< GameFile * >::iterator iterator
 
- Protected Attributes inherited from core::GameFolder
ProgressCallback m_progressCallback
 

Detailed Description

GameFolder implementation backed by a CASC archive.

Wraps CASCFolder to provide file lookup by name and by FileDataID, listfile loading, and custom-file overlay.

Definition at line 14 of file WoWFolder.h.

Constructor & Destructor Documentation

◆ WoWFolder()

wow::WoWFolder::WoWFolder ( const std::string &  path)

Definition at line 12 of file WoWFolder.cpp.

◆ ~WoWFolder()

virtual wow::WoWFolder::~WoWFolder ( )
inlinevirtual

Definition at line 19 of file WoWFolder.h.

Member Function Documentation

◆ addCustomFiles()

void wow::WoWFolder::addCustomFiles ( const std::string &  path,
bool  bypassOriginalFiles 
)
overridevirtual

Implements core::GameFolder.

Definition at line 64 of file WoWFolder.cpp.

Here is the call graph for this function:

◆ configsFound()

std::vector< core::GameConfig > wow::WoWFolder::configsFound ( )
overridevirtual

Implements core::GameFolder.

Definition at line 185 of file WoWFolder.cpp.

◆ fileID()

int wow::WoWFolder::fileID ( const std::string &  fileName)

Definition at line 215 of file WoWFolder.cpp.

◆ fileName()

std::string wow::WoWFolder::fileName ( int  id)

Definition at line 207 of file WoWFolder.cpp.

◆ getFile()

GameFile * wow::WoWFolder::getFile ( int  id)
overridevirtual

Implements core::GameFolder.

Definition at line 119 of file WoWFolder.cpp.

Here is the call graph for this function:

◆ init()

void wow::WoWFolder::init ( )
overridevirtual

Implements core::GameFolder.

Definition at line 16 of file WoWFolder.cpp.

◆ initFromListfile()

void wow::WoWFolder::initFromListfile ( const std::string &  file)
overridevirtual

Implements core::GameFolder.

Definition at line 21 of file WoWFolder.cpp.

Here is the call graph for this function:

◆ lastError()

int wow::WoWFolder::lastError ( )
overridevirtual

Implements core::GameFolder.

Definition at line 190 of file WoWFolder.cpp.

◆ locale()

std::string wow::WoWFolder::locale ( )
overridevirtual

Implements core::GameFolder.

Definition at line 175 of file WoWFolder.cpp.

◆ majorVersion()

int wow::WoWFolder::majorVersion ( )
overridevirtual

Implements core::GameFolder.

Definition at line 169 of file WoWFolder.cpp.

Here is the call graph for this function:

◆ onChildAdded()

void wow::WoWFolder::onChildAdded ( GameFile child)
overridevirtual

Reimplemented from core::GameFolder.

Definition at line 195 of file WoWFolder.cpp.

Here is the call graph for this function:

◆ onChildRemoved()

void wow::WoWFolder::onChildRemoved ( GameFile child)
overridevirtual

Reimplemented from core::GameFolder.

Definition at line 201 of file WoWFolder.cpp.

Here is the call graph for this function:

◆ openFile() [1/2]

bool wow::WoWFolder::openFile ( int  id,
HANDLE *  result 
)
override

Definition at line 151 of file WoWFolder.cpp.

Here is the call graph for this function:

◆ openFile() [2/2]

bool wow::WoWFolder::openFile ( std::string  file,
HANDLE *  result 
)
override

Definition at line 156 of file WoWFolder.cpp.

◆ setConfig()

bool wow::WoWFolder::setConfig ( core::GameConfig  config)
overridevirtual

Implements core::GameFolder.

Definition at line 180 of file WoWFolder.cpp.

◆ version()

std::string wow::WoWFolder::version ( )
overridevirtual

Implements core::GameFolder.

Definition at line 164 of file WoWFolder.cpp.

Member Data Documentation

◆ m_CASCFolder

CASCFolder wow::WoWFolder::m_CASCFolder
private

Definition at line 46 of file WoWFolder.h.

◆ m_idMap

std::map<int, GameFile*> wow::WoWFolder::m_idMap
private

Definition at line 47 of file WoWFolder.h.

◆ m_idNameMap

std::map<int, std::string> wow::WoWFolder::m_idNameMap
private

Definition at line 48 of file WoWFolder.h.

◆ m_nameIdMap

std::map<std::string, int> wow::WoWFolder::m_nameIdMap
private

Definition at line 49 of file WoWFolder.h.


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