OpenEnroth 73e68f7
|
#include <LodReader.h>
Classes | |
struct | LodRegion |
Public Member Functions | |
LodReader () | |
LodReader (std::string_view path, LodOpenFlags openFlags=0) | |
LodReader (Blob blob, LodOpenFlags openFlags=0) | |
~LodReader () | |
void | open (std::string_view path, LodOpenFlags openFlags=0) |
void | open (Blob blob, LodOpenFlags openFlags=0) |
void | close () |
bool | isOpen () const |
bool | exists (std::string_view filename) const |
Blob | read (std::string_view filename) const |
std::vector< std::string > | ls () const |
const LodInfo & | info () const |
Private Attributes | |
Blob | _lod |
LodInfo | _info |
std::unordered_map< std::string, LodRegion > | _files |
A single stop shop to read LOD files. Even though LODs support a multi-directory structure, in reality vanilla games only ever had a single directory each.
Given that we don't plan to expand the LOD format support, when resolving the files this class always looks into the first available directory, which is consistent with the vanilla behaviour.
|
default |
LodReader::LodReader | ( | std::string_view | path, |
LodOpenFlags | openFlags = 0 |
||
) |
LodReader::LodReader | ( | Blob | blob, |
LodOpenFlags | openFlags = 0 |
||
) |
LodReader::~LodReader | ( | ) |
void LodReader::close | ( | ) |
Closes this LOD reader & frees all associated resources.
bool LodReader::exists | ( | std::string_view | filename | ) | const |
filename | Name of the LOD file entry. |
const LodInfo & LodReader::info | ( | ) | const |
|
inline |
std::vector< std::string > LodReader::ls | ( | ) | const |
void LodReader::open | ( | Blob | blob, |
LodOpenFlags | openFlags = 0 |
||
) |
blob | LOD data. |
openFlags | Open flags. |
Exception | If there are errors in the provided LOD file. |
void LodReader::open | ( | std::string_view | path, |
LodOpenFlags | openFlags = 0 |
||
) |
path | Path to the LOD file to open for reading. |
openFlags | Open flags. |
Exception | If the LOD couldn't be opened - e.g., if the file doesn't exist, or if it's not a LOD. |
Blob LodReader::read | ( | std::string_view | filename | ) | const |
|
private |
|
private |
|
private |