Nirtcpp 2.1.0
Nirtcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
nirt::io::IArchiveLoader Class Referenceabstract

Class which is able to create an archive from a file. More...

#include <nirtcpp/core/engine/IFileArchive.hpp>

Inheritance diagram for nirt::io::IArchiveLoader:
Inheritance graph
Collaboration diagram for nirt::io::IArchiveLoader:
Collaboration graph

Public Member Functions

virtual bool isALoadableFileFormat (const path &filename) const =0
 Check if the file might be loaded by this class.
 
virtual bool isALoadableFileFormat (io::IReadFile *file) const =0
 Check if the file might be loaded by this class.
 
virtual bool isALoadableFileFormat (E_FILE_ARCHIVE_TYPE fileType) const =0
 Check to see if the loader can create archives of this type.
 
virtual IFileArchivecreateArchive (const path &filename, bool ignoreCase, bool ignorePaths) const =0
 Creates an archive from the filename.
 
virtual IFileArchivecreateArchive (io::IReadFile *file, bool ignoreCase, bool ignorePaths) const =0
 Creates an archive from the file.
 
- Public Member Functions inherited from nirt::IReferenceCounted
 IReferenceCounted ()
 Constructor.
 
virtual ~IReferenceCounted ()
 Destructor.
 
void grab () const
 Grabs the object. Increments the reference counter by one.
 
bool drop () const
 Drops the object. Decrements the reference counter by one.
 
s32 getReferenceCount () const
 Get the reference count.
 
const c8getDebugName () const
 Returns the debug name of the object.
 

Additional Inherited Members

- Protected Member Functions inherited from nirt::IReferenceCounted
void setDebugName (const c8 *newName)
 Sets the debug name of the object.
 

Detailed Description

Class which is able to create an archive from a file.

If you want the Nirtcpp Engine be able to load archives of currently unsupported file formats (e.g .wad), then implement this and add your new Archive loader with IFileSystem::addArchiveLoader() to the engine.

Member Function Documentation

◆ createArchive() [1/2]

virtual IFileArchive * nirt::io::IArchiveLoader::createArchive ( const path filename,
bool  ignoreCase,
bool  ignorePaths 
) const
pure virtual

Creates an archive from the filename.

Parameters
filenameFile to use.
ignoreCaseSearching is performed without regarding the case
ignorePathsFiles are searched for without checking for the directories
Returns
Pointer to newly created archive, or 0 upon error.

◆ createArchive() [2/2]

virtual IFileArchive * nirt::io::IArchiveLoader::createArchive ( io::IReadFile file,
bool  ignoreCase,
bool  ignorePaths 
) const
pure virtual

Creates an archive from the file.

Parameters
fileFile handle to use.
ignoreCaseSearching is performed without regarding the case
ignorePathsFiles are searched for without checking for the directories
Returns
Pointer to newly created archive, or 0 upon error.

◆ isALoadableFileFormat() [1/3]

virtual bool nirt::io::IArchiveLoader::isALoadableFileFormat ( const path filename) const
pure virtual

Check if the file might be loaded by this class.

Check based on the file extension (e.g. ".zip")

Parameters
filenameName of file to check.
Returns
True if file seems to be loadable.

◆ isALoadableFileFormat() [2/3]

virtual bool nirt::io::IArchiveLoader::isALoadableFileFormat ( E_FILE_ARCHIVE_TYPE  fileType) const
pure virtual

Check to see if the loader can create archives of this type.

Check based on the archive type.

Parameters
fileTypeThe archive type to check.
Returns
True if the archive loader supports this type, false if not

◆ isALoadableFileFormat() [3/3]

virtual bool nirt::io::IArchiveLoader::isALoadableFileFormat ( io::IReadFile file) const
pure virtual

Check if the file might be loaded by this class.

This check may look into the file.

Parameters
fileFile handle to check.
Returns
True if file seems to be loadable.

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

Nirtcpp    @cppfx.xyz

Utxcpp    utx::print