36 StringMap::const_iterator p = m_map.find( key ) ;
37 if( p == m_map.end() )
38 throw std::out_of_range(std::string()+
"key ["+key+
"] not found in ["+
G::Str::join(keys(14U,
"..."),
",")+
"]") ;
44 StringMap::const_iterator p = m_map.find( key ) ;
45 return p == m_map.end() ? default_ : (*p).second ;
52 StringMap::const_iterator p = m_map.begin() ;
53 for( ; p != m_map.end() && limit > 0U && i < limit ; ++p , i++ )
54 result.push_back( (*p).first ) ;
55 if( p != m_map.end() && elipsis != NULL )
56 result.push_back( elipsis ) ;
StringMapReader(const StringMap &map_)
Implicit constructor.
std::list< std::string > Strings
A std::list of std::strings.
Strings keys(unsigned int limit=0U, const char *elipsis=NULL) const
Returns a list of keys (optionally up to some limit).
const std::string & at(const std::string &key) const
Returns the value, or throws.
std::map< std::string, std::string > StringMap
A std::map of std::strings.
static std::string join(const Strings &strings, const std::string &sep)
Concatenates a set of strings.