wildling
C++ library and CLI for pattern-based string generation. Zero third-party dependencies (C++17 standard library only). Includes a minimal JSON parser for --template.
Docs: Website · Sandbox · Syntax · Source
Registry: GitHub Releases
Example
Install
From this repository:
cd cpp
./build.sh
./bin/wildling "Year 19##"
From a release tag:
git clone --branch v2.0.7 --depth 1 https://github.com/dotmonk/wildling.git
cd wildling
./build.sh cpp
GitHub Release assets (Linux x86_64 CLI + source tarballs) are attached to each vX.Y.Z release.
CMake (library + CLI), including FetchContent from the monorepo:
include(FetchContent)
FetchContent_Declare(
wildling
GIT_REPOSITORY https://github.com/dotmonk/wildling.git
GIT_TAG v2.0.7
SOURCE_SUBDIR cpp
)
FetchContent_MakeAvailable(wildling)
target_link_libraries(myapp PRIVATE wildling)
Produces dist/wildling. Link against the sources under src/ (except cli.cpp) to use as a library:
#include "wildling.hpp"
wildling::Dictionaries dictionaries;
wildling::Wildling w({"Year 19##"}, dictionaries);
auto value = w.next();
while (value.has_value()) {
std::cout << *value << '\n';
value = w.next();
}
CLI
./bin/wildling "Year 19##"
./bin/wildling --dictionary planets:../dictionaries/planets.txt "%{'planets'}"
./bin/wildling --template ./config.json
Help text and --check output follow docs/cli.md / docs/help.txt.
Build
./build.sh # Docker (gcc:14-bookworm): g++ -std=c++17 → dist/wildling
Project tests live in ../tests/ and are run with ../test.sh.