ASL
Dic< T > Class Template Reference

Detailed Description

template<class T = String>
class asl::Dic< T >

Dic is a particular case of Map in which keys are strings.

This is a very common case. Dic only needs one template argument: the type of the values

#include <Map.h>

Inheritance diagram for Dic< T >:
Map< String, String >

Additional Inherited Members

- Public Member Functions inherited from Map< String, String >
 Map (const Map< K2, T2 > &b)
 Constructs a Map from a Map of different key or value types. More...
 
Mapoperator() (const String &key, const String &value)
 Adds an element with the given key and value, useful for the short hand initializer style shown in the class overview.
 
int length () const
 Returns the number of elements in this map.
 
void clear ()
 Removes all elements.
 
Mapdup ()
 Detaches this Map from other ones possibly sharing it.
 
Map clone () const
 Returns an independent copy of this map.
 
bool has (const String &key) const
 Returns true if an element with key key exists.
 
const Stringfind (const String &key) const
 Returns a pointer to the element with key key or a null pointer if it is not found.
 
Array< Stringkeys () const
 Returns an array containing all keys of this map.
 
const Stringoperator[] (const String &key) const
 Returns a reference to the element with key key, or a static default constructed item if not found.
 
const Stringget (const String &key, const String &def) const
 Returns the element with key key or the value def if key is not found.
 
bool remove (const String &key)
 Removes the element named key.
 
void add (const Map &d)
 Adds all elements from dictionary d to this.
 
Enumerator all () const
 Returns an enumerator for this map.
 
String join (const String &s1, const String &s2) const
 Joins the contents of a Dic<> into a string, using s1 as element separator (often a comma) and s2 as key-value separator (usually an '=').
 

The documentation for this class was generated from the following file: