Texture Viewer
Public Member Functions | Friends | Related Functions | List of all members
TextureIOResult Class Reference

Public Member Functions

 TextureIOResult () noexcept
 
 TextureIOResult (TextureIOError status) noexcept
 
 TextureIOResult (const TextureIOResult &lhs) noexcept
 
 ~TextureIOResult () noexcept=default
 
TextureIOResultoperator= (const TextureIOResult &other) noexcept
 
TextureIOError error () const
 
 operator bool () const noexcept
 
bool operator! () const noexcept
 

Friends

bool operator== (const TextureIOResult &lhs, const TextureIOResult &rhs) noexcept
 
bool operator!= (const TextureIOResult &lhs, const TextureIOResult &rhs) noexcept
 

Related Functions

(Note that these are not member functions.)

QString toUserString (const TextureIOResult &result)
 

Detailed Description

This class is an emulation of the std::excected<TextureIOError> typedef.

Such emulation is needed because it is not sure when and if we have the std::excected class.

Constructor & Destructor Documentation

◆ TextureIOResult() [1/3]

TextureIOResult::TextureIOResult ( )
inlinenoexcept

Constructs TextureIOResult instance with no error.

◆ TextureIOResult() [2/3]

TextureIOResult::TextureIOResult ( TextureIOError  error)
inlinenoexcept

Constructs TextureIOResult with the given error.

◆ TextureIOResult() [3/3]

TextureIOResult::TextureIOResult ( const TextureIOResult lhs)
inlinenoexcept

Copy-constructs TextureIOResult with the given lhs TextureIOResult.

◆ ~TextureIOResult()

TextureIOResult::~TextureIOResult ( )
defaultnoexcept

Destroys TextureIOResult object.

Member Function Documentation

◆ error()

TextureIOError TextureIOResult::error ( ) const
inline

Returns error code.

◆ operator bool()

TextureIOResult::operator bool ( ) const
inlinenoexcept

Returns true if this instance contains no error.

See also
toBool(), bool TextureIOResult::operator!()

◆ operator!()

bool TextureIOResult::operator! ( ) const
inlinenoexcept

Returns true if this instance has an error.

See also
toBool(), TextureIOResult::operator bool()

◆ operator=()

TextureIOResult & TextureIOResult::operator= ( const TextureIOResult other)
noexcept

Assigns other TextureIOResult to this result.

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const TextureIOResult lhs,
const TextureIOResult rhs 
)
friend

Returns true if lhs is not equal to the rhs.

◆ operator==

bool operator== ( const TextureIOResult lhs,
const TextureIOResult rhs 
)
friend

Returns true if lhs is equal to the rhs.

◆ toUserString()

QString toUserString ( const TextureIOResult result)
related

Returns the human-readable message describing the result.