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

This is the parser for the arguments passed to main(). More...

Public Member Functions

 MainParser (const DescriptionMap &map)
 Constructs MainParser object with the given DescriptionMap map.
 
void process (const QStringList &arguments)
 Processes options. More...
 
Q_NORETURN void showHelp (int code)
 Prints help and throws ExitException with the given code.
 
Q_NORETURN void showVersion ()
 Prints program version and throws ExitException with zero code.
 

Static Public Member Functions

static void showMessage (const QString &message)
 Prints the given message to the sdtout stream.
 
static void showError (const QString &message)
 Prints the given message to the sdterr stream.
 

Detailed Description

This is the parser for the arguments passed to main().

Checks that input arguments has format ./imagetool [common options] <tool> [options] and that <tool> is valid tool.

Member Function Documentation

◆ process()

void ImageTool::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.