TF++, Miscellaneous classes and modules in C++:
Interface provided through xcmdline.h

Interface provided through xcmdline.h. More...

Collaboration diagram for Interface provided through xcmdline.h:

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< Filenametfxx::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...
 

Detailed Description

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

static const char* keys[]={"f", "dl", "k", 0};

With this list of key strings, you call the function tfxx::cmdline::parse_cmdline to read the rest of the command line:

filenames=tfxx::cmdline::parse_cmdline(cmdline,
keys,
verbose);

The arguments to this function have the following meaning:

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

std::list<tfxx::cmdline::Filename> filenames;

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.

See also
TEST: Commandline evaluation.