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

Password:

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

ResourceIdx Class Reference

#include <ORESX.H>

Inheritance diagram for ResourceIdx:

File ImageRes List of all members.

Public Types

enum  { DEF_BUF_SIZE = 5120 }

Public Methods

 ResourceIdx ()
 ~ResourceIdx ()
 ResourceIdx (char *resFile, int readAll, int useCommonBuf=0)
void init (char *resFile, int readAll, int useCommonBuf=0)
void deinit ()
int is_inited ()
void set_user_buf (char *userDataBuf, int bufSize, int userStartReadPos=0)
void reset_user_buf ()
char * read (char *)
int read_into_user_buf (char *dataName, char *userDataBuf, int bufSize, int userStartReadPos=0)
int get_index (char *)
char * get_data (int)
char * data_name (int)
Fileget_file (char *, int &)
Fileget_file (int, int &)

Public Attributes

ResIndexindex_buf
char * data_buf
unsigned data_buf_size
char init_flag
char read_all
char use_common_buf
int rec_count
int cur_rec_no
char * user_data_buf
unsigned user_data_buf_size
int user_start_read_pos

Detailed Description

Class which indexes all the resources contained within a particular resource. If read_all flag is set entire resource is stored in memory.

Definition at line 24 of file ORESX.H.


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
DEF_BUF_SIZE 

Definition at line 26 of file ORESX.H.


Constructor & Destructor Documentation

ResourceIdx::ResourceIdx   [inline]
 

Definition at line 45 of file ORESX.H.

References init_flag.

ResourceIdx::~ResourceIdx   [inline]
 

Definition at line 46 of file ORESX.H.

References deinit().

ResourceIdx::ResourceIdx char *    resFile,
int    readAll,
int    useCommonBuf = 0
[inline]
 

Definition at line 48 of file ORESX.H.

References init(), and init_flag.


Member Function Documentation

char * ResourceIdx::data_name int   
 

Definition at line 361 of file ORESX.CPP.

References index_buf, ResIndex::name, NULL, and rec_count.

Referenced by SECtrl::get_effect_name().

void ResourceIdx::deinit  
 

Definition at line 96 of file ORESX.CPP.

References mem_del, and NULL.

Referenced by GameSet::close_set(), SpriteInfo::free_bitmap_res(), and ~ResourceIdx().

char * ResourceIdx::get_data int    indexId
 

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.

<int> indexId = index of the data pointing to the resource file

Return : <char*> data pointer

Definition at line 215 of file ORESX.CPP.

Referenced by ImageRes::put_back(), ImageRes::put_front(), and ImageRes::put_to_buf().

File * ResourceIdx::get_file int    bitmapId,
int &    dataSize
 

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

Syntax : get_file(char* dataName)

<char*> dataName = name of the data going to read <int&> dataSIze = for returning the data size of the resource record

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

Definition at line 317 of file ORESX.CPP.

File * ResourceIdx::get_file char *    dataName,
int &    dataSize
 

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

Syntax : get_file(char* dataName)

<char*> dataName = name of the data going to read <int&> dataSIze = for returning the data size of the resource record

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

Definition at line 282 of file ORESX.CPP.

Referenced by ImageRes::put_large(), and ImageRes::put_to_buf().

int ResourceIdx::get_index char *    dataName
 

Get the index of the data in the resource file, and later can retrieve the data using this index by calling get_data()

<char*> dataName = name of the data going to get_index

Return : <int> index of the data in the resource file 0 if the name is not found in the resource file

Definition at line 189 of file ORESX.CPP.

Referenced by SECtrl::search_effect_id().

void ResourceIdx::init char *    resName,
int    readAll,
int    useCommonBuf = 0
 

<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 (default:0) [int] useCommonBuf = whether use the common buffer to store the data or not (default:0)

Definition at line 42 of file ORESX.CPP.

References NULL.

Referenced by SECtrl::init(), GameSet::open_set(), and ResourceIdx().

int ResourceIdx::is_inited   [inline]
 

Definition at line 54 of file ORESX.H.

References init_flag.

char * ResourceIdx::read char *    dataName
 

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(char* dataName)

<char*> dataName = name of the data going to read

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

Definition at line 166 of file ORESX.CPP.

References NULL.

Referenced by ImageRes::get_ptr(), GameSet::open_db(), ImageRes::put_back(), ImageRes::put_front(), and ImageRes::put_join().

int ResourceIdx::read_into_user_buf char *    dataName,
char *    userBuf,
int    userBufSize,
int    userStartReadPos = 0
 

Read a block of data into the buffer specified by the user.

<char*> dataName = name of the data going to read <char*> userBuf = pointer to the user buffer <int> userBufSize = size of the user buffer. [int] userStartReadPos = the starting position of the data to be read into the buffer. (default:0)

Return : <int> 1 - succeeded 0 - failed

Definition at line 131 of file ORESX.CPP.

References NULL.

void ResourceIdx::reset_user_buf  
 

Cancel using custom user data buffer.

Definition at line 353 of file ORESX.CPP.

References NULL.

void ResourceIdx::set_user_buf char *    userDataBuf,
int    bufSize,
int    userStartReadPos = 0
 

Set custom user data buffer. When it is set, data will be loaded into the user buffer instead of ResourceIdx's own buffer.

<char*> userDataBuf - pointer user data buffer <int> bufSize - size of the data bufferr <int> userStartReadPos - the starting position of the data to be read into the buffer.

Definition at line 341 of file ORESX.CPP.


Member Data Documentation

int ResourceIdx::cur_rec_no
 

Definition at line 38 of file ORESX.H.

char* ResourceIdx::data_buf
 

Definition at line 31 of file ORESX.H.

unsigned ResourceIdx::data_buf_size
 

Definition at line 32 of file ORESX.H.

ResIndex* ResourceIdx::index_buf
 

Definition at line 30 of file ORESX.H.

Referenced by data_name().

char ResourceIdx::init_flag
 

Definition at line 34 of file ORESX.H.

Referenced by is_inited(), and ResourceIdx().

char ResourceIdx::read_all
 

Definition at line 35 of file ORESX.H.

int ResourceIdx::rec_count
 

Definition at line 37 of file ORESX.H.

Referenced by data_name().

char ResourceIdx::use_common_buf
 

Definition at line 36 of file ORESX.H.

char* ResourceIdx::user_data_buf
 

Definition at line 40 of file ORESX.H.

unsigned ResourceIdx::user_data_buf_size
 

Definition at line 41 of file ORESX.H.

int ResourceIdx::user_start_read_pos
 

Definition at line 42 of file ORESX.H.


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