Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
GameFileClass Class Reference

#include <W3DFileSystem.h>

Inherits FileClass.

Inherited by WBGameFileClass.

Public Member Functions

 GameFileClass (char const *filename)
 
 GameFileClass (void)
 
virtual ~GameFileClass (void)
 
virtual char const * File_Name (void) const
 
virtual char const * Set_Name (char const *filename)
 
virtual int Create (void)
 
virtual int Delete (void)
 
virtual bool Is_Available (int forced=false)
 
virtual bool Is_Open (void) const
 
virtual int Open (char const *filename, int rights=READ)
 
virtual int Open (int rights=READ)
 
virtual int Read (void *buffer, int len)
 
virtual int Seek (int pos, int dir=SEEK_CUR)
 
virtual int Size (void)
 
virtual int Write (void const *buffer, int len)
 
virtual void Close (void)
 
- Public Member Functions inherited from FileClass
virtual ~FileClass (void)
 
virtual int Tell (void)
 
virtual unsigned long Get_Date_Time (void)
 
virtual bool Set_Date_Time (unsigned long)
 
virtual void * Get_File_Handle (void)
 
 operator char const * ()
 
int Printf (char *str,...)
 
int Printf (char *buffer, int bufferSize, char *str,...)
 
int Printf_Indented (unsigned depth, char *str,...)
 
virtual ~FileClass (void)
 
virtual int Tell (void)
 
virtual unsigned long Get_Date_Time (void)
 
virtual bool Set_Date_Time (unsigned long)
 
virtual void Error (int error, int canretry=false, char const *filename=NULL)=0
 
virtual void * Get_File_Handle (void)
 
 operator char const * ()
 
int Printf (char *str,...)
 
int Printf (char *buffer, int bufferSize, char *str,...)
 
int Printf_Indented (unsigned depth, char *str,...)
 

Protected Attributes

Filem_theFile
 
Bool m_fileExists
 < The file
 
char m_filePath [_MAX_PATH]
 the file name and path (relative)
 
char m_filename [_MAX_PATH]
 The file name only.
 

Additional Inherited Members

- Public Types inherited from FileClass
enum  { READ = 1 , WRITE = 2 , PRINTF_BUFFER_SIZE = 1024 }
 
enum  { READ = 1 , WRITE = 2 , PRINTF_BUFFER_SIZE = 1024 }
 

Detailed Description

Game file access. At present this allows us to access test assets, assets from legacy GDI assets, and the current flat directory access for textures, models etc

Definition at line 49 of file W3DFileSystem.h.

Constructor & Destructor Documentation

◆ GameFileClass() [1/2]

GameFileClass::GameFileClass ( char const * filename)

Definition at line 71 of file W3DFileSystem.cpp.

◆ GameFileClass() [2/2]

GameFileClass::GameFileClass ( void )

Definition at line 86 of file W3DFileSystem.cpp.

◆ ~GameFileClass()

GameFileClass::~GameFileClass ( void )
virtual

Definition at line 98 of file W3DFileSystem.cpp.

Member Function Documentation

◆ Close()

void GameFileClass::Close ( void )
virtual

Close.

Implements FileClass.

Definition at line 436 of file W3DFileSystem.cpp.

◆ Create()

virtual int GameFileClass::Create ( void )
inlinevirtual

Implements FileClass.

Definition at line 62 of file W3DFileSystem.h.

◆ Delete()

virtual int GameFileClass::Delete ( void )
inlinevirtual

Implements FileClass.

Definition at line 63 of file W3DFileSystem.h.

◆ File_Name()

char const * GameFileClass::File_Name ( void ) const
virtual

Gets the file name

Implements FileClass.

Definition at line 108 of file W3DFileSystem.cpp.

◆ Is_Available()

bool GameFileClass::Is_Available ( int forced = false)
virtual

If we found a gdi asset, the file is available.

Implements FileClass.

Definition at line 338 of file W3DFileSystem.cpp.

◆ Is_Open()

bool GameFileClass::Is_Open ( void ) const
virtual

Is the file open.

Implements FileClass.

Definition at line 349 of file W3DFileSystem.cpp.

◆ Open() [1/2]

int GameFileClass::Open ( char const * filename,
int rights = READ )
virtual

Open the named file.

Implements FileClass.

Definition at line 357 of file W3DFileSystem.cpp.

◆ Open() [2/2]

int GameFileClass::Open ( int rights = READ)
virtual

Open the file using the current file name.

Implements FileClass.

Definition at line 369 of file W3DFileSystem.cpp.

◆ Read()

int GameFileClass::Read ( void * buffer,
int len )
virtual

Read.

Implements FileClass.

Definition at line 386 of file W3DFileSystem.cpp.

◆ Seek()

int GameFileClass::Seek ( int pos,
int dir = SEEK_CUR )
virtual

Seek.

Implements FileClass.

Definition at line 397 of file W3DFileSystem.cpp.

◆ Set_Name()

char const * GameFileClass::Set_Name ( char const * filename)
virtual

Sets the file name, and finds the GDI asset if present.

Well, that is the worst comment ever for the most important function there is. Everything comes through this. This builds the directory and tests for the file in several different places.

First we look in Language subfolders so that our Perforce build can handle files that have been localized but were in Generals.

Then we do the normal TheFileSystem lookup. In there it does LocalFile (Art/Textures) then it does big files (which internally are also Art/Textures).

Finally we try UserData.

Implements FileClass.

Reimplemented in WBGameFileClass.

Definition at line 140 of file W3DFileSystem.cpp.

◆ Size()

int GameFileClass::Size ( void )
virtual

Size.

Implements FileClass.

Definition at line 415 of file W3DFileSystem.cpp.

◆ Write()

int GameFileClass::Write ( void const * buffer,
int len )
virtual

Write.

Implements FileClass.

Definition at line 426 of file W3DFileSystem.cpp.

Member Data Documentation

◆ m_fileExists

Bool GameFileClass::m_fileExists
protected

< The file

TRUE if the file exists

Definition at line 78 of file W3DFileSystem.h.

◆ m_filename

char GameFileClass::m_filename[_MAX_PATH]
protected

The file name only.

Definition at line 80 of file W3DFileSystem.h.

◆ m_filePath

char GameFileClass::m_filePath[_MAX_PATH]
protected

the file name and path (relative)

Definition at line 79 of file W3DFileSystem.h.

◆ m_theFile

File* GameFileClass::m_theFile
protected

Definition at line 77 of file W3DFileSystem.h.


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