leveldb
leveldb copied to clipboard
Question: how to cast to int
Hi, I have following map
std::map<std::string, int> db;
which in future, I want load data from leveldb to the memory by looping all of keys and insert to the std::map, I was do this
leveldb::Iterator* it = db->NewIterator(leveldb::ReadOptions());
for (it->SeekToFirst(); it->Valid(); it->Next()) {
db.insert(
{
it->key().ToString(),
it->value()
}
);
}
assert(it->status().ok());
which get the key as string, then get the value. my question how do I can cast back the "value" to int?