|
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).
|
Root namespace of the StormByte suite. More...
Namespaces | |
| namespace | Detail |
| Private specialization point for non-trivial types. | |
| namespace | Error |
std::error_code integration for suite-wide codes. | |
| namespace | String |
| String helpers (case, split, UTF-8, human-readable numbers). | |
| namespace | System |
| Path and timing helpers that hide OS differences. | |
| namespace | Test |
| namespace | Type |
| Named concepts and small type utilities used across the suite. | |
Classes | |
| class | Base64Error |
| Thrown when Base64 encode or decode fails. More... | |
| class | Bitmask |
| CRTP wrapper that stores an unsigned enum as a flag set. More... | |
| class | Clonable |
Polymorphic clone/move into a smart pointer of type T. More... | |
| struct | Component |
Wraps a module name for the component-prefixed Exception constructor. More... | |
| class | DeserializeError |
| Thrown when deserialization fails. More... | |
| class | Exception |
| Base exception type for the suite. More... | |
| class | Iterable |
| Wrapper that adds a uniform iteration and mutation API around a standard container. More... | |
| class | OutOfBoundsError |
| Thrown when an index or range is out of bounds. More... | |
| class | Serializable |
Encodes and decodes one value of type T. More... | |
| class | SystemError |
| Thrown when a System helper cannot obtain a path or create a temporary file. More... | |
| class | ThreadLock |
| Mutex with owner-thread reentry. More... | |
| class | UTF8Error |
| Thrown when UTF-8 or wide-string input contains invalid Unicode. More... | |
Concepts | |
| concept | ValidSmartPointer |
true when SmartPointer is shared_ptr<T> or unique_ptr<T>. | |
Typedefs | |
| template<typename T , class E > | |
| using | Expected = std::conditional_t< Type::Reference< T >, std::expected< std::reference_wrapper< std::remove_reference_t< T > >, std::shared_ptr< E > >, std::expected< T, std::shared_ptr< E > > > |
std::expected alias with reference and shared-error handling. | |
Functions | |
| std::vector< std::byte > | Base64Decode (std::string_view input) |
| Decodes Base64 text into bytes. | |
| std::string | Base64Encode (const std::vector< std::byte > &input) |
Encodes bytes as Base64 with = padding. | |
| std::string | Base64Encode (std::span< const std::byte > input) |
Encodes a contiguous byte span as Base64 with = padding. | |
| std::error_code | make_error_code (Error::Code e) |
Builds an std::error_code from Error::Code. | |
| template<typename E > | |
| auto | Unexpected (std::shared_ptr< E > error_ptr) |
Builds std::unexpected from an existing error pointer. | |
| template<typename E > | |
| auto | Unexpected (E &&error) |
Builds std::unexpected by constructing E. | |
| template<typename Base , typename Derived > requires std::is_base_of_v<Base, std::decay_t<Derived>> && (!std::same_as<Base, std::decay_t<Derived>>) | |
| auto | Unexpected (Derived &&error) -> std::unexpected< std::shared_ptr< Base > > |
Builds std::unexpected<shared_ptr<Base>> from a Derived instance. | |
| template<typename E , typename... Args> | |
| auto | Unexpected (const std::string &fmt, Args &&... args) |
Builds std::unexpected from a format string and E(string) constructor. | |
| template<typename T , typename U > requires Type::ConvertibleTo<T, U> | |
| void | append_vector (std::vector< T > &dest, std::span< U > src) noexcept |
| Appends a span of convertible elements onto a vector. | |
| template<typename T > | |
| void | append_vector (std::vector< T > &dest, const std::vector< T > &src) noexcept |
| Appends a vector by copy. | |
| template<typename T > | |
| void | append_vector (std::vector< T > &dest, std::vector< T > &&src) noexcept |
| Appends a vector by move. | |
| std::string | GenerateUUIDv4 () noexcept |
| RFC 4122 UUID version 4 (lowercase). | |
Root namespace of the StormByte suite.
| using StormByte::Expected = typedef std::conditional_t< Type::Reference<T>, std::expected<std::reference_wrapper<std::remove_reference_t<T> >, std::shared_ptr<E> >, std::expected<T, std::shared_ptr<E> > > |
std::expected alias with reference and shared-error handling.
| T | Value type. References are stored as std::reference_wrapper. |
| E | Error type. Always stored as std::shared_ptr<E>. |
|
noexcept |
Appends a vector by copy.
| T | Element type. |
| dest | Vector that receives the elements. |
| src | Source vector (read-only). |
|
noexcept |
Appends a span of convertible elements onto a vector.
| T | Destination element type. |
| U | Source element type (Type::ConvertibleTo<T, U>). |
| dest | Vector that receives the elements. |
| src | View over the elements to copy. |
append_range when the library has it.
|
noexcept |
Appends a vector by move.
| T | Element type. |
| dest | Vector that receives the elements. |
| src | Source vector; elements are moved out. |
append_range(std::move(src)) when available. | std::vector< std::byte > StormByte::Base64Decode | ( | std::string_view | input | ) |
Decodes Base64 text into bytes.
Alphabet A–Z a–z 0–9 + / and padding =. Space, tab, newline and CR are ignored. Decoding stops at the first =. Padding is accepted but not strictly checked.
| input | Base64 text (std::string_view, std::string or a string literal). |
| StormByte::Base64Error | If a character is outside the alphabet. |
| std::string StormByte::Base64Encode | ( | const std::vector< std::byte > & | input | ) |
Encodes bytes as Base64 with = padding.
| input | Bytes to encode. |
| std::string StormByte::Base64Encode | ( | std::span< const std::byte > | input | ) |
Encodes a contiguous byte span as Base64 with = padding.
| input | Bytes to encode. |
|
noexcept |
RFC 4122 UUID version 4 (lowercase).
xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx where y is 8, 9, a or b. uuid.cxx. | std::error_code StormByte::make_error_code | ( | Error::Code | e | ) |
Builds an std::error_code from Error::Code.
| e | Suite error enumerator. |
std::error_code in Error::category(). | auto StormByte::Unexpected | ( | const std::string & | fmt, |
| Args &&... | args | ||
| ) |
Builds std::unexpected from a format string and E(string) constructor.
| E | Error type. |
| Args | Format argument types. |
| fmt | Format string (used as-is when Args is empty). |
| args | Format arguments for std::vformat. |
std::unexpected holding make_shared<E>(formatted). | auto StormByte::Unexpected | ( | Derived && | error | ) | -> std::unexpected<std::shared_ptr<Base>> |
Builds std::unexpected<shared_ptr<Base>> from a Derived instance.
| Base | Error base type stored in the pointer. |
| Derived | Concrete error type (std::is_base_of_v<Base, Derived>). |
| error | Derived instance to own. |
std::unexpected with an upcast shared_ptr<Base>. | auto StormByte::Unexpected | ( | E && | error | ) |
| auto StormByte::Unexpected | ( | std::shared_ptr< E > | error_ptr | ) |
Builds std::unexpected from an existing error pointer.
| E | Error type. |
| error_ptr | Shared pointer to the error. |
std::unexpected holding that pointer.