CCryFile

Wrapper on file system.

Class Hierarchy
C++
class CCryFile;
File

CryFile.h

CCryFile::~CCryFile Destructor
C++
CCryFile::CCryFile Constructor ()

CCryFile implementation.

C++
CCryFile();
CCryFile::CCryFile Constructor (ICryPak *)
C++
CCryFile(ICryPak * pIPak);
Description

allow an alternative ICryPak interface

CCryFile::CCryFile Constructor (char *, char *)
C++
CCryFile(const char * filename, const char * mode);
CCryFile::Close Method
C++
void Close();
CCryFile::Flush Method

Flushes any data yet to be written.

C++
void Flush();
CCryFile::GetAdjustedFilename Method
C++
const char* GetAdjustedFilename() const;
Description

Retrieves the filename after adjustment to the real relative to engine root path.

Example

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.

CCryFile::GetFilename Method
C++
const char* GetFilename() const;
Description

Retrieves the filename of the selected file.

CCryFile::GetHandle Method

Gets a handle to a pack object.

C++
FILE* GetHandle() const;
CCryFile::GetLength Method

Retrieves the length of the file.

C++
size_t GetLength();
CCryFile::GetPakPath Method

Gets path of archive this file is in.

C++
const char* GetPakPath() const;
CCryFile::GetPosition Method

Retrieves the current file pointer.

C++
size_t GetPosition();
CCryFile::IsEof Method

Tests for end-of-file on a selected file.

C++
bool IsEof();
CCryFile::IsInPak Method

Checks if file is opened from pak file.

C++
bool IsInPak() const;
CCryFile::Open Method
C++
bool Open(const char * filename, const char * mode, int nOpenFlagsEx = 0);
Description

Notes: For nOpenFlagsEx see ICryPak::EFOpenFlags

See Also
CCryFile::ReadRaw Method

Reads data from a file at the current file position.

C++
size_t ReadRaw(void * lpBuf, size_t nSize);
CCryFile::ReadType Method

Automatic endian-swapping version.

C++
template <class T> inline size_t ReadType(T * pDest, size_t nCount = 1);
CCryFile::ReadTypeRaw Method

Template version, for automatic size support.

C++
template <class T> inline size_t ReadTypeRaw(T * pDest, size_t nCount = 1);
CCryFile::Seek Method

Moves the current file pointer to the specified position.

C++
size_t Seek(size_t seek, int mode);
CCryFile::SeekToBegin Method

Moves the current file pointer at the beginning of the file.

C++
void SeekToBegin();
CCryFile::SeekToEnd Method

Moves the current file pointer at the end of the file.

C++
size_t SeekToEnd();
CCryFile::Write Method

Writes data in a file to the current file position.

C++
size_t Write(const void * lpBuf, size_t nSize);