Texture Viewer
Public Member Functions | Static Public Member Functions | List of all members
TextureTool::ToolParser Class Reference

Inherits QCommandLineParser.

Public Member Functions

 ToolParser (const QByteArray &toolName)
 
void process (const QStringList &arguments)
 
Q_NORETURN void showHelp (int code)
 

Static Public Member Functions

static void showMessage (const QString &message)
 
static void showError (const QString &message)
 

Detailed Description

This is helper class that simplifies usage of the QCommandLineParser. Provides built-in procesing of the help option which prints tool help.

Constructor & Destructor Documentation

◆ ToolParser()

TextureTool::ToolParser::ToolParser ( const QByteArray &  toolName)
explicit

Constructs a ToolParser instance with the given toolName.

Member Function Documentation

◆ process()

void TextureTool::ToolParser::process ( const QStringList &  arguments)

Parses and handles the default options (help). Prints help and throws ExitException in case of parse error.

◆ showError()

void TextureTool::ToolParser::showError ( const QString &  message)
static

Prints the given message to the sdterr stream.

◆ showHelp()

void TextureTool::ToolParser::showHelp ( int  code)

Prints help and throws ExitException with the given code.

◆ showMessage()

void TextureTool::ToolParser::showMessage ( const QString &  message)
static

Prints the given message to the sdtout stream.