AnCH Framework ("Another C++ Hack") is a set of small and independent C++ libraries for common programming needs: command line, configuration, logging, events, JSON, SQL, REST, cryptography, UUID, network, dates, unit tests, ... They are designed to be used as simply as possible.
The framework is also a playground for new C++ standards: it targets C++23. Only POSIX systems are supported.
Libraries are licensed under the LGPL v3: they can be used with the least possible restrictions.
| Library | Description |
|---|---|
| anch-utils | Header only utilities: thread pool, resource pool, singleton, conversions, ... |
| anch-cli | Command line arguments parsing and terminal formatting |
| anch-events | Observers, event bus and event handlers |
| anch-cutils | C++ streams over C style read and write functions |
| anch-network | TCP (as C++ streams) and UDP sockets, IPv4 and IPv6 |
| anch-ut | Unit tests library, integrated with CTest |
| anch-uuid | UUID generation and parsing (RFC 9562) |
| anch-date | Dates, formatting and parsing, RFC 3339 |
| anch-ini | INI files parser |
| anch-conf | Configuration cascade (includes, profiles) and placeholders resolution |
| anch-log | Configurable loggers and writers, stream API with compile-time levels |
| anch-device | Network interfaces and CPU features |
| anch-val | Fields constraints and validation, shared by formats (JSON, ...) |
| anch-json | JSON serialization and deserialization |
| anch-crypto | Hashes, HMAC, Base64, AES and block cipher modes (not audited) |
| anch-sql | SQL abstraction layer and connection pools for MySQL/MariaDB, PostgreSQL and SQLite |
| anch-csv | CSV records reading and writing (RFC 4180), as streams |
| anch-codec | Codecs (media types, negotiation) and format plugins: JSON, Protocol Buffers, Thrift |
| anch-rest | REST API declaration (nginx module), HTTP client (libcurl), Protobuf / gRPC / Connect and Thrift RPC |
| anch-oas | OpenAPI 3.0 models generator (anch-oas-gen ) |
anch-app (application bootstrap) is a work in progress and is not documented yet.
Optional dependencies:
--with-threads )Build, test and install with CMake presets (release , debug , asan , no-db ):
Main options: ANCH_BUILD_TESTS , BUILD_SHARED_LIBS , optional libraries (ANCH_BUILD_CRYPTO , ANCH_BUILD_SQL , ANCH_BUILD_OAS , ANCH_BUILD_REST ) and features (ANCH_UUID , ANCH_DATE , ANCH_SQL_MYSQL , ANCH_SQL_POSTGRESQL , ANCH_SQL_SQLITE3 , ANCH_REST_CURL , ANCH_REST_NGINX , ANCH_LOG_MIN_LEVEL , ...).
Installed libraries are used with their CMake targets:
ANCH_UUID and ANCH_DATE optionsANCH_UUID and ANCH_DATE optionsCurrent version is 0.2 . Versions are numbered A.B.C: until 1.0.0, backward compatibility is not ensured and API can change on every B change. From 1.0.0, A changes will break API, B changes will add features and C changes will fix bugs. Shared libraries SONAME holds A and B (libanch-conf.so.0.2 ).
Until 1.0.0, APIs are changed or removed directly, without deprecation: breaking changes are listed in the changelog. From 1.0.0, B and C versions keep backward compatibility: deprecated APIs are marked with [[deprecated]] (compilation warning) and \deprecated in their documentation, with their replacement, and are removed in the next A version.
Shared libraries are built with hidden symbols visibility: only the public API is exported, with the ANCH_<NAME>_EXPORT macros of the generated anch-<name>-export.hpp headers.
Version 0.2 brings: single CMake project with presets and package, C++23 and GCC 13, rewritten anch-network, anch-date, anch-rest and anch-conf cascade, anch-log stream API, anch-oas generator, RFC 3339 dates in anch-json, many fixes found with sanitizers and fuzzing, and a CI (GCC, Clang, sanitizers, coverage, fuzzing, installation). Changes and breaking changes of each version are listed in the changelog.
Since version 0.2, part of the work on AnCH Framework has been done with an AI assistant (Claude Code, by Anthropic): code analyses, bug fixes (several found with the sanitizers), rewrites (anch-rest, anch-network, anch-date, ...), tests, CI and this documentation. Design decisions remain the maintainer's.
Commits written with the assistant are identified in the git history with a Co-Authored-By: Claude trailer.