00001
00002
00003
00004 #ifndef __ORESX_H
00005 #define __ORESX_H
00006
00007 #ifndef __ALL_H
00008 #include <ALL.H>
00009 #endif
00010
00011
00012
00015 struct ResIndex {
00016 char name[9];
00017 long pointer;
00018 };
00019
00020
00021
00024 class ResourceIdx : public File {
00025 public:
00026 enum {
00027 DEF_BUF_SIZE = 5120
00028 };
00029
00030 ResIndex *index_buf;
00031 char *data_buf;
00032 unsigned data_buf_size;
00033
00034 char init_flag;
00035 char read_all;
00036 char use_common_buf;
00037 int rec_count;
00038 int cur_rec_no;
00039
00040 char* user_data_buf;
00041 unsigned user_data_buf_size;
00042 int user_start_read_pos;
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