Geometrize  1.0
An application for geometrizing images into geometric primitives
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
Functions
geometrize::cli Namespace Reference

Functions

bool shouldRunInSelfTestMode (const QStringList &arguments)
 shouldRunInSelfTestMode Checks whether the application should run in automated self-test/functional testing mode. More...
 
bool shouldRunInConsoleMode (const QStringList &arguments)
 shouldRunInConsoleMode Checks whether the application should run in console mode for the given arguments. More...
 
std::string getOverrideLocaleCode (const QStringList &arguments)
 getOverrideLocaleCode Gets the override locale code that the application should start up with. More...
 
int runApp (QApplication &app)
 runApp Runs the application in console mode. Note that since Windows does not support dual-mode applications, this isn't "true" console mode - we just don't create a main window/GUI. More...
 

Function Documentation

std::string geometrize::cli::getOverrideLocaleCode ( const QStringList &  arguments)

getOverrideLocaleCode Gets the override locale code that the application should start up with.

Parameters
argumentsThe console arguments.
Returns
The override locale code, or an empty string if no override was specified.
94 {
95  QCommandLineParser parser;
96  setupCommandLineParser(parser, arguments);
97 
98  if(!parser.isSet(localeOverrideFlag)) {
99  return "";
100  }
101  return parser.value(localeOverrideFlag).toStdString();
102 }
int geometrize::cli::runApp ( QApplication &  app)

runApp Runs the application in console mode. Note that since Windows does not support dual-mode applications, this isn't "true" console mode - we just don't create a main window/GUI.

Parameters
appThe application.
Returns
0 on success, any other return code if there was an error.
105 {
106  const QStringList arguments{app.arguments()};
107 
108  QCommandLineParser parser;
109  setupCommandLineParser(parser, arguments);
110  handleCommandLineArguments(parser);
111 
112  return 0;
113 }

Here is the caller graph for this function:

bool geometrize::cli::shouldRunInConsoleMode ( const QStringList &  arguments)

shouldRunInConsoleMode Checks whether the application should run in console mode for the given arguments.

Parameters
argumentsThe console arguments.
Returns
True if the application should run in console mode, else false.
87 {
88  QCommandLineParser parser;
89  setupCommandLineParser(parser, arguments);
90  return parser.isSet(scriptFileFlag) || parser.isSet(scriptSourceFlag);
91 }
bool geometrize::cli::shouldRunInSelfTestMode ( const QStringList &  arguments)

shouldRunInSelfTestMode Checks whether the application should run in automated self-test/functional testing mode.

Parameters
argumentsThe console arguments.
Returns
True if the application should run in self-test mode, else false.
80 {
81  QCommandLineParser parser;
82  setupCommandLineParser(parser, arguments);
83  return parser.isSet(selfTestsFlag) || parser.isSet(selfTestsFlag);
84 }