#include <YCPMap.h>

Public Member Functions | |
| void | add (const YCPValue &key, const YCPValue &value) |
| YCPMap | functionalAdd (const YCPValue &key, const YCPValue &value) const |
| virtual const YCPElementRep * | shallowCopy () const |
| void | remove (const YCPValue &key) |
| long | size () const |
| YCPValue | value (const YCPValue &key) const |
| YCPMapIterator | begin () const |
| YCPMapIterator | end () const |
| YCPOrder | compare (const YCPMap &v) const |
| string | toString () const |
| std::ostream & | toStream (std::ostream &str) const |
| std::ostream & | toXml (std::ostream &str, int indent) const |
| YCPValueType | valuetype () const |
Protected Member Functions | |
| YCPMapRep () | |
| ~YCPMapRep () | |
Private Member Functions | |
| YCPMapIterator | findKey (const YCPValue &key) const |
Private Attributes | |
| YCPValueYCPValueMap | stl_map |
Friends | |
| class | YCPMap |
| YCPMapRep::YCPMapRep | ( | ) | [protected] |
Creates a new and empty mapping.
Referenced by shallowCopy().
| YCPMapRep::~YCPMapRep | ( | ) | [inline, protected] |
Cleans up
Adds a new key/value pair. If the key is existent, the old entry will be overwritten with the new one.
References stl_map, and ycp2error.
Referenced by shallowCopy().
Is like add, but doesn't change this map. It creates a newly created map.
References YCPMap::add(), begin(), end(), toString(), y2debug, and ycp2error.
| const YCPElementRep * YCPMapRep::shallowCopy | ( | ) | const [virtual] |
Creates a copy of this list, i.e. creates a new list with the same elements as this one. The elements themselves are not copied, but only cloned!
Reimplemented from YCPElementRep.
References add(), begin(), end(), and YCPMapRep().
| void YCPMapRep::remove | ( | const YCPValue & | key | ) |
| long YCPMapRep::size | ( | ) | const |
Looks for a certain key and returns the value assigned to that key. Returns 0, if the key is not found.
References end(), stl_map, and YCPMapIterator::value().
| YCPMapIterator YCPMapRep::begin | ( | ) | const |
Returns a bidirectional STL iterator for the YCPMap that is positioned at the first value pair in the map. (suitable for iterating over all entries)
References stl_map.
Referenced by compare(), functionalAdd(), shallowCopy(), toStream(), toString(), and toXml().
| YCPMapIterator YCPMapRep::end | ( | ) | const |
Returns a bidirectional STL iterator for the YCPMap that is positioned BEHIND the last value pair in the map. (suitable for iterating over all entries)
References stl_map.
Referenced by compare(), functionalAdd(), shallowCopy(), toStream(), toString(), toXml(), and value().
Compares two YCPMaps for equality, greaterness or smallerness. Comparison is done as follows: shorter < longer pairwise comparison for maps of equal length not being empty
| v | value to compare against |
References YCPMap::begin(), begin(), YCPMap::end(), end(), YCPMap::size(), size(), YO_EQUAL, YO_GREATER, and YO_LESS.
| string YCPMapRep::toString | ( | void | ) | const [virtual] |
Returns an ASCII representation of the map. Maps are denoted by a comma separated list of pairs of the form key : value enclosed in $[ ... ]
Implements YCPElementRep.
References begin(), and end().
Referenced by functionalAdd().
| std::ostream & YCPMapRep::toStream | ( | std::ostream & | str | ) | const [virtual] |
Output value as bytecode to stream
Implements YCPElementRep.
References begin(), end(), stl_map, Bytecode::writeInt32(), and Bytecode::writeValue().
| std::ostream & YCPMapRep::toXml | ( | std::ostream & | str, | |
| int | indent | |||
| ) | const [virtual] |
| YCPValueType YCPMapRep::valuetype | ( | ) | const [virtual] |
| YCPMapIterator YCPMapRep::findKey | ( | const YCPValue & | key | ) | const [private] |
friend class YCPMap [friend] |
YCPValueYCPValueMap YCPMapRep::stl_map [private] |
1.5.6