WoW Model Viewer
Your premiere tool for viewing, equipping and animating World of Warcraft models.
Loading...
Searching...
No Matches
core::GameFolder Class Referenceabstract

Abstract base for game data folder backends (CASC, loose files, etc.). More...

#include <GameFolder.h>

Inheritance diagram for core::GameFolder:
[legend]
Collaboration diagram for core::GameFolder:
[legend]

Public Member Functions

 GameFolder (std::string path)
 
virtual ~GameFolder ()
 
virtual void init ()=0
 
virtual void initFromListfile (const std::string &file)=0
 
virtual void addCustomFiles (const std::string &path, bool bypassOriginalFiles)=0
 
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 GameFilegetFile (int id)=0
 
virtual bool openFile (std::string file, void **result)=0
 
virtual bool openFile (int id, void **result)=0
 
virtual std::string version ()=0
 
virtual int majorVersion ()=0
 
virtual std::string locale ()=0
 
virtual bool setConfig (GameConfig config)=0
 
virtual std::vector< GameConfigconfigsFound ()=0
 
virtual int lastError ()=0
 
virtual void onChildAdded (GameFile *) override
 
virtual void onChildRemoved (GameFile *) override
 
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)
 

Protected Attributes

ProgressCallback m_progressCallback
 

Private Attributes

std::map< std::string, GameFile * > m_nameMap
 
std::string m_path
 

Additional Inherited Members

- Public Types inherited from Container< GameFile >
typedef std::unordered_set< GameFile * >::iterator iterator
 

Detailed Description

Abstract base for game data folder backends (CASC, loose files, etc.).

Manages a collection of GameFile children and provides name- and ID-based lookup, filtering, and iteration.

Definition at line 27 of file GameFolder.h.

Constructor & Destructor Documentation

◆ GameFolder()

core::GameFolder::GameFolder ( std::string  path)
explicit

Definition at line 6 of file GameFolder.cpp.

◆ ~GameFolder()

virtual core::GameFolder::~GameFolder ( )
inlinevirtual

Definition at line 32 of file GameFolder.h.

Member Function Documentation

◆ addCustomFiles()

virtual void core::GameFolder::addCustomFiles ( const std::string &  path,
bool  bypassOriginalFiles 
)
pure virtual

Implemented in wow::WoWFolder.

◆ configsFound()

virtual std::vector< GameConfig > core::GameFolder::configsFound ( )
pure virtual

Implemented in wow::WoWFolder.

◆ getFile() [1/2]

GameFile * core::GameFolder::getFile ( const std::string &  filename)

Definition at line 60 of file GameFolder.cpp.

Here is the call graph for this function:

◆ getFile() [2/2]

virtual GameFile * core::GameFolder::getFile ( int  id)
pure virtual

Implemented in wow::WoWFolder.

◆ getFilesForFolder()

void core::GameFolder::getFilesForFolder ( std::vector< GameFile * > &  fileNames,
const std::string &  folderPath,
const std::string &  extension = "" 
)

Definition at line 22 of file GameFolder.cpp.

Here is the call graph for this function:

◆ getFilteredFiles()

void core::GameFolder::getFilteredFiles ( std::set< GameFile * > &  dest,
const std::string &  filter 
)

Definition at line 35 of file GameFolder.cpp.

◆ getFullPathForFile()

std::string core::GameFolder::getFullPathForFile ( const std::string &  file)

Definition at line 10 of file GameFolder.cpp.

Here is the call graph for this function:

◆ init()

virtual void core::GameFolder::init ( )
pure virtual

Implemented in wow::WoWFolder.

◆ initFromListfile()

virtual void core::GameFolder::initFromListfile ( const std::string &  file)
pure virtual

Implemented in wow::WoWFolder.

◆ lastError()

virtual int core::GameFolder::lastError ( )
pure virtual

Implemented in wow::WoWFolder.

◆ locale()

virtual std::string core::GameFolder::locale ( )
pure virtual

Implemented in wow::WoWFolder.

◆ majorVersion()

virtual int core::GameFolder::majorVersion ( )
pure virtual

Implemented in wow::WoWFolder.

◆ onChildAdded()

void core::GameFolder::onChildAdded ( GameFile child)
overridevirtual

Reimplemented from Container< GameFile >.

Reimplemented in wow::WoWFolder.

Definition at line 74 of file GameFolder.cpp.

Here is the call graph for this function:

◆ onChildRemoved()

void core::GameFolder::onChildRemoved ( GameFile child)
overridevirtual

Reimplemented from Container< GameFile >.

Reimplemented in wow::WoWFolder.

Definition at line 79 of file GameFolder.cpp.

Here is the call graph for this function:

◆ openFile() [1/2]

virtual bool core::GameFolder::openFile ( int  id,
void **  result 
)
pure virtual

◆ openFile() [2/2]

virtual bool core::GameFolder::openFile ( std::string  file,
void **  result 
)
pure virtual

◆ path()

const std::string & core::GameFolder::path ( ) const
inline

Definition at line 64 of file GameFolder.h.

◆ setConfig()

virtual bool core::GameFolder::setConfig ( GameConfig  config)
pure virtual

Implemented in wow::WoWFolder.

◆ setProgressCallback()

void core::GameFolder::setProgressCallback ( ProgressCallback  cb)
inline

Definition at line 66 of file GameFolder.h.

◆ version()

virtual std::string core::GameFolder::version ( )
pure virtual

Implemented in wow::WoWFolder.

Member Data Documentation

◆ m_nameMap

std::map<std::string, GameFile*> core::GameFolder::m_nameMap
private

Definition at line 72 of file GameFolder.h.

◆ m_path

std::string core::GameFolder::m_path
private

Definition at line 73 of file GameFolder.h.

◆ m_progressCallback

ProgressCallback core::GameFolder::m_progressCallback
protected

Definition at line 69 of file GameFolder.h.


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