helper class for reading binary files
More...
#include <FileIo.h>
|
| CFileUnpacker () |
|
| ~CFileUnpacker () |
|
void | Read (const VfsPath &filename, const char magic[4]) |
| open and read in given file, check magic bits against those given; throw variety of exceptions if open failed / version incorrect, etc. More...
|
|
u32 | GetVersion () const |
|
void | UnpackRaw (void *rawData, size_t rawDataSize) |
| unpack given number of bytes from the input into the given array. More...
|
|
size_t | UnpackSize () |
| use UnpackRaw to retrieve 32-bits; returns their value as size_t after converting from little endian to native byte order. More...
|
|
void | UnpackString (CStr8 &result) |
| unpack a string from the raw data stream. More...
|
|
helper class for reading binary files
◆ CFileUnpacker()
CFileUnpacker::CFileUnpacker |
( |
| ) |
|
◆ ~CFileUnpacker()
CFileUnpacker::~CFileUnpacker |
( |
| ) |
|
◆ GetVersion()
u32 CFileUnpacker::GetVersion |
( |
| ) |
const |
|
inline |
- Returns
- version number that was stored in the file's header.
◆ Read()
void CFileUnpacker::Read |
( |
const VfsPath & |
filename, |
|
|
const char |
magic[4] |
|
) |
| |
open and read in given file, check magic bits against those given; throw variety of exceptions if open failed / version incorrect, etc.
◆ UnpackRaw()
void CFileUnpacker::UnpackRaw |
( |
void * |
rawData, |
|
|
size_t |
rawDataSize |
|
) |
| |
unpack given number of bytes from the input into the given array.
throws PSERROR_File_UnexpectedEOF if the end of the data stream is reached before the given number of bytes have been read.
◆ UnpackSize()
size_t CFileUnpacker::UnpackSize |
( |
| ) |
|
use UnpackRaw to retrieve 32-bits; returns their value as size_t after converting from little endian to native byte order.
◆ UnpackString()
void CFileUnpacker::UnpackString |
( |
CStr8 & |
result | ) |
|
unpack a string from the raw data stream.
- Parameters
-
result | is assigned a newly constructed CStr8 holding the string read from the input stream. |
◆ m_buf
std::shared_ptr<u8> CFileUnpacker::m_buf |
|
private |
◆ m_bufSize
size_t CFileUnpacker::m_bufSize |
|
private |
◆ m_unpackPos
size_t CFileUnpacker::m_unpackPos |
|
private |
◆ m_version
u32 CFileUnpacker::m_version |
|
private |
current unpack position in stream
The documentation for this class was generated from the following files:
- /home/docker/jenkins/workspace/technical-docs/source/ps/FileIo.h
- /home/docker/jenkins/workspace/technical-docs/source/ps/FileIo.cpp