40bd01f253b06b2ff8331537b8c2ff0e44a3a7d9
[oweals/minetest.git] / src / database-leveldb.h
1 #include "config.h"
2
3 #if USE_LEVELDB
4 #ifndef DATABASE_LEVELDB_HEADER
5 #define DATABASE_LEVELDB_HEADER
6
7 #include "map.h"
8 #include "mapsector.h"
9 #include "mapblock.h"
10 #include "main.h"
11 #include "filesys.h"
12 #include "database.h"
13
14 #include "leveldb/db.h"
15
16 class Database_LevelDB : public Database
17 {
18 public:
19         Database_LevelDB(ServerMap *map, std::string savedir);
20         virtual void beginSave();
21         virtual void endSave();
22         virtual void saveBlock(MapBlock *block);
23         virtual MapBlock* loadBlock(v3s16 blockpos);
24         virtual void listAllLoadableBlocks(core::list<v3s16> &dst);
25         virtual int Initialized(void);
26         ~Database_LevelDB();
27 private:
28         ServerMap *srvmap;
29         leveldb::DB* m_database;
30 };
31 #endif
32 #endif