|
StormByte C++ Library 1.2.0
StormByte is a comprehensive, cross-platform C++ library aimed at easing system programming, configuration management, logging, and database handling tasks. This library provides a unified API that abstracts away the complexities and inconsistencies of different platforms (Windows, Linux).
|
This repository is StormByte Base: the C++26 foundation of the StormByte suite.
It is the module every other StormByte library links. Public headers live under StormByte/ and cover exceptions, Expected, little-endian serialization, strings, paths, UUID v4, bitmasks, clonable types, a reentrant ThreadLock, and the StormByte::Type concepts.
The suite is split on purpose. Buffer, Config, Crypto, Database, Logger, Multimedia, Network and System are other repositories. They depend on this one; this one does not implement them.
StormByte::Exception with std::format messages and const char* storage (DLL-safe on Windows).Expected<T, E> on top of std::expected, references via reference_wrapper, errors as shared_ptr<E>, plus Unexpected.Serializable<T> to vector<byte>, always little-endian, no BOM and no version tag. Optional / pair / container / trivial / Detail::Codec<T>.Sleep for chrono durations.GenerateUUIDv4).Type::UnsignedEnum.Clone / Move into shared_ptr or unique_ptr.Unlock from a non-owner is a no-op.StormByte::Type::* (String, Container, Optional, Pair, enums, …). No enable_if / void_t next to them.WINDOWS / LINUX / MACOS, BIT32 / BIT64, CLANG / GCC / MSVC (clang-cl is CLANG, not MSVC).| Module | Role | API |
|---|---|---|
| Base | This repository | /StormByte |
| Buffer | FIFO, SharedFIFO, Ring, Producer/Consumer and multi-stage pipelines | /StormByte-Buffer |
| Config | Human-readable text and versioned binary documents (groups, lists, raw bytes) | /StormByte-Config |
| Crypto | Hash, compress, encrypt, sign and key agreement — Crypto++ never leaves the private tree | /StormByte-Crypto |
| Database | One API over SQLite, PostgreSQL and MariaDB | /StormByte-Database |
| Logger | Stream logger with levels, headers, human-readable sizes and redaction (ThreadedLog) | /StormByte-Logger |
| Multimedia | Decode, encode and containers without raw FFmpeg types; codecs enabled only if present | /StormByte-Multimedia |
| Network | Framed packets, Client/Server, IPv4/IPv6 TCP and Buffer pipelines (compress/encrypt) | /StormByte-Network |
| System | Processes, pipes and environment variables across Linux, Windows and macOS | /StormByte-System |
Needs a C++26 compiler and CMake 3.28 or newer.
Headers are #include <StormByte/….hxx>. Namespace root is StormByte.
Errors are shared_ptr<E>. Read them with result.error()->what().
Error::Code exists for std::error_code integration. The enum has no enumerators yet.
Wire is little-endian. Deserialize reads a prefix; leftover bytes stay with the caller. Custom types specialize StormByte::Detail::Codec<T> (Size / Write / Read), not Serializable<T>.
wstring / u16string / u32string travel as uint64 UTF-8 length + UTF-8 bytes. Host wchar_t width never appears on the wire.
CurrentPath() is the process cwd. ExecutablePath() is the directory of the running binary (NOPATH if it cannot be resolved).
The owner may Lock() again. Another thread blocks. Unlock() from a non-owner does nothing.
Type::Detail::swap_endian always reverses bytes. Serializable decides when to call it (host not little-endian).
Needs an unsigned scoped enum. Operators return the derived CRTP type. Helpers are Add, Remove, Has, HasAny, HasNone, Value (not Any / None).
Issues only on this repository. Fork and open a pull request against master.
GNU Lesser General Public License version 3 or later. See [LICENSE](LICENSE) and https://www.gnu.org/licenses/lgpl-3.0.html.
StormByte is developed in spare time. Sponsorship is optional and does not buy features, priority or support.