TF++, Miscellaneous classes and modules in C++:

A struct to hold filename together with options ,If a filename is given together with its specific parameters in. More...

#include <xcmdline.h>

Collaboration diagram for tfxx::cmdline::Filename:

Public Member Functions

Toptionmap extract (const std::string &key) const
 return all entries for a given key More...
 
std::string value (const std::string &key) const
 return values for option with given key More...
 
Toptionmap::size_type count (const std::string &key) const
 number of entries for key More...
 
bool haskey (const std::string &key) const
 tell if the key is present More...
 

Public Attributes

std::string name
 filename More...
 
Toptionmap options
 multimap containing all arguments together with their keys More...
 

Detailed Description

A struct to hold filename together with options ,

If a filename is given together with its specific parameters in.

You can

  • extract obtain the filename itself from field name:
    std::string name=fname.name;
  • extract all parameters together with their keys in a multimap from field options:
    std::multimap<std::string, std::string> parameters=fname.options;
  • extract all parameters matching a specific key "keyval" through function extract:
    std::multimap<std::string, std::string>
    parameters=fname.extract("keyval");
  • find out whether a key was used to specify parameters through function haskey:
    bool keysfound=fname.haskey("keyval");
  • find out how many entries are available for a specific key through function count:
    int nentries=fname.count("keyval");
  • extract the first parameter used together with a specific key through function value:
    std::string parameter=fname.value("keyval");

Lists of parameters are provided in a multimap defined as tfxx::cmdline::Toptionmap

See also
Toptionmap
TEST: Commandline evaluation.

Definition at line 192 of file xcmdline.h.


The documentation for this struct was generated from the following files: