64 Error(Error&&) noexcept = default;
68 Error& operator=(Error&&) noexcept = default;
72 Error(const Error&) = default;
76 Error& operator=(const Error&) = default;
86 [[nodiscard]]
const std::string&
message()
const {
return message_; }
92 std::string
message =
"An unexpected error occurred")
101 std::string
message =
"Requested resource could not be found")
110 std::string
message =
"Requested resource did not contain any XMP data (at all)")
119 std::string
message =
"Requested resource did not contain the desired XMP key")
128 std::string
message =
"Requested XML could not be read")
137 std::string
message =
"Requested XML could not be read")
146 std::string
message =
"Requested file does not support any supported binding mechanism")
155 template <
typename T>
static Error xmp_key_not_found(std::string message="Requested resource did not contain the desired XMP key")
Creates an XMP key missing error.
Definition expected.h:118
Error(Error &&) noexcept=default
Default move constructor.
ExitCode code() const
Retrieves the underlying error code.
Definition expected.h:81
Error()=delete
Default constructor is explicitly deleted.
static Error xml_could_not_create_xpath_context(std::string message="Requested XML could not be read")
Creates an XML XPath context error.
Definition expected.h:136
static Error xmp_not_found(std::string message="Requested resource did not contain any XMP data (at all)")
Creates an XMP data missing error.
Definition expected.h:109
static Error unexpected(std::string message="An unexpected error occurred")
Creates an unknown error.
Definition expected.h:91
const std::string & message() const
Retrieves the descriptive error message.
Definition expected.h:86
static Error file_not_found(std::string message="Requested resource could not be found")
Creates a file not found error.
Definition expected.h:100
static Error xml_could_not_parse(std::string message="Requested XML could not be read")
Creates an XML parsing error.
Definition expected.h:127
static Error no_binding_support(std::string message="Requested file does not support any supported binding mechanism")
Creates an unsupported binding error.
Definition expected.h:145
Standardized integer exit codes for the nmbs application and library.
Lightweight utilities for NATO confidentiality metadata.
Definition binding.h:38
std::expected< T, Error > Expected
Alias for std::expected standardized with nmbs::Error.
Definition expected.h:156
ExitCode
Standard exit codes produced by nmbs tools.
Definition exit_code.h:33
@ xml_could_not_parse
The XML parser was unable to read the provided XML.
Definition exit_code.h:57
@ file_not_found
The specified file could not be found.
Definition exit_code.h:45
@ unknown_error
An unspecified or unknown error occurred.
Definition exit_code.h:73
@ xml_could_not_create_xpath_context
The XML parser was unable to create an XPath context.
Definition exit_code.h:61
@ xmp_not_found
No XMP packet was attached to the file.
Definition exit_code.h:49
@ no_binding_support
No binding profile is available for the selected file type.
Definition exit_code.h:69
@ xmp_key_not_found
The file contained XMP, but the desired key was missing.
Definition exit_code.h:53