Werkzeugkiste - Yet Another C++ Utility Library
This library is a collection of frequently used C++ snippets copy-pasted across way too many of my projects. Since there's tons of so-called utilities, utils, tools & toolboxes out there, I prefer to call this one werkzeugkiste
, i.e. the German word for toolbox.
Functionality
This toolbox will only receive sporadic updates, basically whenever I have to reuse (and modernize) some of my older code. Currently, it provides the following functionality. Note that the namespace name also equals the corresponding CMake target to be linked against:
werkzeugkiste::
: Utilitity to interact with TOML/JSON/libconfig configurations.config werkzeugkiste::
: Sorting/lookup utilities and a custom circular buffer.container werkzeugkiste::
: Basic file I/O and filesystem utilities. Caveat: These utilities are only tested on/available for GNU/Linux. For portable applications, C++17'sfiles std::filesystem
should be used instead.werkzeugkiste::
: Math utilities, focused on basic 2D & 3D geometry.geometry werkzeugkiste::
: Common string manipulation.strings werkzeugkiste::
: Provides a stop watch & additional helpers on top oftiming std::chrono
(to hide some of its template boilerplate).
Requirements
- A C++ compiler supporting at least C++17
- CMake >= 3.14 and a compatible build tool, like Make, Ninja, etc.
- The linear algebra library Eigen3
Usage
The recommended way to include werkzeugkiste
in a C++ project is via CMake's FetchContent
:
# Fetch the library: include(FetchContent) FetchContent_Declare( werkzeugkiste GIT_REPOSITORY https://github.com/snototter/werkzeugkiste.git GIT_TAG main) FetchContent_MakeAvailable(werkzeugkiste) # Optionally print the available library version: message(STATUS "Using werkzeugkiste v${werkzeugkiste_VERSION}")
Afterwards, add it to your consuming executable/library via:
target_link_libraries( your_target PRIVATE werkzeugkiste::config werkzeugkiste::geometry werkzeugkiste::strings # Add other werkzeugkiste packages if needed )
Contributing
- Details for developers or users who need to manually build and install
werkzeugkiste
are provided in the separate BUILDING document. - Contribution guidelines are summarized in the CONTRIBUTING document.