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

Password:

ORESX.H Source File
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

ORESX.H

Go to the documentation of this file.
00001 //Filename    : ORESX.H
00002 //Description : Header file of Object ResourceIdx
00003 
00004 #ifndef __ORESX_H
00005 #define __ORESX_H
00006 
00007 #ifndef __ALL_H
00008 #include <ALL.H>
00009 #endif
00010 
00011 //--------- Define structure ResIndex ----------//
00012 
00015 struct ResIndex {
00016     char name[9];
00017     long pointer;
00018 };
00019 
00020 //--------- Define class ResourceIdx ----------//
00021 
00024 class ResourceIdx : public File {
00025 public:
00026     enum {                                        // default buffer size : 5K
00027         DEF_BUF_SIZE = 5120
00028     };
00029 
00030     ResIndex *index_buf;                          // index buffer pointer
00031     char     *data_buf;                           // data buffer pointer
00032     unsigned data_buf_size;                       // size of the data buffer
00033 
00034     char     init_flag;
00035     char     read_all;                            // read all data from resource file to memory
00036     char     use_common_buf;                      // use vga's buffer as data buffer or not
00037     int      rec_count;                           // total no. of records
00038     int      cur_rec_no;                          // current record no
00039 
00040     char*   user_data_buf;
00041     unsigned user_data_buf_size;
00042     int   user_start_read_pos;                    // the starting position of the data to be read into the buffer
00043 
00044 public:
00045     ResourceIdx()   { init_flag=0; }
00046     ~ResourceIdx()  { deinit(); }
00047 
00048     ResourceIdx(char* resFile, int readAll, int useCommonBuf=0)
00049         { init_flag=0; init(resFile, readAll, useCommonBuf); }
00050 
00051     void  init(char* resFile, int readAll, int useCommonBuf=0);
00052     void  deinit();
00053 
00054     int   is_inited()   { return init_flag; }
00055 
00056     void  set_user_buf(char* userDataBuf, int bufSize, int userStartReadPos=0);
00057     void  reset_user_buf();
00058 
00059     char* read(char*);
00060     int read_into_user_buf(char* dataName, char* userDataBuf, int bufSize, int userStartReadPos=0);
00061 
00062     int   get_index(char*);
00063     char* get_data(int);
00064     char  *data_name(int);
00065 
00066     File* get_file(char*, int&);
00067     File* get_file(int, int&);
00068 };
00069 
00070 //--------------------------------------------//
00071 #endif

Generated on Fri Aug 23 01:38:18 2002 for VirtualU by doxygen1.2.17