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

Password:

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

ResourceDb Class Reference

#include <ORESDB.H>

Inheritance diagram for ResourceDb:

File List of all members.

Public Methods

 ResourceDb ()
 ~ResourceDb ()
 ResourceDb (char *resName, Database *dbObj, int indexOffset, int useCommonBuf=0)
void init (char *, Database *, int, int=0)
void deinit ()
char * read (int=-1)
Fileget_file ()
void init_imported (char *, int, int=0)
char * read_imported (long)

Public Attributes

char init_flag

Detailed Description

Implementation of a resource using a database (file) as the data source. Database resource files are built by LIBDB.EXE, it is always have a .RES extension.

Definition at line 18 of file ORESDB.H.


Constructor & Destructor Documentation

ResourceDb::ResourceDb   [inline]
 

Definition at line 32 of file ORESDB.H.

References init_flag.

ResourceDb::~ResourceDb   [inline]
 

Definition at line 33 of file ORESDB.H.

References deinit().

ResourceDb::ResourceDb char *    resName,
Database   dbObj,
int    indexOffset,
int    useCommonBuf = 0
[inline]
 

Definition at line 35 of file ORESDB.H.

References init(), and init_flag.


Member Function Documentation

void ResourceDb::deinit  
 

Definition at line 53 of file ORESDB.CPP.

References mem_del, and NULL.

Referenced by ~ResourceDb().

File * ResourceDb::get_file  
 

Position the file pointer to the beginning of the data and return the file stream

Syntax : get_file()

Return : <FILE*> the file stream NULL if the record has not index to data

Definition at line 123 of file ORESDB.CPP.

References NULL.

void ResourceDb::init char *    resName,
Database   dbObj,
int    indexOffset,
int    useCommonBuf = 0
 

<char*> resName = name of the resource file (e.g. "GIF.RES") <Database*> dbObj = name of the database (e.g. Database db("PFILE.DBF")) <int> indexOffset = offset of the index field [int] useCommonBuf = whether use the vga common buffer to store the data or not (default:0)

Definition at line 29 of file ORESDB.CPP.

References NULL.

Referenced by ResourceDb().

void ResourceDb::init_imported char *    resName,
int    readAll,
int    useCommonBuf = 0
 

If the whole database has been read into memory, then only no need to tell ResourceDb the database name and the index offset

<char*> resName = name of the resource file (e.g. "GIF.RES") <int> readAll = whether read all data into the buffer or read one each time [int] useCommonBuf = whether use the vga common buffer to store the data or not (default:0)

Definition at line 155 of file ORESDB.CPP.

References NULL.

char * ResourceDb::read int    recNo = -1
 

Read in data from the resource file and store in an the buffer of this class

The index field of the current record in the database object is used to locate the data in the resource file.

Syntax : read(int recNo)

[int] recNo = the record no. in the database. (default : current record no.)

Return : <char*> data pointer NULL if the record has not index to data

Definition at line 84 of file ORESDB.CPP.

References COMMON_DATA_BUF_SIZE, and NULL.

char * ResourceDb::read_imported long    offset
 

If ResourceDb is initialized using init_imported(), then use read_imported to read the record

<long> offset = offset to the data in the resource file

Return : <char*> data pointer NULL if the record has not index to data

Definition at line 198 of file ORESDB.CPP.


Member Data Documentation

char ResourceDb::init_flag
 

Definition at line 20 of file ORESDB.H.

Referenced by ResourceDb().


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