compat.libmaxminddb
#includeC reader for MaxMind DB files
#include <maxminddb.h>
mcpp add compat.libmaxminddb@1.14.1
Usage
From this repository's own test project — built and run by CI, not written for the website.
#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 · project tests/examples/libmaxminddb
Build
- targets
maxminddb (lib)- language
c++23- C standard
c11- import std
- no
- include dirs
*/include, mcpp_generated
Sources (2)
*/src/maxminddb.c*/src/data-pool.c
Generated files
mcpp_generated/maxminddb_config.h
Versions
| Version | Platforms | Mirrors | sha256 |
|---|---|---|---|
1.14.1 latest |
LinuxWindowsmacOS | source | ca5c87d41339… |