LLVM 19.0.0git
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
llvm::ECError Class Reference

This class wraps a std::error_code in a Error. More...

#include "llvm/Support/Error.h"

Inheritance diagram for llvm::ECError:
Inheritance graph
[legend]

Public Member Functions

void setErrorCode (std::error_code EC)
 
std::error_code convertToErrorCode () const override
 Convert this error to a std::error_code.
 
void log (raw_ostream &OS) const override
 Print an error message to an output stream.
 
- Public Member Functions inherited from llvm::ErrorInfo< ECError >
const void * dynamicClassID () const override
 
bool isA (const void *const ClassID) const override
 
- Public Member Functions inherited from llvm::ErrorInfoBase
virtual ~ErrorInfoBase ()=default
 
virtual void log (raw_ostream &OS) const =0
 Print an error message to an output stream.
 
virtual std::string message () const
 Return the error message as a string.
 
virtual std::error_code convertToErrorCode () const =0
 Convert this error to a std::error_code.
 
virtual const void * dynamicClassID () const =0
 
virtual bool isA (const void *const ClassID) const
 
template<typename ErrorInfoT >
bool isA () const
 

Static Public Attributes

static char ID = 0
 

Protected Member Functions

 ECError ()=default
 
 ECError (std::error_code EC)
 

Protected Attributes

std::error_code EC
 

Friends

Error errorCodeToError (std::error_code)
 Helper for converting an std::error_code to a Error.
 

Additional Inherited Members

- Static Public Member Functions inherited from llvm::ErrorInfo< ECError >
static const void * classID ()
 
- Static Public Member Functions inherited from llvm::ErrorInfoBase
static const void * classID ()
 

Detailed Description

This class wraps a std::error_code in a Error.

This is useful if you're writing an interface that returns a Error (or Expected) and you want to call code that still returns std::error_codes.

Definition at line 1146 of file Error.h.

Constructor & Destructor Documentation

◆ ECError() [1/2]

llvm::ECError::ECError ( )
protecteddefault

◆ ECError() [2/2]

llvm::ECError::ECError ( std::error_code  EC)
inlineprotected

Definition at line 1161 of file Error.h.

Member Function Documentation

◆ convertToErrorCode()

std::error_code llvm::ECError::convertToErrorCode ( ) const
inlineoverridevirtual

Convert this error to a std::error_code.

This is a temporary crutch to enable interaction with code still using std::error_code. It will be removed in the future.

Implements llvm::ErrorInfoBase.

Definition at line 1153 of file Error.h.

References EC.

◆ log()

void llvm::ECError::log ( raw_ostream OS) const
inlineoverridevirtual

Print an error message to an output stream.

Implements llvm::ErrorInfoBase.

Reimplemented in llvm::windows_manifest::WindowsManifestError.

Definition at line 1154 of file Error.h.

References EC, and OS.

◆ setErrorCode()

void llvm::ECError::setErrorCode ( std::error_code  EC)
inline

Definition at line 1152 of file Error.h.

References EC.

Referenced by llvm::object::BinaryError::BinaryError().

Friends And Related Function Documentation

◆ errorCodeToError

Error errorCodeToError ( std::error_code  EC)
friend

Helper for converting an std::error_code to a Error.

Definition at line 103 of file Error.cpp.

Member Data Documentation

◆ EC

std::error_code llvm::ECError::EC
protected

Definition at line 1163 of file Error.h.

Referenced by convertToErrorCode(), log(), and setErrorCode().

◆ ID

char llvm::ECError::ID = 0
static

Definition at line 1157 of file Error.h.


The documentation for this class was generated from the following files: