]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/database-leveldb.h
Formspec: textarea with scrollbar improvements
[dragonfireclient.git] / src / database-leveldb.h
index c195260dac52b9c774b662e85c46422a3e66648b..d30f9f8f5dd9f733fb98bd879f603c681d0b8884 100644 (file)
@@ -17,34 +17,32 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
 
-#ifndef DATABASE_LEVELDB_HEADER
-#define DATABASE_LEVELDB_HEADER
+#pragma once
 
 #include "config.h"
 
 #if USE_LEVELDB
 
+#include <string>
 #include "database.h"
 #include "leveldb/db.h"
-#include <string>
 
-class ServerMap;
-
-class Database_LevelDB : public Database
+class Database_LevelDB : public MapDatabase
 {
 public:
-       Database_LevelDB(ServerMap *map, std::string savedir);
-       virtual void beginSave();
-       virtual void endSave();
-       virtual bool saveBlock(v3s16 blockpos, std::string &data);
-       virtual std::string loadBlock(v3s16 blockpos);
-       virtual bool deleteBlock(v3s16 blockpos);
-       virtual void listAllLoadableBlocks(std::list<v3s16> &dst);
-       virtual int Initialized(void);
+       Database_LevelDB(const std::string &savedir);
        ~Database_LevelDB();
+
+       bool saveBlock(const v3s16 &pos, const std::string &data);
+       void loadBlock(const v3s16 &pos, std::string *block);
+       bool deleteBlock(const v3s16 &pos);
+       void listAllLoadableBlocks(std::vector<v3s16> &dst);
+
+       void beginSave() {}
+       void endSave() {}
+
 private:
-       ServerMap *srvmap;
-       leveldb::DB* m_database;
+       leveldb::DB *m_database;
 };
-#endif
-#endif
+
+#endif // USE_LEVELDB