Image Formats NG
Public Types | Public Member Functions | Related Functions | List of all members
ImageIOResult Class Reference

This is a helper class that wraps status enum. More...

Public Types

enum  Status {
  Status::Ok, Status::InvalidMimeType, Status::FileNotFound, Status::DeviceError,
  Status::UnsupportedMimeType, Status::HandlerError
}
 This enum describes the different types of errors that can occur when reading image files. More...
 

Public Member Functions

 ImageIOResult (Status status=Status::Ok) Q_DECL_NOEXCEPT
 Constructs ImageIOResult with the given status code.
 
 ImageIOResult (const ImageIOResult &lhs) Q_DECL_NOEXCEPT
 Copy-constructs ImageIOResult with the given lhs ImageIOResult.
 
 ~ImageIOResult () Q_DECL_NOEXCEPT=default
 Destroys ImageIOResult object.
 
ImageIOResultoperator= (const ImageIOResult &other) Q_DECL_NOEXCEPT
 Assigns other ImageIOResult to this result.
 
Status status () const Q_DECL_NOEXCEPT
 Returns status code.
 
QString toString () const
 Returns the human-readable message describing the status.
 
bool toBool () const Q_DECL_NOEXCEPT
 Returns true if status() is equal to ImageIOResult::Status::Ok. More...
 
 operator bool () const Q_DECL_NOEXCEPT
 Returns true if errorCode is equal to ImageIOResult::Status::Ok. More...
 
bool operator! () const Q_DECL_NOEXCEPT
 Returns true if errorCode is not equal to ImageIOResult::Status::Ok. More...
 

Related Functions

(Note that these are not member functions.)

bool operator== (const ImageIOResult &lhs, const ImageIOResult &rhs)
 
bool operator!= (const ImageIOResult &lhs, const ImageIOResult &rhs)
 

Detailed Description

This is a helper class that wraps status enum.

Member Enumeration Documentation

◆ Status

enum ImageIOResult::Status
strong

This enum describes the different types of errors that can occur when reading image files.

Enumerator
Ok 

No error occured.

InvalidMimeType 

ImageIO was used with an invalid mime type.

FileNotFound 

ImageIO was used with a file name, but no file was found with that name.

DeviceError 

ImageIO encountered a device error when reading the image.

You can consult your particular device for more details on what went wrong.

UnsupportedMimeType 

ImageIO does not support the requested mime type.

HandlerError 

Error occured within an undelying ImageIOHandler.

Member Function Documentation

◆ operator bool()

ImageIOResult::operator bool ( ) const
inline

Returns true if errorCode is equal to ImageIOResult::Status::Ok.

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

◆ operator!()

bool ImageIOResult::operator! ( ) const
inline

Returns true if errorCode is not equal to ImageIOResult::Status::Ok.

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

◆ toBool()

bool ImageIOResult::toBool ( ) const
inline

Friends And Related Function Documentation

◆ operator!=()

bool operator!= ( const ImageIOResult lhs,
const ImageIOResult rhs 
)
related

Returns true if lhs status() is not equal to the rhs status().

◆ operator==()

bool operator== ( const ImageIOResult lhs,
const ImageIOResult rhs 
)
related

Returns true if lhs status() is equal to the rhs status().