V-Gears 0
Free Final Fantasy VII engine.
LzsFile Class Reference

Represents an LZS file. More...

#include <LzsFile.h>

Inheritance diagram for LzsFile:
Collaboration diagram for LzsFile:

Public Member Functions

 LzsFile (const Ogre::String &file)
 Opens a lzs file and extracts it's contents. More...
 
 LzsFile (File *file)
 Opens a lzs file and extracts it's contents. More...
 
 LzsFile (File *file, u32 offset, u32 length)
 Opens a lzs file fragment and extracts it's contents. More...
 
 LzsFile (const u8 *buffer, u32 offset, u32 length)
 Opens a lzs file fragment from a buffer and extracts it's contents. More...
 
virtual ~LzsFile ()
 Destructor. More...
 
- Public Member Functions inherited from File
 File (const Ogre::String &file)
 Opens a file. More...
 
 File (const File *file)
 Opens a file. More...
 
 File (const File *file, u32 offset, u32 length)
 Loads a file fragment. More...
 
 File (const u8 *buffer, u32 offset, u32 length)
 Loads a file fragment from a buffer. More...
 
virtual ~File ()
 Destructor. More...
 
void WriteFile (const Ogre::String &file) const
 Writes the contents of the buffer to a file. More...
 
const Ogre::String & GetFileName () const
 Retrieves the file name. More...
 
u32 GetFileSize () const
 Retrieves the file size. More...
 
void GetFileBuffer (u8 *buffer, const u32 &start, const u32 &length) const
 Loads a buffer with the file data. More...
 
u8 GetU8 (u32 offset) const
 Retrieves a pointer to a byte address in the file. More...
 
u16 GetU16LE (u32 offset) const
 Retrieves a pointer to a two-byte address in the file. More...
 
u32 GetU32LE (u32 offset) const
 Retrieves a pointer to a four-byte address in the file. More...
 
u8 readU8 ()
 Reads a byte from the file. More...
 
u16 readU16LE ()
 Reads two bytes from the file (little endian). More...
 
u32 readU32LE ()
 Reads four bytes from the file (little endian). More...
 
u32 GetCurrentOffset ()
 Checks the current offset of the file. More...
 
void SetOffset (u32 offset)
 Sets the file offset for reading. More...
 

Private Member Functions

void ExtractLzs ()
 Extracts the file contents to the buffer. More...
 

Friends

class LzsBuffer
 

Additional Inherited Members

- Protected Attributes inherited from File
Ogre::String file_name_
 The file name. More...
 
u32 offset_ = 0
 Current offset of the file. More...
 
u8buffer_
 The file buffer. More...
 
u32 buffer_size_
 The allocated size of {. More...
 

Detailed Description

Represents an LZS file.

More info about lzs fromat: https://wiki.ffrtt.ru/index.php?title=FF7/LZSS_format

Constructor & Destructor Documentation

◆ LzsFile() [1/4]

LzsFile::LzsFile ( const Ogre::String &  file)

Opens a lzs file and extracts it's contents.

Parameters
[in]filePath to the file.

◆ LzsFile() [2/4]

LzsFile::LzsFile ( File file)

Opens a lzs file and extracts it's contents.

Parameters
[in]filePointer to the file.

◆ LzsFile() [3/4]

LzsFile::LzsFile ( File file,
u32  offset,
u32  length 
)

Opens a lzs file fragment and extracts it's contents.

Parameters
[in]filePath to the file.
[in]offsetOffset to the file contents a which to start reading.
[in]lengthLength of the data to read from the file, in bytes.

◆ LzsFile() [4/4]

LzsFile::LzsFile ( const u8 buffer,
u32  offset,
u32  length 
)

Opens a lzs file fragment from a buffer and extracts it's contents.

Parameters
[in]bufferPointer to the buffer which holds the data.
[in]offsetOffset to the buffer contents a which to start reading.
[in]lengthLength of the data to read, in bytes.

◆ ~LzsFile()

LzsFile::~LzsFile ( )
virtual

Destructor.

Member Function Documentation

◆ ExtractLzs()

void LzsFile::ExtractLzs ( )
private

Extracts the file contents to the buffer.

Friends And Related Function Documentation

◆ LzsBuffer

friend class LzsBuffer
friend

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