Virtual U.org
Get Personal Training on VU Today
    
Top shadow
 
 register/help
User Name:

Password:

File class Reference
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

File Class Reference

#include <OFILE.H>

Inheritance diagram for File:

Database FileTxt Resource ResourceDb ResourceIdx ImageRes List of all members.

Public Methods

 File ()
 ~File ()
int file_open (char *, int=1, int=0)
int file_create (char *, int=1, int=0)
int file_append (char *, int=1, int=0)
void file_close ()
long file_size ()
long file_seek (long, int=-1)
long file_pos ()
int file_read (void *, unsigned)
int file_write (void *, unsigned)
short file_get_short ()
int file_put_short (short)
unsigned short file_get_unsigned_short ()
int file_put_unsigned_short (unsigned short)
long file_get_long ()
int file_put_long (long)

Public Attributes

char file_name [MAX_PATH+1]
HANDLE file_handle
int handle_error
char allow_vary_size

Detailed Description

Utility Class which abstracts file operations such as opening, closing, reading, and writing.

Definition at line 19 of file OFILE.H.


Constructor & Destructor Documentation

File::File   [inline]
 

Definition at line 29 of file OFILE.H.

References file_handle.

File::~File  
 

Definition at line 179 of file OFILE.CPP.


Member Function Documentation

int File::file_append char *    fileName,
int    handleError = 1,
int    allowVarySize = 0
 

Open an existing file for reading If the file is not found, call err.run()

<char*> fileName = name of the file [int] handleError = handle error ( if 1, when error happen, err.run() will be called immediately ) ( default : 1 ) [int] allowVarySize = allow the writing size and the read size to be different ( default : 0 )

return : 1-success, 0-fail

Definition at line 127 of file OFILE.CPP.

References NULL.

void File::file_close  
 

Definition at line 168 of file OFILE.CPP.

Referenced by Log::dump(), Translate::init(), Vga::load_pal(), Finance::report_detect(), and VgaCustomPalette::set_custom_palette().

int File::file_create char *    fileName,
int    handleError = 1,
int    allowVarySize = 0
 

Create a new file for writing (reading is also permitted)

<char*> fileName = name of the file [int] handleError = handle error ( if 1, when error happen, err.run() will be called immediately ) ( default : 1 ) [int] allowVarySize = allow the writing size and the read size to be different ( default : 0 )

return : 1-success, 0-fail

Definition at line 84 of file OFILE.CPP.

References NULL.

Referenced by Log::dump(), and Finance::report_detect().

long File::file_get_long  
 

Get a long integer from the file

return : the long integer

Definition at line 405 of file OFILE.CPP.

References NULL.

Referenced by ColorTable::read_file().

short File::file_get_short  
 

Get a short integer from the file

return : the short integer

Definition at line 307 of file OFILE.CPP.

References NULL.

Referenced by ImageRes::put_large(), VgaBuf::put_large_bitmap(), VgaBuf::put_large_bitmapW(), DepartmentArray::read_file(), SchoolRes::read_file(), FacultyRes::read_file(), DepartmentRes::read_file(), and DynArrayB::read_ptr_array().

unsigned short File::file_get_unsigned_short  
 

Get a short integer from the file

return : the short integer

Definition at line 356 of file OFILE.CPP.

References NULL.

int File::file_open char *    fileName,
int    handleError = 1,
int    allowVarySize = 0
 

Open an existing file for reading If the file is not found, call err.run()

<char*> fileName = name of the file [int] handleError = handle error ( if 1, when error happen, err.run() will be called immediately ) ( default : 1 ) [int] allowVarySize = allow the writing size and the read size to be different ( default : 0 )

return : 1-success, 0-fail

Definition at line 31 of file OFILE.CPP.

References NULL.

Referenced by Translate::init(), Vga::load_pal(), Audio::play_long_wav(), and VgaCustomPalette::set_custom_palette().

long File::file_pos  
 

Definition at line 447 of file OFILE.CPP.

References file_handle, and NULL.

Referenced by Audio::play_long_wav(), ImageRes::put_large(), and Audio::yield().

int File::file_put_long long    value
 

Put a long integer to the file

<long int> = the long integer

return : 1-success, 0-fail

Definition at line 382 of file OFILE.CPP.

References NULL.

Referenced by ColorTable::write_file().

int File::file_put_short short    value
 

Put a short integer to the file

<short int> = the short integer

return : 1-success, 0-fail

Definition at line 284 of file OFILE.CPP.

References NULL.

Referenced by SchoolRes::write_file(), FacultyRes::write_file(), DepartmentRes::write_file(), and DynArrayB::write_ptr_array().

int File::file_put_unsigned_short unsigned short    value
 

Put a unsigned short integer to the file

<unsigned short> = the short integer

return : 1-success, 0-fail

Definition at line 333 of file OFILE.CPP.

References NULL.

int File::file_read void *    dataBuf,
unsigned    dataSize
 

Read a block of data from the file

<void*> dataBuf = pointer to data buffer to be written to the file <unsigned> dataSize = length of the data (must < 64K)

return : 1-success, 0-fail

Definition at line 225 of file OFILE.CPP.

Referenced by Translate::init(), Vga::load_pal(), Audio::play_long_wav(), ImageRes::put_large(), VgaBuf::put_large_bitmap(), VgaBuf::put_large_bitmapW(), CourseArray::read_file(), FacultyArray::read_file(), StudentArray::read_file(), GeneralDepartment::read_file(), Department::read_file(), DepartmentArray::read_file(), StudentOffice::read_file(), Investment::read_file(), Facility::read_file(), LibTech::read_file(), Athletics::read_file(), Development::read_file(), ChanceEvent::read_file(), TaskArray::read_file(), NewsArray::read_file(), PlayerSchool::read_file(), Finance::read_file(), Game::read_file(), Info::read_file(), Config::read_file(), Letter::read_file(), EnrollRes::read_file(), SchoolRes::read_file(), FacultyRes::read_file(), DepartmentRes::read_file(), ColorTable::read_file(), DynArrayB::read_ptr_array(), VgaCustomPalette::set_custom_palette(), and Audio::yield().

long File::file_seek long   ,
int    = -1
 

Definition at line 432 of file OFILE.CPP.

References file_handle, and NULL.

Referenced by Vga::load_pal(), Audio::play_long_wav(), ImageRes::put_large(), VgaCustomPalette::set_custom_palette(), and Audio::yield().

long File::file_size  
 

Reimplemented in FileTxt.

Definition at line 455 of file OFILE.CPP.

References file_handle, and NULL.

Referenced by Translate::init().

int File::file_write void *    dataBuf,
unsigned    dataSize
 

Write a block of data to the file

<void*> dataBuf = pointer to data buffer to be written to the file <unsigned> dataSize = length of the data (must < 64K)

return : 1-success, 0-fail

Definition at line 194 of file OFILE.CPP.

Referenced by Log::dump(), StudentOffice::write_file(), Investment::write_file(), Facility::write_file(), LibTech::write_file(), Athletics::write_file(), Development::write_file(), ChanceEvent::write_file(), TaskArray::write_file(), NewsArray::write_file(), PlayerSchool::write_file(), Finance::write_file(), Game::write_file(), Info::write_file(), Config::write_file(), Letter::write_file(), EnrollRes::write_file(), SchoolRes::write_file(), FacultyRes::write_file(), DepartmentRes::write_file(), ColorTable::write_file(), and DynArrayB::write_ptr_array().


Member Data Documentation

char File::allow_vary_size
 

Definition at line 26 of file OFILE.H.

HANDLE File::file_handle
 

Definition at line 23 of file OFILE.H.

Referenced by File(), file_pos(), file_seek(), and file_size().

char File::file_name[MAX_PATH+1]
 

Definition at line 21 of file OFILE.H.

int File::handle_error
 

Definition at line 24 of file OFILE.H.


The documentation for this class was generated from the following files:
Generated on Fri Aug 23 01:39:10 2002 for VirtualU by doxygen1.2.17