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

Public Member Functions

 MainParser (const DescriptionMap &map)
 
void process (const QStringList &arguments)
 
Q_NORETURN void showHelp (int code)
 
Q_NORETURN void showVersion ()
 

Static Public Member Functions

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

Detailed Description

This is the parser for the arguments passed to main(). Checks that input arguments has format ./texturetool [common options] <tool> [options] and that <tool> is valid tool.

Constructor & Destructor Documentation

◆ MainParser()

TextureTool::MainParser::MainParser ( const DescriptionMap &  map)
explicit

Constructs MainParser object with the given DescriptionMap map.

Member Function Documentation

◆ process()

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

Processes options. If an error occured, or help, or version is required, prints help and throws ExitException, which leads to program exit.

◆ showError()

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

Prints the given message to the sdterr stream.

◆ showHelp()

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

Prints help and throws ExitException with the given code.

◆ showMessage()

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

Prints the given message to the sdtout stream.

◆ showVersion()

void TextureTool::MainParser::showVersion ( )

Prints program version and throws ExitException with zero code.