An open API service indexing awesome lists of open source software.

https://github.com/ntoskrnl7/ext

C++ Extended Template Library
https://github.com/ntoskrnl7/ext

boost clang cmake cpp cross-platform easy-to-use feature gcc linux macos morden-cpp msvc process std stl util windows

Last synced: about 19 hours ago
JSON representation

C++ Extended Template Library

Awesome Lists containing this project

README

          

# ext

C++ **EX**tended **T**emplate Library

**ext** is a small, header-oriented C++ utility library for projects that need
portable building blocks across old and modern toolchains. It focuses on
independent helpers around compatibility, strings, parsing, process I/O,
threading, and small application patterns rather than trying to be a framework.

The library intentionally carries compatibility code for older compilers such
as Visual Studio 2008 SP1 while also exposing cleaner APIs on newer C++
standards. Some features therefore have different availability and guarantees
depending on compiler, standard library, and platform support.

[![CMake](https://github.com/ntoskrnl7/ext/actions/workflows/cmake.yml/badge.svg?branch=master&event=push)](https://github.com/ntoskrnl7/ext/actions/workflows/cmake.yml?query=branch%3Amaster)
[![MSYS2](https://github.com/ntoskrnl7/ext/actions/workflows/msys2.yml/badge.svg?branch=master&event=push)](https://github.com/ntoskrnl7/ext/actions/workflows/msys2.yml?query=branch%3Amaster)
[![License: BSD-3-Clause](https://img.shields.io/badge/license-BSD--3--Clause-green.svg)](LICENSE)
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/ntoskrnl7/ext)
![CMake 3.14+](https://img.shields.io/badge/CMake-3.14+-yellow.svg?logo=cmake&logoColor=white)
![C++ 03+](https://img.shields.io/badge/C++-03+-white.svg?logo=cplusplus&logoColor=blue)

## Requirements

- GCC 8.3.0+
- Clang 10.0+
- Visual Studio 2008 SP1+
- Boost 1.69.0+ (optional)
- Git 2.0+
- CMake 3.14+

See [Build and Test](docs/build-and-test.md) for tested platforms, MSYS2 setup, and local test commands.

## Quick Start

```cmake
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
project(MyProject)

add_executable(tests tests.cpp)

include(cmake/CPM.cmake)
CPMAddPackage("gh:ntoskrnl7/ext@0.5.17")

target_link_libraries(tests ext)
```

## Documentation

- [API reference](docs/api/README.md)
- [Build and test](docs/build-and-test.md)
- [Portability and API contracts](docs/portability-and-contracts.md)

## Project Scope

ext is best used as a collection of opt-in headers:

- Use one feature at a time; most headers are independent utility components.
- Prefer the standard library first when it already provides the exact behavior
you need on every supported toolchain.
- Treat concurrency, cancellation, process, and shared-memory APIs as thin
wrappers over platform behavior. Their exact guarantees are documented per API
and summarized in [Portability and API contracts](docs/portability-and-contracts.md).
- Compatibility shims live behind feature checks and `CXX_USE_*` macros. New
code should avoid depending on those internal macros unless it is extending
ext itself.

## Features

| Feature | Header | Description |
| --- | --- | --- |
| [any_function](docs/api/any_function.md) | `` | Type-erased function wrapper that accepts arguments as `std::any` values and reports argument count/type errors explicitly. |
| [async_result](docs/api/async_result.md) | `` | Asynchronous producer/result container with iterator-style consumption and cooperative cancellation flag support. |
| [base64](docs/api/base64.md) | `` | Base64 encoder/decoder for strings, wide strings, byte vectors, and trivially copyable objects. |
| [callback](docs/api/callback.md) | `` | Multicast callback list with add/remove operators and argument forwarding. |
| [c_object](docs/api/c_object.md) | `` | C-compatible scoped object lifetime helpers with initializer/finalizer macros and custom allocation hooks. |
| [cancelable_thread](docs/api/cancelable_thread.md) | `` | Thread wrapper with deferred and immediate cancellation paths over pthread or Windows primitives. |
| [cdbg](docs/api/cdbg.md) | `` | Debug stream objects that write through platform debug sinks or console fallback streams. |
| [chain](docs/api/chain.md) | `` | Composable chain-of-responsibility helper with typed results, continuation links, and exception-aware result state. |
| [debug_utils](docs/api/debug_utils.md) | `` | Debugger detection and wait helpers for POSIX-style debug workflows. |
| [collection](docs/api/collection.md) | `` | Self-registering object collection with shared or exclusive locking around global per-type item lists. |
| [ini](docs/api/ini.md) | `` | INI parser and writer backed by nested string maps. |
| [lang](docs/api/lang.md) | `` | Korean language helpers for Hangul syllables, postpositions, and native/Sino-Korean number words. |
| [named_mutex](docs/api/named_mutex.md) | `` | Cross-process named mutex wrapper for coordinating shared resources and shared-memory payloads. |
| [observable](docs/api/observable.md) | `` | Observer pattern base template with automatic unsubscribe on observer or observable destruction. |
| [path](docs/api/path.md) | `` | Path helpers for existence checks, relative path detection, and path joining. |
| [pipe](docs/api/pipe.md) | `` | Cross-platform anonymous pipe wrapper for narrow and wide byte streams. |
| [process](docs/api/process.md) | `` | Cross-platform child process launcher with stdin/stdout/stderr pipe streams and process lifetime management. |
| [property](docs/api/property.md) | `` | Observable value wrapper with assignment validation and property-to-property propagation. |
| [pstream](docs/api/pstream.md) | `` | Native-handle-backed stream wrappers used to read from and write to process pipes. |
| [result](docs/api/result.md) | `` | Small `ok`/`err` result type for explicit value-or-error returns. |
| [safe_object](docs/api/safe_object.md) | `` | RAII lock proxy for globally named objects and mutexes selected at compile time. |
| [shared_recursive_mutex](docs/api/shared_recursive_mutex.md) | `` | Shared mutex variant that permits recursive locking by the owning thread. |
| [shared_mem](docs/api/shared_mem.md) | `` | Named shared memory creation, opening, mapping, unmapping, and destruction helpers. |
| [singleton](docs/api/singleton.md) | `` | CRTP singleton base that exposes one static instance per derived type. |
| [string](docs/api/string.md) | `` | String utility namespace for trimming, printable filtering, searching, splitting, replacement, numeric conversion, and UTF-8 helpers. |
| [stl_compat](docs/api/stl_compat.md) | `` | Compatibility macros, aliases, and fallback implementations for older C++ standards and compilers. |
| [thread_pool](docs/api/thread_pool.md) | `` | Fixed-size worker pool with future-returning task submission and explicit start/stop state. |
| [type_traits](docs/api/type_traits.md) | `` | Type-trait helpers for removing class qualifiers from member functions and deducing member-function signatures. |
| [typeinfo](docs/api/typeinfo.md) | `` | Portable type-name helper around C++ RTTI type information. |
| [units](docs/api/units.md) | `` | Strongly typed SI and IEC byte-size units with arithmetic and conversion helpers. |
| [uri](docs/api/uri.md) | `` | RFC 3986-oriented URI parser and percent-encoding helpers for narrow, wide, and UTF-8 input. |
| [version](docs/api/version.md) | `` | Semantic version parser, formatter, hashing, comparison, and mutation helper. |
| [wordexp](docs/api/wordexp.md) | `` | Environment or shell-style string expansion wrapper with platform-specific behavior. |

## License

This project is distributed under the [BSD-3-Clause license](LICENSE).