Image Formats NG
Public Member Functions | List of all members
ImageTool::AbstractTool Class Referenceabstract

This is the base class for image tools. More...

Inheritance diagram for ImageTool::AbstractTool:
ImageTool::ConvertTool ImageTool::ShowTool

Public Member Functions

 AbstractTool ()=default
 Constructs an AbstractTool instance.
 
virtual ~AbstractTool ()
 Destroys the AbstractTool object.
 
virtual QByteArray id () const =0
 Reimplement this function to return the id of the tool. More...
 
virtual QString decription () const =0
 Reimplement this function to return the decription of the tool. More...
 
virtual int run (const QStringList &arguments)=0
 Reimplement this function to implement the logic of the tool. More...
 

Detailed Description

This is the base class for image tools.

Member Function Documentation

◆ decription()

QString ImageTool::AbstractTool::decription ( ) const
pure virtual

Reimplement this function to return the decription of the tool.

Description is used when help of the main program is printed.

Implemented in ImageTool::ConvertTool, and ImageTool::ShowTool.

◆ id()

QByteArray ImageTool::AbstractTool::id ( ) const
pure virtual

Reimplement this function to return the id of the tool.

This id is used a command name when invoking main program: ./imagetool <id> [options]

Implemented in ImageTool::ConvertTool, and ImageTool::ShowTool.

◆ run()

int ImageTool::AbstractTool::run ( const QStringList &  arguments)
pure virtual

Reimplement this function to implement the logic of the tool.

When tool is invoked via ./imagetool <id> [options], arguments contains options passed to the tool. Tool should return 0 in case of success or non-zero in case of an error. Also, it can throw an exception that is caught by the main program.

Implemented in ImageTool::ConvertTool, and ImageTool::ShowTool.