aboutsummaryrefslogtreecommitdiff
path: root/src/database-leveldb.h
diff options
context:
space:
mode:
authorIlya Zhuravlev <zhuravlevilya@ya.ru>2012-10-23 01:18:44 +0400
committerSfan5 <sfan5@live.de>2013-09-09 22:50:50 +0200
commit58841ef12f6cba1bb622353c1fcaa0e3c6fb46c9 (patch)
tree6012bbb1905231025dff89aa73782a7c38666839 /src/database-leveldb.h
parent71a8769bb5ded4acb3f9e5a8502bb8af277f824d (diff)
downloadminetest-58841ef12f6cba1bb622353c1fcaa0e3c6fb46c9.tar.gz
minetest-58841ef12f6cba1bb622353c1fcaa0e3c6fb46c9.tar.bz2
minetest-58841ef12f6cba1bb622353c1fcaa0e3c6fb46c9.zip
Add dummy and LevelDB database backends
Diffstat (limited to 'src/database-leveldb.h')
-rw-r--r--src/database-leveldb.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/database-leveldb.h b/src/database-leveldb.h
new file mode 100644
index 000000000..40bd01f25
--- /dev/null
+++ b/src/database-leveldb.h
@@ -0,0 +1,32 @@
+#include "config.h"
+
+#if USE_LEVELDB
+#ifndef DATABASE_LEVELDB_HEADER
+#define DATABASE_LEVELDB_HEADER
+
+#include "map.h"
+#include "mapsector.h"
+#include "mapblock.h"
+#include "main.h"
+#include "filesys.h"
+#include "database.h"
+
+#include "leveldb/db.h"
+
+class Database_LevelDB : public Database
+{
+public:
+ Database_LevelDB(ServerMap *map, std::string savedir);
+ virtual void beginSave();
+ virtual void endSave();
+ virtual void saveBlock(MapBlock *block);
+ virtual MapBlock* loadBlock(v3s16 blockpos);
+ virtual void listAllLoadableBlocks(core::list<v3s16> &dst);
+ virtual int Initialized(void);
+ ~Database_LevelDB();
+private:
+ ServerMap *srvmap;
+ leveldb::DB* m_database;
+};
+#endif
+#endif