TF++, Miscellaneous classes and modules in C++:
|
Interface provided through xcmdline.h. More...
Files | |
file | xcmdline.h |
parse extra commandline values (prototypes) | |
Classes | |
struct | tfxx::cmdline::Filename |
A struct to hold filename together with options ,If a filename is given together with its specific parameters in. More... | |
Typedefs | |
typedef std::pair< std::string, std::string > | tfxx::cmdline::Tfileoption |
pair to hold file option ,A std::pair is an STL container. In this it contains a key together with the parameter read from the command line. Given an option More... | |
typedef std::multimap< std::string, std::string > | tfxx::cmdline::Toptionmap |
map to hold file options ,A std::multimap is an STL container of pairs. It provides STL iterators to scan the collection. In this context each element in a tfxx::cmdline::Toptionmap is a tfxx::cmdline::Tfileoption . More... | |
typedef std::list< Filename > | tfxx::cmdline::Tparsed |
list to hold file names with options ,A tutorial is available in the detailed description of the Interface provided through xcmdline.h More... | |
Functions | |
Tparsed | tfxx::cmdline::parse_cmdline (tfxx::cmdline::Commandline &c, const char **keys, const bool &debug=false) |
parse command line arguments for file names and options ,A tutorial is available in the detailed description of the Interface provided through xcmdline.h More... | |
Interface provided through xcmdline.h.
This module is used to read a list o filenames from the command line together with options and arguments that are given per filename.
In case you want to pass options in the form
filename f:option1 dl:option2 k:option3
you should generate keys of the form
With this list of key strings, you call the function tfxx::cmdline::parse_cmdline to read the rest of the command line:
The arguments to this function have the following meaning:
cmdline
is an object of type keys
is a list of character strings declared as debug
is a switch of type The functions returns an object of type tfxx::cmdline::Tparsed. This contains the filenames together with their parameters. It is a list of objects of type tfxx::cmdline::Filename actually defined as
It can thus be scanned by the means of STL iterators. Each entry contains exactly one filename together with its parameters. See tfxx::cmdline::Filename for details.