cppfig 0.1.0
Modern C++20 compile-time type-safe configuration library
Loading...
Searching...
No Matches
status.h File Reference
#include <string>
#include <string_view>
#include <type_traits>
#include <utility>
#include <variant>
Include dependency graph for status.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  cppfig::Status
 A lightweight status object carrying an error code and message. More...
 
class  cppfig::StatusOr< T >
 A value-or-error type, similar to std::expected (C++23). More...
 

Namespaces

namespace  cppfig
 C++20 compile-time type-safe configuration library.
 

Enumerations

enum class  cppfig::StatusCode : std::uint8_t { cppfig::kOk = 0 , cppfig::kNotFound , cppfig::kInvalidArgument , cppfig::kInternal }
 Error codes used by cppfig operations. More...
 

Functions

auto cppfig::OkStatus () -> Status
 Returns an OK status.
 
auto cppfig::NotFoundError (std::string message) -> Status
 Returns a NotFound error status.
 
auto cppfig::InvalidArgumentError (std::string message) -> Status
 Returns an InvalidArgument error status.
 
auto cppfig::InternalError (std::string message) -> Status
 Returns an Internal error status.
 
auto cppfig::IsNotFound (const Status &status) noexcept -> bool
 Returns true if the status has code kNotFound.
 
auto cppfig::IsInvalidArgument (const Status &status) noexcept -> bool
 Returns true if the status has code kInvalidArgument.
 
auto cppfig::IsInternal (const Status &status) noexcept -> bool
 Returns true if the status has code kInternal.