OSFI-C++  3.9.2
OpenSF Integration Library
CLP Class Reference

#include <CLP.h>

Public Member Functions

 CLP (int argc, char *argv[])
 
virtual ~CLP ()
 
std::string getConfFile ()
 
std::list< std::string > getConfFiles () const
 
std::list< std::string > getInputFiles () const
 
std::list< std::string > getOutputFiles () const
 

Friends

struct CLPTest
 

Detailed Description

Provides procedures to parse the command line arguments, generating a list of tokens grouped as:

  • Configuration files
  • Input files
  • Output files

Command line must follow one of the following formats (flag or positional)

Flag inputs:

<command_line> ::= <executable> <options> <options> ::= (<global_configuration> | <local_configuration> | <input_file> | <output_file>)* <executable>> ::= <file_name> <global_configuration> ::= (–global|-g) <file_name> <local_configuration> ::= (–local|-l) <file_name> <input_file> ::= (–input|-i) <file_name> <output_file> ::= (–output|-o) <file_name> <file_name> ::= (<alphanumeric>)+

All tokens are separated by space, which means that commas can now be used as part of <file_name>

Notice: the above specification allows for multiple -global/-local options. In case multiple options are defined, a complying implementation considers the value of the last option specified. Expected OSFI behaviour: if any option (-/–) is passed in, then only options should be processed – in this case, passing positional arguments mixed with the flag options is considered an error

Positional arguments (expressed in Extended Backus-Naur form):

<command_line> ::= <executable_name> <whitespaces> <configuration_files> <whitespaces> <input_files> <whitespaces> <output_files> <EOL> <executable_name> ::= <file_name> <whitespace> ::= (“ “) <whitespaces> ::= <whitespace>+ <file_name> ::= (<alphanumeric>)+ <configuration_files> ::= <list_of_files> <input_files> ::= <list_of_files> <output_files> ::= <list_of_files> <list_of_files> ::= <file_name> (“,” <file_name>)*

File names must be valid OS-dependant file locations. Per the E2E-ICD, the configuration, input and output file names can be either a full-path name or a relative path name. Relative path names are interpreted by the module as relative to the current working directory. In particular, no reference to the possible E2E_HOME variable is made.

Constructor & Destructor Documentation

◆ CLP()

CLP::CLP ( int  argc,
char *  argv[] 
)

Class constructor. Needs the command line arguments passed to main.

Parameters
argc- number of arguments
argv- list of array of characters
Exceptions
std::invalid_argumentin case of error.

◆ ~CLP()

virtual CLP::~CLP ( )
virtual

Class destructor.

Member Function Documentation

◆ getConfFile()

std::string CLP::getConfFile ( )

Gets the name of the configuration file. Configuration file can be "" is no configuration file is passed.

Deprecated:
Modules with no global configuration file are deprecated

◆ getConfFiles()

std::list<std::string> CLP::getConfFiles ( ) const

Whether the global or the local conf files were present in the CLI or not, it always returns a list of size two in which:

First entry is the global configuration file

Second entry is the local configuration file

Note that when no provided by CLI, the confFiles corresponding position stores an empty string ""

Returns
the list of the configuration files.

◆ getInputFiles()

std::list<std::string> CLP::getInputFiles ( ) const
Returns
the list of the input files.

◆ getOutputFiles()

std::list<std::string> CLP::getOutputFiles ( ) const
Returns
the list of the output files.

The documentation for this class was generated from the following file: