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… |