compat.libmaxminddb
#includeC reader for MaxMind DB files
#include <maxminddb.h>
mcpp add compat.libmaxminddb@1.14.1
用法
來自本倉庫自己的測試專案 —— CI 真的編譯並執行過,不是為了網站寫的。
#include <maxminddb.h>
#include <cstdio>
#include <filesystem>
#include <stdexcept>
#include <string_view>
namespace {
namespace fs = std::filesystem;
class Database {
public:
explicit Database(const fs::path& path) {
const int status = MMDB_open(path.string().c_str(), MMDB_MODE_MMAP, &database);
if (status != MMDB_SUCCESS) throw std::runtime_error(MMDB_strerror(status));
}
~Database() { MMDB_close(&database); }
Database(const Database&) = delete;
Database& operator=(const Database&) = delete;
// …
tests/examples/libmaxminddb/tests/query.cpp · 專案 tests/examples/libmaxminddb
建置
- targets
maxminddb (lib)- language
c++23- C standard
c11- import std
- no
- include dirs
*/include, mcpp_generated
原始檔 (2)
*/src/maxminddb.c*/src/data-pool.c
產生的檔案
mcpp_generated/maxminddb_config.h
版本
| 版本 | 平台 | 鏡像 | sha256 |
|---|---|---|---|
1.14.1 最新 |
LinuxWindowsmacOS | 來源 | ca5c87d41339… |