![]() |
Crossfire Server, Trunk
1.75.0
|
Assets collector, recursing in directories and calling loaders on found files. More...
#include <AssetCollector.h>
Inheritance diagram for AssetCollector:
Collaboration diagram for AssetCollector:Public Member Functions | |
| void | addLoader (AssetLoader *loader) |
| Register a loader to be called on found files. More... | |
| AssetCollector () | |
| Constructor. More... | |
| void | collect (const std::string &directory) |
| Recurse in the specified directory, finding all files and calling loaders to process them. More... | |
| virtual void | load (BufferReader *reader, const std::string &filename) override |
| Load assets from the specified reader. More... | |
| virtual bool | willLoad (const std::string &) override |
| Whether this instance will process or not the specified file. More... | |
| virtual | ~AssetCollector () |
| Destructor. More... | |
Public Member Functions inherited from AssetLoader | |
| virtual | ~AssetLoader () |
| Virtual destructor for inheritance. More... | |
Protected Member Functions | |
| void | processFiles (const std::vector< std::string > &files) |
| Process a list of files. More... | |
Protected Attributes | |
| std::vector< AssetLoader * > | m_loaders |
| Registered loaders. More... | |
| BufferReader * | m_reader |
| Reader used to load files. More... | |
Assets collector, recursing in directories and calling loaders on found files.
It inherits AssetLoader to be used with TarLoader.
Definition at line 23 of file AssetCollector.h.
| AssetCollector::AssetCollector | ( | ) |
Constructor.
Definition at line 34 of file AssetCollector.cpp.
References bufferreader_create(), and m_reader.
Here is the call graph for this function:
|
virtual |
Destructor.
Definition at line 38 of file AssetCollector.cpp.
References bufferreader_destroy(), m_loaders, and m_reader.
Here is the call graph for this function:
|
inline |
Register a loader to be called on found files.
Ownership of the loader is taken by the AssetCollector.
| loader | instance to register. |
Definition at line 39 of file AssetCollector.h.
References m_loaders.
Referenced by assets_collect().
Here is the caller graph for this function:| void AssetCollector::collect | ( | const std::string & | directory | ) |
Recurse in the specified directory, finding all files and calling loaders to process them.
| directory | starting path, with or without a trailing slash. |
Definition at line 59 of file AssetCollector.cpp.
References closedir(), d, opendir(), processFiles(), readdir(), and is_valid_types_gen::type.
Referenced by assets_collect().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
Load assets from the specified reader.
| reader | reader. |
| filename | full filename. |
Implements AssetLoader.
Definition at line 96 of file AssetCollector.cpp.
References m_loaders.
|
protected |
Process a list of files.
| files | full path of files to process. |
Definition at line 45 of file AssetCollector.cpp.
References bufferreader_init_from_file(), files, llevError, m_loaders, and m_reader.
Referenced by collect().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineoverridevirtual |
Whether this instance will process or not the specified file.
| filename | full file path. |
Implements AssetLoader.
Definition at line 47 of file AssetCollector.h.
|
protected |
Registered loaders.
Definition at line 54 of file AssetCollector.h.
Referenced by addLoader(), load(), processFiles(), and ~AssetCollector().
|
protected |
Reader used to load files.
Definition at line 55 of file AssetCollector.h.
Referenced by AssetCollector(), processFiles(), and ~AssetCollector().