| 45 | |
| 46 | template<typename KeyType, typename ValueType> |
| 47 | void WriteBatch(CDBAccess &access, const dbk::PrefixType &prefixType, const map<KeyType, ValueType> &dataMap) { |
| 48 | CLevelDBBatch batch; |
| 49 | for (auto item : dataMap) { |
| 50 | string key = dbk::GenDbKey(prefixType, item.first); |
| 51 | if (db_util::IsEmpty(item.second)) { |
| 52 | batch.Erase(key); |
| 53 | } else { |
| 54 | batch.Write(key, item.second); |
| 55 | } |
| 56 | } |
| 57 | access.WriteBatch(batch); |
| 58 | } |
| 59 | |
| 60 | BOOST_AUTO_TEST_CASE(dbaccess_test) |
| 61 | { |
no test coverage detected