ORESDB.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Seven Kingdoms: Ancient Adversaries
  3. *
  4. * Copyright 1997,1998 Enlight Software Ltd.
  5. *
  6. * This program is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. *
  19. */
  20. //Filename : ORESDB.H
  21. //Description : Header file of Object Resource Database
  22. #ifndef __ORESDB_H
  23. #define __ORESDB_H
  24. #ifndef __ALL_H
  25. #include <ALL.h>
  26. #endif
  27. //--------- Define class ResourceDb ----------//
  28. class Database;
  29. class ResourceDb : public File
  30. {
  31. public:
  32. char init_flag;
  33. private:
  34. Database *db_obj;
  35. int index_field_offset;
  36. int use_common_buf;
  37. char *data_buf;
  38. int data_buf_size;
  39. char read_all;
  40. public:
  41. ResourceDb() { init_flag=0; }
  42. ~ResourceDb() { deinit(); }
  43. ResourceDb(char* resName,Database* dbObj,int indexOffset,int useCommonBuf=0)
  44. { init_flag=0; init(resName,dbObj,indexOffset,useCommonBuf); }
  45. void init(char*,Database*,int,int=0);
  46. void deinit();
  47. char* read(int= -1);
  48. File* get_file();
  49. void init_imported(char*,int,int=0);
  50. char* read_imported(long);
  51. };
  52. #endif