About this project
StormByte Base is the C++26 foundation module that every other library in the StormByte suite links against. Public headers live under `StormByte/` and the namespace root is `StormByte`. It requires a C++26 compiler and CMake 3.28 or newer, and builds on Linux, Windows and macOS.
Core facilities documented in the README:
- **Exceptions** — `StormByte::Exception` builds hierarchical messages such as `StormByte.Crypto.Crypter: …`; `what()` returns a `CString`. Each named type defines its destructor in the module `.cxx` so `catch` matches across DLL boundaries.
- **Error** — `Domain`, `Category`, `Code` and `Fault` for `std::error_code`; `Fault::what()` returns a `CString` for cross-DLL use.
- **Expected** — `Expected<T, E>` layered on `std::expected`, with the error held as a `Shared<E>` on Base's heap and convertible to `std::shared_ptr<E>`.
- **Serialization** — `Serializable<T>` to `BinaryData`, always little-endian, no BOM or version tag; custom types specialize `Detail::Codec<T>`. Wide strings travel as UTF-8 with a `uint64` length.
- **CString / WCString** — owned NUL-terminated narrow and wide buffers safe across DLL boundaries, with content equality, ordering, `swap` and `std::hash`.
- **BinaryData** — owned contiguous `std::byte` sequence with a `std::vector<std::byte>`-like API, `HexDump` output, and interoperability with `std::span` and `std::vector`.
- **Size / ByteSize** — `uint64_t`-backed unit count and octet length types with IEC/SI constants and human-readable formatting; area products are deleted.
- **UUID** — RFC 4122 version 4 generation.
- **Bitmask** — CRTP flags over an unsigned scoped enum.
- **Safe pointers** — `Shared`, `Unique` and `Weak` complement the standard smart pointers for objects that must be freed on Base's heap; `Heap` is private and not installed.
- **Clonable** — polymorphic `Clone` / `Move` returning `Shared` or `Unique` pointers.
- **ThreadLock** — owner-thread reentrant lock.
- **Type concepts** — `StormByte::Type::*` concepts such as `String`, `Container`, `Optional`, `Pair`, `Numeral` and `Array`.
- **Platform / visibility** — macros for `WINDOWS` / `LINUX` / `MACOS`, `BIT32` / `BIT64`, and `CLANG` / `GCC` / `MSVC`.
The README stresses that public Base APIs use `Size` for counts and `ByteSize` for octets rather than raw `std::size_t` / `std::uint64_t`. The suite is deliberately split: Buffer, Config, Crypto, Database, Logger, Multimedia, Network, String and System are separate repositories that depend on this one. Licensing is LGPL v3 or commercial.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.