18#include <OgreString.h>
94 u8* buffer,
const u32 &start,
const u32 &length
Ogre::uint16 u16
Definition: TypeDefine.h:22
Ogre::uint32 u32
Definition: TypeDefine.h:23
Ogre::uint8 u8
Definition: TypeDefine.h:21
Represents a file.
Definition: File.h:24
u8 * buffer_
The file buffer.
Definition: File.h:191
u16 readU16LE()
Reads two bytes from the file (little endian).
Definition: File.cpp:94
Ogre::String file_name_
The file name.
Definition: File.h:174
u32 GetU32LE(u32 offset) const
Retrieves a pointer to a four-byte address in the file.
Definition: File.cpp:80
u16 GetU16LE(u32 offset) const
Retrieves a pointer to a two-byte address in the file.
Definition: File.cpp:76
void GetFileBuffer(u8 *buffer, const u32 &start, const u32 &length) const
Loads a buffer with the file data.
Definition: File.cpp:70
u32 readU32LE()
Reads four bytes from the file (little endian).
Definition: File.cpp:100
const Ogre::String & GetFileName() const
Retrieves the file name.
Definition: File.cpp:66
u32 offset_
Current offset of the file.
Definition: File.h:184
File(const Ogre::String &file)
Opens a file.
Definition: File.cpp:22
u32 buffer_size_
The allocated size of {.
Definition: File.h:196
u32 GetCurrentOffset()
Checks the current offset of the file.
Definition: File.cpp:106
void WriteFile(const Ogre::String &file) const
Writes the contents of the buffer to a file.
Definition: File.cpp:62
u8 GetU8(u32 offset) const
Retrieves a pointer to a byte address in the file.
Definition: File.cpp:74
u8 readU8()
Reads a byte from the file.
Definition: File.cpp:88
virtual ~File()
Destructor.
Definition: File.cpp:60
void SetOffset(u32 offset)
Sets the file offset for reading.
Definition: File.cpp:108
u32 GetFileSize() const
Retrieves the file size.
Definition: File.cpp:68
Ogre::String String
Definition: TypeDefine.h:37