compat.bolt-cpp
#includeC++ embedded key-value database using the Bolt file format
#include <bolt/bolt.hpp>
mcpp add compat.bolt-cpp@2026.11.27
Usage
From this repository's own test project — built and run by CI, not written for the website.
#include <bolt/bolt.hpp>
#include <chrono>
#include <filesystem>
#include <iostream>
#include <random>
#include <stdexcept>
#include <string>
namespace {
using Error = bolt::ErrorCode;
namespace fs = std::filesystem;
// 每次调用独占一个目录,可同时运行多个独立消费测试
struct TempDirectory {
fs::path path = fs::temp_directory_path() / ("mcpp-bolt-" + std::to_string(std::random_device{}()));
TempDirectory() {
if (!fs::create_directory(path)) throw std::runtime_error("cannot create test directory");
}
~TempDirectory() { std::error_code ignored; fs::remove_all(path, ignored); }
};
// …
tests/examples/bolt-cpp/tests/cache.cpp · project tests/examples/bolt-cpp
Build
- targets
bolt-cpp (lib)- language
c++23- import std
- no
- include dirs
mcpp_generated/include, */include, */include/bolt, */src
Sources (2)
*/src/bolt.cpp*/src/impl/*.cpp
Generated files
mcpp_generated/include/bolt/bolt.hpp
Versions
| Version | Platforms | Mirrors | sha256 |
|---|---|---|---|
2026.11.27 latest |
LinuxWindowsmacOS | source | 0d2b60c9ee9e… |