Envision
A visual programming IDE for object-oriented languages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes
InformationScripting::ArgumentParser Class Reference

Public Types

enum class  Scope : int { Undefined , Local , Global , Input }
 

Public Member Functions

 ArgumentParser (std::initializer_list< PositionalArgument > positionalArgs, const QStringList &args, bool addScopeArguments=false)
 
 ArgumentParser (std::initializer_list< QCommandLineOption > options, const QStringList &args, bool addScopeArguments=false)
 
 ArgumentParser (std::initializer_list< QCommandLineOption > options, std::initializer_list< PositionalArgument > positionalArgs, const QStringList &args, bool addScopeArguments=false)
 
QString argument (const QString &argName) const
 
bool isArgumentSet (const QString &argName) const
 
int numPositionalArguments () const
 
QString positionalArgument (int index) const
 
QString queryName () const
 
Scope scope (const Query *of) const
 

Static Public Member Functions

static void setArgTo (QStringList &args, const QStringList &argNames, const QString &type)
 

Static Public Attributes

static const QStringList GLOBAL_SCOPE_ARGUMENT_NAMES {"g", "global"}
 
static const QStringList INPUT_SCOPE_ARGUMENT_NAMES {"i", "input"}
 
static const QStringList LOCAL_SCOPE_ARGUMENT_NAMES {"l", "local"}
 

Private Member Functions

void initParser (const QStringList &args, bool addScopeArguments)
 

Private Attributes

std::unique_ptr< QCommandLineParser > argParser_ {}
 
QStringList positionalArgumentNames_
 
QString queryName_
 
Scope scope_ {}
 

Member Enumeration Documentation

◆ Scope

Enumerator
Undefined 
Local 
Global 
Input 

Constructor & Destructor Documentation

◆ ArgumentParser() [1/3]

InformationScripting::ArgumentParser::ArgumentParser ( std::initializer_list< QCommandLineOption >  options,
const QStringList &  args,
bool  addScopeArguments = false 
)

◆ ArgumentParser() [2/3]

InformationScripting::ArgumentParser::ArgumentParser ( std::initializer_list< PositionalArgument positionalArgs,
const QStringList &  args,
bool  addScopeArguments = false 
)

◆ ArgumentParser() [3/3]

InformationScripting::ArgumentParser::ArgumentParser ( std::initializer_list< QCommandLineOption >  options,
std::initializer_list< PositionalArgument positionalArgs,
const QStringList &  args,
bool  addScopeArguments = false 
)

Member Function Documentation

◆ argument()

QString InformationScripting::ArgumentParser::argument ( const QString &  argName) const

◆ initParser()

void InformationScripting::ArgumentParser::initParser ( const QStringList &  args,
bool  addScopeArguments 
)
private

◆ isArgumentSet()

bool InformationScripting::ArgumentParser::isArgumentSet ( const QString &  argName) const

◆ numPositionalArguments()

int InformationScripting::ArgumentParser::numPositionalArguments ( ) const

◆ positionalArgument()

QString InformationScripting::ArgumentParser::positionalArgument ( int  index) const

◆ queryName()

QString InformationScripting::ArgumentParser::queryName ( ) const
inline

◆ scope()

ArgumentParser::Scope InformationScripting::ArgumentParser::scope ( const Query of) const

◆ setArgTo()

void InformationScripting::ArgumentParser::setArgTo ( QStringList &  args,
const QStringList &  argNames,
const QString &  type 
)
static

Member Data Documentation

◆ argParser_

std::unique_ptr<QCommandLineParser> InformationScripting::ArgumentParser::argParser_ {}
private

◆ GLOBAL_SCOPE_ARGUMENT_NAMES

const QStringList InformationScripting::ArgumentParser::GLOBAL_SCOPE_ARGUMENT_NAMES {"g", "global"}
static

◆ INPUT_SCOPE_ARGUMENT_NAMES

const QStringList InformationScripting::ArgumentParser::INPUT_SCOPE_ARGUMENT_NAMES {"i", "input"}
static

◆ LOCAL_SCOPE_ARGUMENT_NAMES

const QStringList InformationScripting::ArgumentParser::LOCAL_SCOPE_ARGUMENT_NAMES {"l", "local"}
static

◆ positionalArgumentNames_

QStringList InformationScripting::ArgumentParser::positionalArgumentNames_
private

◆ queryName_

QString InformationScripting::ArgumentParser::queryName_
private

◆ scope_

Scope InformationScripting::ArgumentParser::scope_ {}
private