Image Formats NG
Public Member Functions | List of all members
ImageTool::ExitException Class Reference

This exception is used in command line parsers to terminate the program. More...

Inheritance diagram for ImageTool::ExitException:
ImageTool::Exception

Public Member Functions

 ExitException (int code=0)
 Constructs ExitException with return code code.
 
 ~ExitException () Q_DECL_NOEXCEPT override
 Destroys the object.
 
int code () const Q_DECL_NOEXCEPT
 Returns the code that should be return from the program.
 
const char * what () const Q_DECL_NOEXCEPT override
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
- Public Member Functions inherited from ImageTool::Exception
 Exception ()
 Constructs Exception.
 
 ~Exception () Q_DECL_NOEXCEPT override
 Destroys the object.
 
const char * what () const Q_DECL_NOEXCEPT override
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 

Detailed Description

This exception is used in command line parsers to terminate the program.

We don't rely on exit(0) call because stack is not unwinded and destructors are not called, so we throw this exception, and catch it in main().