Root namespace of the StormByte suite. More...
Namespaces | |
| namespace | Error |
| Error-code domains and the StormByte::Error::Fault value type. | |
| namespace | Safe |
| Owned values that cross a DLL without the caller's CRT. | |
| namespace | Type |
| Named concepts and small type utilities used across the suite. | |
| namespace | Detail |
| Private specialization point for non-trivial types. | |
| namespace | Test |
Classes | |
| class | Bitmask |
| CRTP wrapper that stores an unsigned enum as a flag set. More... | |
| class | ByteSize |
| Count of octets (uint64_t storage). More... | |
| class | Exception |
| Base exception type for the suite. More... | |
| class | DeserializeError |
| Deserialization failed. More... | |
| class | OperationError |
| An operation failed with an exception outside the StormByte hierarchy. More... | |
| class | Base64Error |
| Base64 encode or decode failed. More... | |
| class | Serializable |
Encodes and decodes one value of type T. More... | |
| class | Size |
| Count of abstract units (uint64_t storage). More... | |
| class | Clock |
| Thread-safe aggregate of independently timed operation samples. More... | |
| class | Telemetry |
| Abstract session telemetry base with a protected clock drawer. More... | |
| class | ThreadLock |
| Mutex with owner-thread reentry. More... | |
Typedefs | |
| template<typename T, class E> | |
| using | Expected |
| std::expected alias with reference and shared-error handling. | |
Functions | |
| Safe::Binary | Base64Decode (std::string_view input) |
| Decodes Base64 text into bytes. | |
| Safe::String | Base64Encode (const Safe::Binary &input) |
| Encodes bytes as Base64 with = padding. | |
| Safe::String | Base64Encode (std::span< const std::byte > input) |
| Encodes a contiguous byte span as Base64 with = padding. | |
| template<Type::Integral T> | |
| constexpr bool | operator== (ByteSize lhs, T rhs) |
| Mixed equality. | |
| template<Type::Integral T> | |
| constexpr bool | operator== (T lhs, ByteSize rhs) |
| Mixed equality. | |
| template<Type::Integral T> | |
| constexpr ByteSize | operator+ (ByteSize lhs, T rhs) |
| Mixed sum. | |
| template<Type::Integral T> | |
| constexpr ByteSize | operator+ (T lhs, ByteSize rhs) |
| Mixed sum. | |
| template<Type::Integral T> | |
| constexpr ByteSize | operator- (ByteSize lhs, T rhs) |
| Mixed difference. | |
| template<Type::Integral T> | |
| constexpr ByteSize | operator- (T lhs, ByteSize rhs) |
| Mixed difference. | |
| template<Type::Integral T> | |
| constexpr ByteSize | operator* (ByteSize lhs, T rhs) |
| Mixed product. | |
| template<Type::Integral T> | |
| constexpr ByteSize | operator* (T lhs, ByteSize rhs) |
| Mixed product. | |
| template<Type::Integral T> | |
| constexpr ByteSize | operator/ (ByteSize lhs, T rhs) |
| Mixed quotient. | |
| template<Type::Integral T> | |
| constexpr ByteSize | operator% (ByteSize lhs, T rhs) |
| Mixed remainder. | |
| std::ostream & | operator<< (std::ostream &stream, ByteSize size) |
| Writes the IEC human-readable length. | |
| template<typename E> | |
| auto | Unexpected (Safe::Shared< E > error) |
| Forwards an error already stored by Expected. | |
| template<typename E> | |
| auto | Unexpected (std::shared_ptr< E >)=delete |
| Rejects a std::shared_ptr. | |
| template<typename E> requires ( !requires { typename std::remove_cvref_t<E>::element_type; } || !Type::SameAs<std::remove_cvref_t<E>, Safe::Shared<typename std::remove_cvref_t<E>::element_type>> ) | |
| auto | Unexpected (E &&error) |
| Builds std::unexpected by constructing E. | |
| template<typename Base, typename Derived> requires Type::DerivedFrom<std::decay_t<Derived>, Base> && (!Type::SameAs<Base, std::decay_t<Derived>>) | |
| auto | Unexpected (Derived &&error) -> std::unexpected< Safe::Shared< Base > > |
| Builds std::unexpected from a derived error. | |
| template<typename E, typename... Args> | |
| auto | Unexpected (const std::string &fmt, Args &&... args) |
| Builds std::unexpected from a format string and E(string). | |
| void | append_bytes (Safe::Binary &dest, std::span< const std::byte > src) noexcept |
| Appends a span of bytes onto a Safe::Binary. | |
| void | append_bytes (Safe::Binary &dest, const Safe::Binary &src) noexcept |
| Appends a Safe::Binary by copy. | |
| void | append_bytes (Safe::Binary &dest, Safe::Binary &&src) noexcept |
| Appends a Safe::Binary by move on Base's heap. | |
| template<Type::Integral T> | |
| constexpr bool | operator== (Size lhs, T rhs) |
| Mixed equality. | |
| template<Type::Integral T> | |
| constexpr bool | operator== (T lhs, Size rhs) |
| Mixed equality. | |
| template<Type::Integral T> | |
| constexpr Size | operator+ (Size lhs, T rhs) |
| Mixed sum. | |
| template<Type::Integral T> | |
| constexpr Size | operator+ (T lhs, Size rhs) |
| Mixed sum. | |
| template<Type::Integral T> | |
| constexpr Size | operator- (Size lhs, T rhs) |
| Mixed difference. | |
| template<Type::Integral T> | |
| constexpr Size | operator- (T lhs, Size rhs) |
| Mixed difference. | |
| template<Type::Integral T> | |
| constexpr Size | operator* (Size lhs, T rhs) |
| Mixed product. | |
| template<Type::Integral T> | |
| constexpr Size | operator* (T lhs, Size rhs) |
| Mixed product. | |
| template<Type::Integral T> | |
| constexpr Size | operator/ (Size lhs, T rhs) |
| Mixed quotient. | |
| template<Type::Integral T> | |
| constexpr Size | operator/ (T lhs, Size rhs) |
| Mixed quotient. | |
| template<Type::Integral T> | |
| constexpr Size | operator% (Size lhs, T rhs) |
| Mixed remainder. | |
| template<Type::Integral T> | |
| constexpr Size | operator% (T lhs, Size rhs) |
| Mixed remainder. | |
| std::ostream & | operator<< (std::ostream &stream, Size size) |
| Writes the decimal count. | |
| Safe::String | GenerateUUIDv4 () noexcept |
| RFC 4122 UUID version 4 (lowercase). | |
Variables | |
| constexpr ByteSize | B {1ull} |
| One octet. | |
| constexpr ByteSize | KiB {1024ull} |
| 2^10 octets. | |
| constexpr ByteSize | MiB {1024ull * 1024} |
| 2^20 octets. | |
| constexpr ByteSize | GiB {1024ull * 1024 * 1024} |
| 2^30 octets. | |
| constexpr ByteSize | TiB {1024ull * 1024 * 1024 * 1024} |
| 2^40 octets. | |
| constexpr ByteSize | PiB {1024ull * 1024 * 1024 * 1024 * 1024} |
| 2^50 octets. | |
| constexpr ByteSize | EiB {1024ull * 1024 * 1024 * 1024 * 1024 * 1024} |
| 2^60 octets. | |
| constexpr ByteSize | KB {1000ull} |
| 10^3 octets. | |
| constexpr ByteSize | MB {1000ull * 1000} |
| 10^6 octets. | |
| constexpr ByteSize | GB {1000ull * 1000 * 1000} |
| 10^9 octets. | |
| constexpr ByteSize | TB {1000ull * 1000 * 1000 * 1000} |
| 10^12 octets. | |
| constexpr ByteSize | PB {1000ull * 1000 * 1000 * 1000 * 1000} |
| 10^15 octets. | |
| constexpr ByteSize | EB {1000ull * 1000 * 1000 * 1000 * 1000 * 1000} |
| 10^18 octets. | |
Root namespace of the StormByte suite.
| using StormByte::Expected |
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 Safe::Shared. Converts to std::shared_ptr<E>. |
|
inlinenoexcept |
Appends a Safe::Binary by copy.
| dest | Destination owned by Base. |
| src | Source sequence (read-only). |
|
inlinenoexcept |
Appends a Safe::Binary by move on Base's heap.
| dest | Destination owned by Base. |
| src | Source sequence; emptied after a successful append. |
|
inlinenoexcept |
Appends a span of bytes onto a Safe::Binary.
| dest | Destination owned by Base. |
| src | View over the bytes to copy. |
| Safe::Binary 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. |
| Safe::String StormByte::Base64Encode | ( | const Safe::Binary & | input | ) |
Encodes bytes as Base64 with = padding.
| input | Bytes to encode. |
| Safe::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).
Mixed remainder.
| T | Integral type. |
| lhs | Dividend. |
| rhs | Divisor. |
Mixed remainder.
| T | Integral type. |
| lhs | Dividend. |
| rhs | Divisor. |
Mixed remainder.
| T | Integral type. |
| lhs | Dividend. |
| rhs | Divisor. |
Mixed product.
| T | Integral type. |
| lhs | Left factor. |
| rhs | Right factor. |
Mixed product.
| T | Integral type. |
| lhs | Left factor. |
| rhs | Right factor. |
Mixed product.
| T | Integral type. |
| lhs | Left factor. |
| rhs | Right factor. |
Mixed product.
| T | Integral type. |
| lhs | Left factor. |
| rhs | Right factor. |
Mixed sum.
| T | Integral type. |
| lhs | Left addend. |
| rhs | Right addend. |
Mixed sum.
| T | Integral type. |
| lhs | Left addend. |
| rhs | Right addend. |
Mixed sum.
| T | Integral type. |
| lhs | Left addend. |
| rhs | Right addend. |
Mixed sum.
| T | Integral type. |
| lhs | Left addend. |
| rhs | Right addend. |
Mixed difference.
| T | Integral type. |
| lhs | Minuend. |
| rhs | Subtrahend. |
Mixed difference.
| T | Integral type. |
| lhs | Minuend. |
| rhs | Subtrahend. |
Mixed difference.
| T | Integral type. |
| lhs | Minuend. |
| rhs | Subtrahend. |
Mixed difference.
| T | Integral type. |
| lhs | Minuend. |
| rhs | Subtrahend. |
Mixed quotient.
| T | Integral type. |
| lhs | Dividend. |
| rhs | Divisor. |
Mixed quotient.
| T | Integral type. |
| lhs | Dividend. |
| rhs | Divisor. |
Mixed quotient.
| T | Integral type. |
| lhs | Dividend. |
| rhs | Divisor. |
|
inline |
Writes the IEC human-readable length.
| stream | Destination. |
| size | Length. |
stream.
|
inline |
Writes the decimal count.
| stream | Destination. |
| size | Count. |
stream.
|
constexprnoexcept |
Mixed equality.
Mixed equality with an integer.
| T | Integral type. |
| lhs | Left length. |
| rhs | Right integer. |
|
constexprnoexcept |
Mixed equality.
| T | Integral type. |
| lhs | Left count. |
| rhs | Right integer. |
|
constexprnoexcept |
Mixed equality.
Mixed equality with an integer.
| T | Integral type. |
| lhs | Left integer. |
| rhs | Right length. |
|
constexprnoexcept |
Mixed equality.
| T | Integral type. |
| lhs | Left integer. |
| rhs | Right count. |
| auto StormByte::Unexpected | ( | const std::string & | fmt, |
| Args &&... | args ) |
Builds std::unexpected from a format string and E(string).
| E | Error type. Constructed as E(formatted). |
| Args | Format argument types. |
| fmt | Format string. Used as-is when Args is empty. |
| args | Format arguments for std::vformat. |
Formatting runs in the caller. E is then constructed on Base's heap, so Unexpected<VaultException>("Password '{}' not found", name) stays valid.
| auto StormByte::Unexpected | ( | Derived && | error | ) | ->std::unexpected< Safe::Shared< Base > > |
Builds std::unexpected from a derived error.
| Base | Error base type stored in the pointer. |
| Derived | Concrete error type, derived from Base and not the same type. |
| error | Derived instance to own. |
Derived. | auto StormByte::Unexpected | ( | E && | error | ) |
Builds std::unexpected by constructing E.
| E | Error type. |
| error | Error instance, moved or copied onto Base's heap. |
| auto StormByte::Unexpected | ( | Safe::Shared< E > | error | ) |
Forwards an error already stored by Expected.
| E | Error type. |
| error | Pointer previously built by Unexpected. Not reallocated. |
|
delete |
Rejects a std::shared_ptr.
It is not on Base's heap, and Safe::Shared does not adopt it.
| E | Error type. |
|
inlineconstexpr |
One octet.
|
inlineconstexpr |
10^18 octets.
|
inlineconstexpr |
2^60 octets.
|
inlineconstexpr |
10^9 octets.
|
inlineconstexpr |
2^30 octets.
|
inlineconstexpr |
10^3 octets.
|
inlineconstexpr |
10^6 octets.
|
inlineconstexpr |
2^20 octets.
|
inlineconstexpr |
10^15 octets.
|
inlineconstexpr |
2^50 octets.
|
inlineconstexpr |
10^12 octets.
|
inlineconstexpr |
2^40 octets.