diff options
author | Dominick Allen <djallen@librehumanitas.org> | 2024-10-27 09:04:05 -0500 |
---|---|---|
committer | Dominick Allen <djallen@librehumanitas.org> | 2024-10-27 09:04:05 -0500 |
commit | b8345246dcc2121bcb6d1515a9341789de20199f (patch) | |
tree | 4a25857512a90ff38e8a40166c54694b74920216 /include/fud_status.hpp | |
parent | f84b8259f6e980fed647d8e1ec0634f89ee59c06 (diff) |
First crack at file objects.
Diffstat (limited to 'include/fud_status.hpp')
-rw-r--r-- | include/fud_status.hpp | 45 |
1 files changed, 37 insertions, 8 deletions
diff --git a/include/fud_status.hpp b/include/fud_status.hpp index d57a9c5..f18c119 100644 --- a/include/fud_status.hpp +++ b/include/fud_status.hpp @@ -18,32 +18,59 @@ #ifndef FUD_STATUS_HPP #define FUD_STATUS_HPP +#include <cstdint> + namespace fud { -enum class [[nodiscard]] FudStatus +enum class [[nodiscard]] FudStatus : int32_t { + /** \brief Indisputable success. */ Success = 0, + /** \brief Either partially succeeding, or failing in a recoverable way. */ Partial, + /** \brief Typically a major failure in an underlying system call. */ Failure, + /** \brief An argument passed in was a null pointer and is invalid. */ NullPointer, + /** \brief An argument passed in is in an invalid state or mismatches with other arguments. */ ArgumentInvalid, - VariantInvalid, + /** \brief An handle to a managed object is not valid. */ + HandleInvalid, + /** \brief An object is uninitialized or no longer valid. */ ObjectInvalid, + /** \brief A utf sequence in a string is invalid. */ Utf8Invalid, + /** \brief A string is not terminated or has a length field exceeding its capacity. */ StringInvalid, + /** \brief The requested operation on the object is not valid for its current state. */ OperationInvalid, + /** \brief An object which is to be initialized has already been initialized. */ AlreadyInitialized, + /** \brief A format string is invalid. */ FormatInvalid, + /** \brief A string being parsed as a number is out of range for the requested type. */ RangeError, + /** \brief The given index is not in range of a randomly accessible container. */ IndexInvalid, + /** \brief An object in a container already exists in the requested slot for a new object. */ Exists, + /** \brief An object in a container does not exist in the requested slot for an existing object. */ NotFound, + /** \brief A container is empty when something was expected to be present. */ Empty, + /** \brief A container is full when attempting to add something to it. */ Full, + /** \brief An operation requiring elevated permissions failed. */ + PermissionDenied, + /** \brief Two or more objects overlap when they are expected to be distinct. */ Aliased, + /** \brief An requested allocation could not be completed. */ AllocFailure, + /** \brief An requested deallocation could not be completed. */ DeallocFailure, + /** \brief The function is not implemented, but is planned to be implemented. */ NotImplemented, + /** \brief The function or desired mode of action for a function is not supported. */ NotSupported }; @@ -58,20 +85,20 @@ constexpr const char* FudStatusToString(FudStatus status) return "Failure"; case FudStatus::NullPointer: return "NullPointer"; - case FudStatus::StringInvalid: - return "StringInvalid"; + case FudStatus::ArgumentInvalid: + return "ArgumentInvalid"; + case FudStatus::HandleInvalid: + return "HandleInvalid"; case FudStatus::ObjectInvalid: return "ObjectInvalid"; + case FudStatus::StringInvalid: + return "StringInvalid"; case FudStatus::OperationInvalid: return "OperationInvalid"; - case FudStatus::ArgumentInvalid: - return "ArgumentInvalid"; case FudStatus::Utf8Invalid: return "Utf8Invalid"; case FudStatus::RangeError: return "RangeError"; - case FudStatus::VariantInvalid: - return "VariantInvalid"; case FudStatus::FormatInvalid: return "FormatInvalid"; case FudStatus::AlreadyInitialized: @@ -86,6 +113,8 @@ constexpr const char* FudStatusToString(FudStatus status) return "Empty"; case FudStatus::Full: return "Full"; + case FudStatus::PermissionDenied: + return "PermissionDenied"; case FudStatus::Aliased: return "Aliased"; case FudStatus::AllocFailure: |