OSFI-C++
3.10.0
OpenSF Integration Library
|
#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 |
Provides procedures to parse the command line arguments, generating a list of tokens grouped as:
Command line must follow one of the following formats (flag or positional). In particular, if any flagged option (-/–) is passed in, passing positional arguments mixed is an error.
In either form, 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 is made to the possible E2E_HOME variable.
If the "local" or "global" options are provided multiple times, only the last value specified is kept for each of the flags.
Note that since the comma character is used as a separator, it cannot be part of a file name even if it is a legal path value in the platform.
CLP::CLP | ( | int | argc, |
char * | argv[] | ||
) |
Class constructor. Needs the command line arguments passed to main
.
argc | - number of arguments |
argv | - list of array of characters |
std::invalid_argument | in case of error. |
|
virtual |
Class destructor.
std::string CLP::getConfFile | ( | ) |
Gets the name of the configuration file. Configuration file can be "" is no configuration file is passed.
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 2 in which:
Note that when not provided by CLI, the corresponding entry stores an empty string "".
std::list<std::string> CLP::getInputFiles | ( | ) | const |
std::list<std::string> CLP::getOutputFiles | ( | ) | const |