Wrapper on file system.
class CCryFile;
CryFile.h
~CCryFile();
CCryFile implementation.
CCryFile();
CCryFile(ICryPak * pIPak);
allow an alternative ICryPak interface
CCryFile(const char * filename, const char * mode);
void Close();
Flushes any data yet to be written.
void Flush();
const char* GetAdjustedFilename() const;
Retrieves the filename after adjustment to the real relative to engine root path.
Original filename "textures/red.dds" adjusted filename will look like "game/textures/red.dds" Return: Adjusted filename, this is a pointer to a static string, copy return value if you want to keep it.
const char* GetFilename() const;
Retrieves the filename of the selected file.
Gets a handle to a pack object.
FILE* GetHandle() const;
Retrieves the length of the file.
size_t GetLength();
Gets path of archive this file is in.
const char* GetPakPath() const;
Retrieves the current file pointer.
size_t GetPosition();
Tests for end-of-file on a selected file.
bool IsEof();
Checks if file is opened from pak file.
bool IsInPak() const;
bool Open(const char * filename, const char * mode, int nOpenFlagsEx = 0);
Notes: For nOpenFlagsEx see ICryPak::EFOpenFlags
Reads data from a file at the current file position.
size_t ReadRaw(void * lpBuf, size_t nSize);
Automatic endian-swapping version.
template <class T> inline size_t ReadType(T * pDest, size_t nCount = 1);
Template version, for automatic size support.
template <class T> inline size_t ReadTypeRaw(T * pDest, size_t nCount = 1);
Moves the current file pointer to the specified position.
size_t Seek(size_t seek, int mode);
Moves the current file pointer at the beginning of the file.
void SeekToBegin();
Moves the current file pointer at the end of the file.
size_t SeekToEnd();
Writes data in a file to the current file position.
size_t Write(const void * lpBuf, size_t nSize);