21 #ifndef G_OPTION_MAP_H
22 #define G_OPTION_MAP_H
42 typedef std::multimap<std::string,OptionValue> Map ;
43 typedef Map::value_type value_type ;
44 typedef Map::iterator iterator ;
45 typedef Map::const_iterator const_iterator ;
51 void insert(
const Map::value_type & ) ;
56 const_iterator
begin()
const ;
59 const_iterator
end()
const ;
62 const_iterator
find(
const std::string & )
const ;
68 bool contains(
const std::string & )
const ;
72 bool contains(
const char * )
const ;
75 size_t count(
const std::string & key )
const ;
78 std::string
value(
const std::string & key ,
const std::string & default_ = std::string() )
const ;
83 std::string
value(
const char * key ,
const char * default_ =
nullptr )
const ;
87 std::string join( Map::const_iterator , Map::const_iterator )
const ;
size_t count(const std::string &key) const
Returns the number of times the key appears in the multimap.
bool contains(const std::string &) const
Returns true if the map contains the given key, but ignoring un-valued() 'off' options.
const_iterator begin() const
Returns the begin iterator.
A multimap-like container for command-line options and their values.
const_iterator end() const
Returns the off-the-end iterator.
void insert(const Map::value_type &)
Inserts the key/value pair into the map.
OptionMap()
Default constructor for an empty map.
std::string value(const std::string &key, const std::string &default_=std::string()) const
Returns the value of the valued() option identified by the given key.
void clear()
Clears the map.
const_iterator find(const std::string &) const
Finds the map entry with the given key.