Crossfire Server, Trunk
TarLoader Class Reference

#include <TarLoader.h>

+ Inheritance diagram for TarLoader:
+ Collaboration diagram for TarLoader:

Public Member Functions

virtual void load (BufferReader *reader, const std::string &filename) override
 
 TarLoader (AssetLoader *loader)
 
virtual bool willLoad (const std::string &filename) override
 
virtual ~TarLoader ()
 
- Public Member Functions inherited from AssetLoader
virtual ~AssetLoader ()
 

Private Attributes

AssetLoaderm_loader
 
BufferReaderm_reader
 

Detailed Description

Definition at line 8 of file TarLoader.h.

Constructor & Destructor Documentation

◆ TarLoader()

TarLoader::TarLoader ( AssetLoader loader)

Definition at line 18 of file TarLoader.cpp.

References bufferreader_create(), and m_reader.

+ Here is the call graph for this function:

◆ ~TarLoader()

TarLoader::~TarLoader ( )
virtual

Definition at line 22 of file TarLoader.cpp.

References bufferreader_destroy(), and m_reader.

+ Here is the call graph for this function:

Member Function Documentation

◆ load()

void TarLoader::load ( BufferReader reader,
const std::string &  filename 
)
overridevirtual

Load assets from the specified reader. Must be implemented.

Parameters
readerreader.
filenamefull filename.

Implements AssetLoader.

Definition at line 45 of file TarLoader.cpp.

References bufferreader_init_from_tar_file(), mtar_t::close, npc_dialog::filename, AssetLoader::load(), m_loader, m_reader, mtar_close(), MTAR_ESUCCESS, mtar_next(), mtar_read_header(), mtar_header_t::name, mtar_t::read, mtar_t::seek, mtar_t::stream, tar_close(), tar_read(), tar_seek(), and AssetLoader::willLoad().

+ Here is the call graph for this function:

◆ willLoad()

virtual bool TarLoader::willLoad ( const std::string &  filename)
inlineoverridevirtual

Whether this instance will process or not the specified file.

Parameters
filenamefull file path.
Returns
true if processFile() should be called, false else.

Implements AssetLoader.

Definition at line 13 of file TarLoader.h.

References Utils::endsWith(), and npc_dialog::filename.

+ Here is the call graph for this function:

Field Documentation

◆ m_loader

AssetLoader* TarLoader::m_loader
private

Definition at line 21 of file TarLoader.h.

Referenced by load().

◆ m_reader

BufferReader* TarLoader::m_reader
private

Definition at line 20 of file TarLoader.h.

Referenced by load(), TarLoader(), and ~TarLoader().


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