comparison src/adplug/core/database.cxx @ 339:d19ac60697ec trunk

[svn] - implement virtual class to use VFS through binio - update the places where binio is used directly to use vfs[io]stream instead of bin[io]stream, respectively - make CFileProvider use vfsistream instead of binifstream.
author nenolod
date Wed, 06 Dec 2006 07:37:05 -0800
parents 3da1b8942b8b
children 4709ce4e209e
comparison
equal deleted inserted replaced
338:d517fc608e89 339:d19ac60697ec
19 * database.cpp - AdPlug database class 19 * database.cpp - AdPlug database class
20 * Copyright (c) 2002 Riven the Mage <riven@ok.ru> 20 * Copyright (c) 2002 Riven the Mage <riven@ok.ru>
21 * Copyright (c) 2002, 2003, 2006 Simon Peter <dn.tlp@gmx.net> 21 * Copyright (c) 2002, 2003, 2006 Simon Peter <dn.tlp@gmx.net>
22 */ 22 */
23 23
24 #include <binio.h> 24 #include "binio_virtual.h"
25 #include <binfile.h>
26 #include <string.h> 25 #include <string.h>
27 26
28 #include "database.h" 27 #include "database.h"
29 28
30 #define DB_FILEID_V10 "AdPlug Module Information Database 1.0\x10" 29 #define DB_FILEID_V10 "AdPlug Module Information Database 1.0\x10"
53 delete [] db_hashed; 52 delete [] db_hashed;
54 } 53 }
55 54
56 bool CAdPlugDatabase::load(std::string db_name) 55 bool CAdPlugDatabase::load(std::string db_name)
57 { 56 {
58 binifstream f(db_name); 57 vfsistream f(db_name);
59 if(f.error()) return false; 58 if(f.error()) return false;
60 return load(f); 59 return load(f);
61 } 60 }
62 61
63 bool CAdPlugDatabase::load(binistream &f) 62 bool CAdPlugDatabase::load(binistream &f)
84 return true; 83 return true;
85 } 84 }
86 85
87 bool CAdPlugDatabase::save(std::string db_name) 86 bool CAdPlugDatabase::save(std::string db_name)
88 { 87 {
89 binofstream f(db_name); 88 vfsostream f(db_name);
90 if(f.error()) return false; 89 if(f.error()) return false;
91 return save(f); 90 return save(f);
92 } 91 }
93 92
94 bool CAdPlugDatabase::save(binostream &f) 93 bool CAdPlugDatabase::save(binostream &f)