30 m_map.insert( value ) ;
35 return m_map.begin() ;
45 return m_map.find( key ) ;
55 return contains( std::string(key) ) ;
60 const Map::const_iterator end = m_map.end() ;
61 for( Map::const_iterator p = m_map.find(key) ; p != end && (*p).first == key ; ++p )
63 if( (*p).second.valued() || !(*p).second.is_off() )
72 const Map::const_iterator end = m_map.end() ;
73 for( Map::const_iterator p = m_map.find(key) ; p != end && (*p).first == key ; ++p )
80 return value( std::string(key) , default_ ? std::string(default_) : std::string() ) ;
85 Map::const_iterator p = m_map.find( key ) ;
86 if( p == m_map.end() || !(*p).second.valued() )
88 else if( count(key) == 1U )
89 return (*p).second.value() ;
91 return join( p , std::upper_bound(p,m_map.end(),*p,m_map.value_comp()) ) ;
94 std::string G::OptionMap::join( Map::const_iterator p , Map::const_iterator end )
const
97 for(
const char * sep =
"" ; p != end ; ++p )
99 if( (*p).second.valued() )
101 result.append( sep ) ; sep =
"," ;
102 result.append( (*p).second.value() ) ;
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.
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.