void Database_Dummy::listAllLoadableBlocks(std::vector<v3s16> &dst) { dst.reserve(m_database.size()); for(auto &x : m_database) { dst.push_back(getStringAsBlock(x.first)); } }
void Database_LevelDB::listAllLoadableBlocks(std::list<v3s16> &dst) { leveldb::Iterator* it = m_database->NewIterator(leveldb::ReadOptions()); for (it->SeekToFirst(); it->Valid(); it->Next()) { dst.push_back(getStringAsBlock(it->key().ToString())); } assert(it->status().ok()); // Check for any errors found during the scan delete it; }
void Database_Dummy::listAllLoadableBlocks(std::list<v3s16> &dst) { for(auto &x : m_database) { v3s16 p = getStringAsBlock(x.first); //dstream<<"block_i="<<block_i<<" p="<<PP(p)<<std::endl; dst.push_back(p); } }