34 #define TF_XCMDLINE_CC_VERSION \ 35 "TF_XCMDLINE_CC V1.0 " 37 #include <tfxx/xcmdline.h> 64 helper::Tkeylist::const_iterator i=keys.begin();
72 Moption.first = i->substr(0, i->size()-1);
90 const char* key=*keys;
93 std::string keystring(key);
94 keylist.push_back(keystring+
":");
101 std::cout <<
"DEBUG (parse_cmdline): keys are ";
102 helper::Tkeylist::const_iterator i=keylist.begin();
103 while (i!=keylist.end())
105 std::cout <<
"\"" << *i <<
"\" ";
108 std::cout << std::endl;
122 filename.
name=ca.value();
128 filename.
options.insert(ca.option());
132 retval.push_back(filename);
134 filename.
name=ca.value();
138 if (!first) { retval.push_back(filename); }
147 typedef Toptionmap::const_iterator Tomi;
148 typedef std::pair<Tomi, Tomi> Tomipair;
149 Tomipair equalrange=
options.equal_range(key);
150 Toptionmap retval(equalrange.first, equalrange.second);
159 Toptionmap::const_iterator p=
options.find(key);
161 { retval=p->second; }
Toptionmap options
multimap containing all arguments together with their keys
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...
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...
std::list< Filename > Tparsed
list to hold file names with options ,A tutorial is available in the detailed description of the Inte...
std::list< std::string > Tkeylist
char * next()
returns char-array of next commandline argument
A struct to hold filename together with options ,If a filename is given together with its specific pa...
Tfileoption option() const
bool extra() const
true if there are more commandline arguments
Evaluates commandline by calling long_getopt. ,You may instantiate a Commandline object by passing th...
Toptionmap extract(const std::string &key) const
return all entries for a given key
CmdlineArgument(const std::string &arg, const Tkeylist &keys)
std::string value() const
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 ...
Namespace containing all code of library libtfxx.
std::string value(const std::string &key) const
return values for option with given key