xentara-utils v1.2.1
Xentara utilities library
Loading...
Searching...
No Matches
xentara::utils::windows::AbstractHresultErrorCategory Class Reference

Base class for error categories for Windows HRESULT values. More...

#include <windows/Errors.hpp>

+ Inheritance diagram for xentara::utils::windows::AbstractHresultErrorCategory:

Public Member Functions

auto message (int errorCode) const -> std::string override
 Gets an error message for an error code.
 
auto default_error_condition (int errorCode) const noexcept -> std::error_condition override
 Constructus an error condition object for an error code.
 
- Public Member Functions inherited from std::error_category
T default_error_condition (T... args)
 
T equivalent (T... args)
 
T error_category (T... args)
 
T message (T... args)
 
T name (T... args)
 
T operator!= (T... args)
 
T operator< (T... args)
 
T operator== (T... args)
 
T ~error_category (T... args)
 

Detailed Description

Base class for error categories for Windows HRESULT values.

This class provides default implementations for std::error_category::message() and std::error_category::default_error_condition() that handle error codes for the standard Error facilities. You can derive this class to extend the support to support error codes of custom facilities.

Note
This class is only available under Windows
See also
Error Handling in COM in the Programming reference for the Win32 API at docs.microsoft.com.

Member Function Documentation

◆ default_error_condition()

auto xentara::utils::windows::AbstractHresultErrorCategory::default_error_condition ( int  errorCode) const -> std::error_condition
overridenoexcept

Constructus an error condition object for an error code.

Subclasses can override this function, and call the base class implementation to handle error codes they don't know.

Parameters
errorCodeThe error code. This will be an HRESULT cat to int.
Returns
An error condition appropriate for the given HRESULT.

◆ message()

auto xentara::utils::windows::AbstractHresultErrorCategory::message ( int  errorCode) const -> std::string
override

Gets an error message for an error code.

Subclasses can override this function, and call the base class implementation to handle error codes they don't know.

Parameters
errorCodeThe error code. This will be an HRESULT cat to int.
Returns
An error message appropriate for the given HRESULT.