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

#include <FileSystem.h>

Inherits SubsystemInterface.

Inherited by StdFileSystem.

Public Member Functions

 FileSystem ()
 
virtual ~FileSystem ()
 
void init ()
 
void reset ()
 
void update ()
 
FileopenFile (const Char *filename, Int access=0)
 opens a File interface to the specified file
 
Bool doesFileExist (const Char *filename) const
 returns TRUE if the file exists. filename should have no directory.
 
void getFileListInDirectory (const AsciiString &directory, const AsciiString &searchName, FilenameList &filenameList, Bool searchSubdirectories) const
 search the given directory for files matching the searchName (egs. *.ini, *.rep). Possibly search subdirectories.
 
Bool getFileInfo (const AsciiString &filename, FileInfo *fileInfo) const
 fills in the FileInfo struct for the file given. returns TRUE if successful.
 
Bool createDirectory (AsciiString directory)
 create a directory of the given name.
 
Bool areMusicFilesOnCD ()
 
void loadMusicFilesFromCD ()
 
void unloadMusicFilesFromCD ()
 
virtual ~FileSystem ()
 
virtual Fileopen (const Char *filename, Int access=0)
 opens a File interface to the specified file
 
- Public Member Functions inherited from SubsystemInterface
 SubsystemInterface ()
 
virtual ~SubsystemInterface ()
 
virtual void postProcessLoad ()
 
virtual void draw (void)
 
void UPDATE (void)
 
void DRAW (void)
 
AsciiString getName (void)
 
void setName (AsciiString name)
 

Protected Attributes

std::map< unsigned, boolm_fileExist
 
- Protected Attributes inherited from SubsystemInterface
AsciiString m_name
 

Detailed Description

FileSystem is an interface class for creating specific FileSystem objects.

A FileSystem object's implemenation decides what derivative of File object needs to be created when FileSystem::Open() gets called.

Definition at line 121 of file FileSystem.h.

Constructor & Destructor Documentation

◆ FileSystem()

FileSystem::FileSystem ( )

Definition at line 124 of file FileSystem.cpp.

◆ ~FileSystem() [1/2]

FileSystem::~FileSystem ( )
virtual

Definition at line 133 of file FileSystem.cpp.

◆ ~FileSystem() [2/2]

virtual FileSystem::~FileSystem ( )
inlinevirtual

Definition at line 80 of file WSYS_FileSystem.h.

Member Function Documentation

◆ areMusicFilesOnCD()

Bool FileSystem::areMusicFilesOnCD ( )

Definition at line 267 of file FileSystem.cpp.

◆ createDirectory()

Bool FileSystem::createDirectory ( AsciiString directory)

create a directory of the given name.

Definition at line 255 of file FileSystem.cpp.

◆ doesFileExist()

Bool FileSystem::doesFileExist ( const Char * filename) const

returns TRUE if the file exists. filename should have no directory.

Definition at line 196 of file FileSystem.cpp.

◆ getFileInfo()

Bool FileSystem::getFileInfo ( const AsciiString & filename,
FileInfo * fileInfo ) const

fills in the FileInfo struct for the file given. returns TRUE if successful.

Definition at line 233 of file FileSystem.cpp.

◆ getFileListInDirectory()

void FileSystem::getFileListInDirectory ( const AsciiString & directory,
const AsciiString & searchName,
FilenameList & filenameList,
Bool searchSubdirectories ) const

search the given directory for files matching the searchName (egs. *.ini, *.rep). Possibly search subdirectories.

Definition at line 223 of file FileSystem.cpp.

◆ init()

void FileSystem::init ( )
virtual
  • Assign any default values to data required for the class
    • Allocate any memory and resources needed throughout the lifetime of the class

Implements SubsystemInterface.

Definition at line 142 of file FileSystem.cpp.

◆ loadMusicFilesFromCD()

void FileSystem::loadMusicFilesFromCD ( )

Definition at line 301 of file FileSystem.cpp.

◆ open()

virtual File * FileSystem::open ( const Char * filename,
Int access = 0 )
virtual

opens a File interface to the specified file

Reimplemented in StdFileSystem.

◆ openFile()

File * FileSystem::openFile ( const Char * filename,
Int access = 0 )

opens a File interface to the specified file

Definition at line 174 of file FileSystem.cpp.

◆ reset()

void FileSystem::reset ( )
virtual
  • Any system should be able to reset all data and go back to an empty state that is ready to accept a completely new set of data. Reset() can expect to be used in the context of resetting the engine in order to start or load a new game.
    • Do NOT free and re-allocate resources needed, where possible reorganize and re-initialize the resources already allocated.
    • After a reset, the system does not need to be in EXACTLY the same state as a fresh instantiation. If there are persistent state information for the system make sure you maintain it while restoring or re-initializing other transient parts.

Implements SubsystemInterface.

Definition at line 163 of file FileSystem.cpp.

◆ unloadMusicFilesFromCD()

void FileSystem::unloadMusicFilesFromCD ( )

Definition at line 325 of file FileSystem.cpp.

◆ update()

void FileSystem::update ( )
virtual
  • Update methods are the place to do system per frame processing. You should call the system update once each time through the game loop to service the system.
    • Note that currently the GameClient and GameLogic will be updating at different rates where the logic is running real time, and the client will adjust how many loops can be done during one server time slice in order to improve performance on low end machines.

Implements SubsystemInterface.

Definition at line 152 of file FileSystem.cpp.

Member Data Documentation

◆ m_fileExist

std::map<unsigned,bool> FileSystem::m_fileExist
mutableprotected

Definition at line 145 of file FileSystem.h.


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