Texture Viewer
Public Member Functions | List of all members
TextureTool::AbstractTool Class Referenceabstract
Inheritance diagram for TextureTool::AbstractTool:
TextureTool::ConvertTool TextureTool::ShowTool

Public Member Functions

 AbstractTool ()=default
 
virtual ~AbstractTool ()
 
virtual QByteArray id () const =0
 
virtual QString decription () const =0
 
virtual int run (const QStringList &arguments)=0
 

Detailed Description

This is the base class for texture tools.

Constructor & Destructor Documentation

◆ AbstractTool()

TextureTool::AbstractTool::AbstractTool ( )
default

Constructs an AbstractTool instance.

◆ ~AbstractTool()

TextureTool::AbstractTool::~AbstractTool ( )
virtualdefault

Destroys the AbstractTool object.

Member Function Documentation

◆ decription()

QString TextureTool::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 TextureTool::ConvertTool, and TextureTool::ShowTool.

◆ id()

QByteArray TextureTool::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: ./texturetool <id> [options]

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

◆ run()

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

Reimplement this function to implement the logic of the tool.

When tool is invoked via ./texturetool <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 TextureTool::ConvertTool, and TextureTool::ShowTool.