Ejemplo n.º 1
0
 void
 verify() override
 {
     auto const dp = db_.dat_path();
     auto const kp = db_.key_path();
     auto const lp = db_.log_path();
     db_.close();
     api::verify (dp, kp);
     db_.open (dp, kp, lp,
         arena_alloc_size);
 }
Ejemplo n.º 2
0
 void
 close() override
 {
     if (db_.is_open())
     {
         db_.close();
         if (deletePath_)
         {
             boost::filesystem::remove_all (name_);
         }
     }
 }
Ejemplo n.º 3
0
 void
 for_each (std::function <void(std::shared_ptr<NodeObject>)> f) override
 {
     auto const dp = db_.dat_path();
     auto const kp = db_.key_path();
     auto const lp = db_.log_path();
     //auto const appnum = db_.appnum();
     db_.close();
     api::visit (dp,
         [&](
             void const* key, std::size_t key_bytes,
             void const* data, std::size_t size)
         {
             DecodedBlob decoded (key, data, size);
             if (! decoded.wasOk ())
                 return false;
             f (decoded.createObject());
             return true;
         });
     db_.open (dp, kp, lp,
         arena_alloc_size);
 }