StormByte C++ Library 0.0.9999
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).
|
Main namespace for the StormByte library. More...
Classes | |
class | ArithmeticMutexed |
class | Clonable |
A class that can be cloned. More... | |
class | Exception |
Base class for exceptions in the StormByte library. More... | |
struct | is_container |
Type trait to check if a type is a container. More... | |
struct | is_container< T, std::void_t< decltype(std::declval< T >().begin()), decltype(std::declval< T >().end()), typename T::value_type > > |
Type trait specialization for containers. More... | |
struct | is_optional |
Type trait to check if a type is an optional. More... | |
struct | is_optional< T, std::void_t< typename T::value_type > > |
Type trait specialization for std::optional . More... | |
struct | is_pair |
Type trait to check if a type is a pair. More... | |
struct | is_pair< T, std::void_t< decltype(std::declval< T >().first), decltype(std::declval< T >().second) > > |
Type trait specialization for pairs. More... | |
struct | is_reference |
Type traits for checking if a type is a reference. More... | |
class | Logger |
A flexible and extensible logging utility. More... | |
class | Mutexed |
class | Serializable |
The class to serialize and deserialize data. More... | |
class | VariadicValue |
A class that can hold a value of any of the specified types. More... | |
Concepts | |
concept | ValidSmartPointer |
Concept to check if a type is a valid smart pointer. | |
concept | ValidVariadicType |
Concept to check if a type is a valid variadic type. | |
Typedefs | |
template<typename T , class E > | |
using | Expected = std::conditional_t< is_reference< T >::value, std::expected< std::reference_wrapper< std::remove_reference_t< T > >, std::shared_ptr< E > >, std::expected< T, std::shared_ptr< E > > > |
Expected type with support for reference types. | |
Functions | |
template<typename E > | |
auto | Unexpected (std::shared_ptr< E > error_ptr) |
Creates an std::unexpected with a shared pointer to the error. | |
template<typename E > | |
auto | Unexpected (E &&error) |
Creates an std::unexpected with a new error instance. | |
template<typename E , typename... Args> | |
auto | Unexpected (const std::string &fmt, Args &&... args) |
Creates an std::unexpected with a formatted error message. | |
STORMBYTE_PUBLIC Logger & | humanreadable_number (Logger &logger) noexcept |
STORMBYTE_PUBLIC Logger & | humanreadable_bytes (Logger &logger) noexcept |
STORMBYTE_PUBLIC Logger & | nohumanreadable (Logger &logger) noexcept |
template<typename Ptr , typename T > requires std::is_same_v<Ptr, std::shared_ptr<Logger>> || std::is_same_v<Ptr, std::unique_ptr<Logger>> | |
Ptr & | operator<< (Ptr &logger, const T &value) noexcept |
template<typename Ptr > requires std::is_same_v<Ptr, std::shared_ptr<Logger>> || std::is_same_v<Ptr, std::unique_ptr<Logger>> | |
Ptr & | operator<< (Ptr &logger, const Logger::Level &level) noexcept |
template<typename Ptr > requires std::is_same_v<Ptr, std::shared_ptr<Logger>> || std::is_same_v<Ptr, std::unique_ptr<Logger>> | |
Ptr & | operator<< (Ptr &logger, std::ostream &(*manip)(std::ostream &)) noexcept |
Main namespace for the StormByte library.
The StormByte
namespace serves as the root for all components and utilities in the StormByte library. It provides foundational classes and tools for building robust, thread-safe, and efficient applications.
using StormByte::Expected = typedef std::conditional_t< is_reference<T>::value, std::expected<std::reference_wrapper<std::remove_reference_t<T> >, std::shared_ptr<E> >, std::expected<T, std::shared_ptr<E> > > |
Expected type with support for reference types.
T | Expected type |
E | Error type |
Defines an alias for std::expected
, with special handling for reference types. For reference types, the std::reference_wrapper
ensures safe and efficient storage, while the error type is managed using std::shared_ptr
to support dynamic allocation.
Creates an std::unexpected
with a formatted error message.
E | Error type |
Args | Types of arguments to format the error message |
fmt | The format string |
args | Arguments to format the string |
std::unexpected
object containing a shared pointer to the errorDynamically formats the error message using std::vformat
and constructs the error instance with the formatted message. If no arguments are provided, it directly uses the format string as the error message.
Creates an std::unexpected
with a new error instance.
E | Error type |
error | Error instance to store |
std::unexpected
object containing a shared pointer to the new error instanceThis overload constructs a new error instance by forwarding the provided argument.
Creates an std::unexpected
with a shared pointer to the error.
E | Error type |
error_ptr | A shared pointer to the error |
std::unexpected
object containing the shared pointer to the errorThis overload is used when an existing std::shared_ptr
to the error instance is available.