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
用法
来自本仓库自己的测试项目 —— CI 真的编译并运行过,不是为了网站写的。
#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 · 项目 tests/examples/bolt-cpp
构建
- targets
bolt-cpp (lib)- language
c++23- import std
- no
- include dirs
mcpp_generated/include, */include, */include/bolt, */src
源文件 (2)
*/src/bolt.cpp*/src/impl/*.cpp
生成的文件
mcpp_generated/include/bolt/bolt.hpp
版本
| 版本 | 平台 | 镜像 | sha256 |
|---|---|---|---|
2026.11.27 最新 |
LinuxWindowsmacOS | 源站 | 0d2b60c9ee9e… |