Changeset 18051 for gsdl/trunk/common-src
- Timestamp:
- 2008-12-04T10:54:51+13:00 (15 years ago)
- Location:
- gsdl/trunk/common-src/src/lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/common-src/src/lib/gdbmclass.cpp
r18050 r18051 69 69 } 70 70 71 text_t gdbm_filename = filename; 71 72 if (gdbm_mode == GDBM_READER) 72 73 { 73 if (!file_exists(filename)) 74 // If the specified GDBM file doesn't exist, try the other extension (we can now read both) 75 if (!file_exists(gdbm_filename)) 74 76 { 75 generate_from_txtgz(filename); 77 if (ends_with(gdbm_filename, ".ldb")) 78 { 79 gdbm_filename = substr(gdbm_filename.begin(), gdbm_filename.end() - ((text_t) ".ldb").size()) + ".bdb"; 80 } 81 else if (ends_with(gdbm_filename, ".bdb")) 82 { 83 gdbm_filename = substr(gdbm_filename.begin(), gdbm_filename.end() - ((text_t) ".bdb").size()) + ".ldb"; 84 } 76 85 } 77 } 78 79 char *namebuffer = filename.getcstr(); 86 87 // DEPRECATED -- No longer necessary now that the GDBM library reads both little-endian and big-endian files 88 if (!file_exists(gdbm_filename)) 89 { 90 // We're desperate, so try generating the desired GDBM file from a txtgz file 91 gdbm_filename = filename; 92 generate_from_txtgz(gdbm_filename); 93 } 94 } 95 96 char *namebuffer = gdbm_filename.getcstr(); 80 97 do { 81 98 #ifdef __WIN32__ … … 91 108 if (gdbmfile == NULL && logout != NULL) { 92 109 outconvertclass text_t2ascii; 93 (*logout) << text_t2ascii << "database open failed on: " << filename << "\n";110 (*logout) << text_t2ascii << "database open failed on: " << gdbm_filename << "\n"; 94 111 } 95 112 … … 263 280 264 281 265 // DEPRECATED -- No longer necessary now that the GDBM library reads both little-endian and big-endian 282 // DEPRECATED -- No longer necessary now that the GDBM library reads both little-endian and big-endian files 266 283 void gdbmclass::generate_from_txtgz (text_t filename) 267 284 { -
gsdl/trunk/common-src/src/lib/gdbmclass.h
r18050 r18051 85 85 text_t getnextkey (const text_t &key); 86 86 87 // DEPRECATED -- No longer necessary now that the GDBM library reads both little-endian and big-endian 87 // DEPRECATED -- No longer necessary now that the GDBM library reads both little-endian and big-endian files 88 88 void generate_from_txtgz (text_t filename); 89 89 };
Note:
See TracChangeset
for help on using the changeset viewer.