TF++, Miscellaneous classes and modules in C++:
xcmdline.h
Go to the documentation of this file.
1 
36 // include guard
37 #ifndef TF_XCMDLINE_H_VERSION
38 
39 #define TF_XCMDLINE_H_VERSION \
40  "TF_XCMDLINE_H V1.0 "
41 
42 #include <tfxx/commandline.h>
43 #include <string>
44 #include <map>
45 #include <list>
46 
47 namespace tfxx {
48  namespace cmdline {
49 
130  typedef std::pair<std::string, std::string> Tfileoption;
131 
145  typedef std::multimap<std::string, std::string> Toptionmap;
146 
192  struct Filename {
194  std::string name;
198  Toptionmap extract(const std::string& key) const;
200  std::string value(const std::string& key) const;
202  Toptionmap::size_type count(const std::string& key) const
203  { return options.count(key); }
205  bool haskey(const std::string& key) const
206  { return (this->count(key) > 0); }
207  }; // struct Filename
208 
209 
218  typedef std::list<Filename> Tparsed;
219 
229  const char** keys,
230  const bool& debug=false);
231 
232  } // namespace cmdline
233 
234 } // namespace tfxx
235 
236 #endif // TF_XCMDLINE_H_VERSION (includeguard)
237 
238 /* ----- END OF xcmdline.h ----- */
Toptionmap options
multimap containing all arguments together with their keys
Definition: xcmdline.h:196
Tparsed parse_cmdline(tfxx::cmdline::Commandline &c, const char **keys, const bool &debug)
parse command line arguments for file names and options ,A tutorial is available in the detailed desc...
Definition: xcmdline.cc:83
std::pair< std::string, std::string > Tfileoption
pair to hold file option ,A std::pair is an STL container. In this it contains a key together with th...
Definition: xcmdline.h:130
std::list< Filename > Tparsed
list to hold file names with options ,A tutorial is available in the detailed description of the Inte...
Definition: xcmdline.h:218
bool haskey(const std::string &key) const
tell if the key is present
Definition: xcmdline.h:205
A struct to hold filename together with options ,If a filename is given together with its specific pa...
Definition: xcmdline.h:192
Evaluates commandline by calling long_getopt. ,You may instantiate a Commandline object by passing th...
Definition: commandline.h:201
Toptionmap::size_type count(const std::string &key) const
number of entries for key
Definition: xcmdline.h:202
Toptionmap extract(const std::string &key) const
return all entries for a given key
Definition: xcmdline.cc:145
std::multimap< std::string, std::string > Toptionmap
map to hold file options ,A std::multimap is an STL container of pairs. It provides STL iterators to ...
Definition: xcmdline.h:145
std::string name
filename
Definition: xcmdline.h:194
Namespace containing all code of library libtfxx.
std::string value(const std::string &key) const
return values for option with given key
Definition: xcmdline.cc:156