Changeset 510 for trunk/gsdl/src/recpt/infodbclass.h
- Timestamp:
- 1999-09-02T12:26:11+12:00 (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/infodbclass.h
r375 r510 19 19 20 20 #ifdef __WIN32__ 21 22 #ifdef __cplusplus 23 extern "C" { 24 #endif 21 25 #include "autoconf.h" 22 26 #include "systems.h" 23 27 #include "gdbmconst.h" 24 28 #include "gdbm.h" 29 #ifdef __cplusplus 30 } 31 #endif 25 32 26 33 #else … … 29 36 30 37 38 typedef map<text_t, text_tarray, lttext_t> text_tarraymap; 39 40 31 41 // infodbclass is used to store information about a object 32 42 class infodbclass { 33 43 protected: 34 text_t map info;44 text_tarraymap info; 35 45 36 46 public: 37 // type support for text_tmap38 typedef text_t map::iterator iterator;39 typedef text_t map::const_iterator const_iterator;40 typedef text_t map::reference reference;41 typedef text_t map::const_reference const_reference;42 typedef text_t map::size_type size_type;43 typedef text_t map::difference_type difference_type;44 typedef text_t map::const_reverse_iterator const_reverse_iterator;45 typedef text_t map::reverse_iterator reverse_iterator;47 // type support for text_tarraymap 48 typedef text_tarraymap::iterator iterator; 49 typedef text_tarraymap::const_iterator const_iterator; 50 typedef text_tarraymap::reference reference; 51 typedef text_tarraymap::const_reference const_reference; 52 typedef text_tarraymap::size_type size_type; 53 typedef text_tarraymap::difference_type difference_type; 54 typedef text_tarraymap::const_reverse_iterator const_reverse_iterator; 55 typedef text_tarraymap::reverse_iterator reverse_iterator; 46 56 47 57 // constructors … … 65 75 void clear () {info.erase(info.begin(),info.end());} 66 76 77 // the following functions deal with keys that can only 78 // have one value for compatibility 79 67 80 // getinfo returns NULL if there isn't an entry with 68 81 // 'key' already defined, getintinfo returns 0 if there wasn't an … … 74 87 text_t *getinfo (const text_t &key); 75 88 int getintinfo (const text_t &key); 76 text_t &operator[] (const text_t &key) {return info[key];} 89 text_t &operator[] (const text_t &key); 90 91 92 // the next set of functions allow you to set and access keys 93 // that can have more than one value 94 95 // getmultinfo returns NULL if there isn't an entry with 96 // 'key' already defined 97 void addinfo (const text_t &key, const text_t &value); 98 void addintinfo (const text_t &key, int value); 99 void addcinfo (const text_t &key, unsigned short c); 100 text_tarray *getmultinfo (const text_t &key); 77 101 }; 78 102 … … 84 108 85 109 // returns true if opened 86 bool opendatabase (const text_t &filename, int mode=GDBM_READER, int num_retrys=1); 110 bool opendatabase (const text_t &filename, int mode, int num_retrys, 111 bool need_filelock); 87 112 void closedatabase (); 88 113
Note:
See TracChangeset
for help on using the changeset viewer.