Aeon Engine c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
AeonGames::Package Class Reference

Package Class. Implements PKG file handling routines and management. More...

#include <aeongames/Package.hpp>

Collaboration diagram for AeonGames::Package:
Collaboration graph

Public Member Functions

DLL Package (const std::string &aPath)
 Construct a Package from a file path.
DLL ~Package ()
 Destructor.
 Package (const Package &)=delete
Packageoperator= (const Package &)=delete
 Package (Package &&aPackage) noexcept
 Move constructor.
Packageoperator= (Package &&)=delete
DLL const std::filesystem::path & GetPath () const
 Get the path associated with this package.
DLL size_t GetFileSize (uint32_t crc) const
DLL size_t GetFileSize (const std::string &aFileName) const
DLL const std::unordered_map< uint32_t, std::string > & GetIndexTable () const
 Get the package index table.
DLL void LoadFile (uint32_t crc, void *buffer, size_t buffer_size) const
DLL void LoadFile (const std::string &aFileName, void *buffer, size_t buffer_size) const

Detailed Description

Package Class. Implements PKG file handling routines and management.

Definition at line 64 of file Package.hpp.

Constructor & Destructor Documentation

◆ Package() [1/2]

AeonGames::Package::Package ( const std::string & aPath)

Construct a Package from a file path.

Parameters
aPathPath to the PKG file or directory to load.

Definition at line 89 of file Package.cpp.

◆ Package() [2/2]

AeonGames::Package::Package ( Package && aPackage)
noexcept

Move constructor.

Definition at line 107 of file Package.cpp.

Member Function Documentation

◆ GetFileSize() [1/2]

size_t AeonGames::Package::GetFileSize ( const std::string & aFileName) const

Returns the file size referenced by its file name.

Definition at line 131 of file Package.cpp.

◆ GetFileSize() [2/2]

size_t AeonGames::Package::GetFileSize ( uint32_t crc) const

Returns the file size referenced by its CRC value.

Definition at line 119 of file Package.cpp.

◆ GetIndexTable()

const std::unordered_map< uint32_t, std::string > & AeonGames::Package::GetIndexTable ( ) const

Get the package index table.

Returns
const reference to the package's index table.

Definition at line 115 of file Package.cpp.

◆ GetPath()

const std::filesystem::path & AeonGames::Package::GetPath ( ) const

Get the path associated with this package.

Returns
Const reference to the package's filesystem path.

Definition at line 111 of file Package.cpp.

◆ LoadFile() [1/2]

void AeonGames::Package::LoadFile ( const std::string & aFileName,
void * buffer,
size_t buffer_size ) const

Loads a specific file referenced by its path into the provided buffer.

Definition at line 135 of file Package.cpp.

◆ LoadFile() [2/2]

void AeonGames::Package::LoadFile ( uint32_t crc,
void * buffer,
size_t buffer_size ) const

Loads a specific file referenced by its CRC into the provided buffer.

Definition at line 139 of file Package.cpp.


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