OpenEnroth 73e68f7
Loading...
Searching...
No Matches
Classes | Public Member Functions | Private Attributes | List of all members
VidReader Class Reference

#include <VidReader.h>

Classes

struct  VidRegion
 

Public Member Functions

 VidReader ()
 
 VidReader (std::string_view path)
 
 VidReader (Blob blob)
 
 ~VidReader ()
 
void open (std::string_view path)
 
void open (Blob blob)
 
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
 

Private Attributes

Blob _vid
 
std::unordered_map< std::string, VidRegion_files
 

Detailed Description

Reader for Might&Magic VID files.

Constructor & Destructor Documentation

◆ VidReader() [1/3]

VidReader::VidReader ( )
default

◆ VidReader() [2/3]

VidReader::VidReader ( std::string_view  path)
explicit

◆ VidReader() [3/3]

VidReader::VidReader ( Blob  blob)
explicit

◆ ~VidReader()

VidReader::~VidReader ( )
default

Member Function Documentation

◆ close()

void VidReader::close ( )

Closes this VID reader & frees all associated resources.

◆ exists()

bool VidReader::exists ( std::string_view  filename) const
Parameters
filenameName of the VID file entry.
Returns
Whether the file exists inside the VID. The check is case-insensitive.

◆ isOpen()

bool VidReader::isOpen ( ) const
inline

◆ ls()

std::vector< std::string > VidReader::ls ( ) const
Returns
List of all files in the VID.

◆ open() [1/2]

void VidReader::open ( Blob  blob)
Parameters
blobVID data.
Exceptions
ExceptionIf there are errors in the provided VID file.

◆ open() [2/2]

void VidReader::open ( std::string_view  path)
Parameters
pathPath to the VID file to open for reading.
Exceptions
ExceptionIf the VID couldn't be opened - e.g., if the file doesn't exist, or if it's not in VID format.

◆ read()

Blob VidReader::read ( std::string_view  filename) const
Parameters
filenameName of the VID file entry.
Returns
Contents of the file inside the VID as a Blob.
Exceptions
ExceptionIf file doesn't exist inside the VID.

Member Data Documentation

◆ _files

std::unordered_map<std::string, VidRegion> VidReader::_files
private

◆ _vid

Blob VidReader::_vid
private

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