#include <xmlstorage.h>
Classes | |
struct | const_iterator |
struct | iterator |
Public Types | |
typedef XS_String | key_type |
typedef XS_String | value_type |
Public Member Functions | |
XS_StringMap () | |
XS_StringMap (const XS_StringMap &other) | |
void | operator= (const XS_StringMap &other) |
~XS_StringMap () | |
void | clear () |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
iterator | find (const key_type &key) |
const_iterator | find (const key_type &key) const |
value_type & | operator[] (const key_type &key) |
bool | erase (const key_type &key) |
bool | operator== (const XS_StringMap &other) const |
bool | operator!= (const XS_StringMap &other) const |
Definition at line 1072 of file xmlstorage.h.
Definition at line 1074 of file xmlstorage.h.
Definition at line 1075 of file xmlstorage.h.
XMLStorage::XS_StringMap::XS_StringMap | ( | ) | [inline] |
Definition at line 1154 of file xmlstorage.h.
: _firstNode(NULL) { }
XMLStorage::XS_StringMap::XS_StringMap | ( | const XS_StringMap & | other ) | [inline] |
Definition at line 1159 of file xmlstorage.h.
: _firstNode(NULL) { assign(other); }
XMLStorage::XS_StringMap::~XS_StringMap | ( | ) | [inline] |
Definition at line 1171 of file xmlstorage.h.
References clear().
{ clear(); }
iterator XMLStorage::XS_StringMap::begin | ( | ) | [inline] |
Definition at line 1188 of file xmlstorage.h.
Referenced by XMLStorage::XPathElement::matches(), and XMLStorage::XMLNode::original_write_worker().
{
return _firstNode;
}
const_iterator XMLStorage::XS_StringMap::begin | ( | ) | const [inline] |
Definition at line 1193 of file xmlstorage.h.
{
return _firstNode;
}
void XMLStorage::XS_StringMap::clear | ( | ) | [inline] |
Definition at line 1176 of file xmlstorage.h.
References XMLStorage::XS_SMNode::_pNext.
Referenced by XMLStorage::XMLNode::clear(), operator=(), and ~XS_StringMap().
{ XS_SMNode* node = _firstNode; _firstNode = NULL; while(node) { XS_SMNode* pNext = node->_pNext; delete node; node = pNext; } }
iterator XMLStorage::XS_StringMap::end | ( | ) | [inline] |
Definition at line 1198 of file xmlstorage.h.
Referenced by XMLStorage::XMLNode::get(), XMLStorage::XMLNode::AttributeMap::get(), XMLStorage::XPathElement::matches(), XMLStorage::XMLNode::original_write_worker(), and XMLStorage::ParseContext::process_next().
{
return NULL;
}
const_iterator XMLStorage::XS_StringMap::end | ( | ) | const [inline] |
Definition at line 1203 of file xmlstorage.h.
{
return NULL;
}
bool XMLStorage::XS_StringMap::erase | ( | const key_type & | key ) | [inline] |
Definition at line 1268 of file xmlstorage.h.
References XMLStorage::XS_StringMap::iterator::ptr().
Referenced by XMLStorage::XMLNode::erase().
{ iterator last = NULL; iterator node = _firstNode; for(; node; node=(last=node)->_pNext) { int c = node->first.compare(key); if (c == 0) { // remove the node from linked list if (last) last->_pNext = node->_pNext; else _firstNode = NULL; delete node.ptr(); return true; } else if (c > 0) break; } return false; // key not found }
const_iterator XMLStorage::XS_StringMap::find | ( | const key_type & | key ) | const [inline] |
Definition at line 1222 of file xmlstorage.h.
References XMLStorage::XS_SMNode::_pNext.
{ for(const_iterator node=_firstNode; node; node=node->_pNext) { int c = node->first.compare(key); if (c == 0) return node; else if (c > 0) break; } return NULL; }
Definition at line 1208 of file xmlstorage.h.
References XMLStorage::XS_SMNode::_pNext.
Referenced by XMLStorage::XMLNode::get(), and XMLStorage::XMLNode::AttributeMap::get().
{ for(iterator node=_firstNode; node; node=node->_pNext) { int c = node->first.compare(key); if (c == 0) return node; else if (c > 0) break; } return NULL; }
bool XMLStorage::XS_StringMap::operator!= | ( | const XS_StringMap & | other ) | const [inline] |
Definition at line 1312 of file xmlstorage.h.
References operator==().
{ return !operator==(other); }
void XMLStorage::XS_StringMap::operator= | ( | const XS_StringMap & | other ) | [inline] |
Definition at line 1165 of file xmlstorage.h.
References clear().
{ clear(); assign(other); }
bool XMLStorage::XS_StringMap::operator== | ( | const XS_StringMap & | other ) | const [inline] |
Definition at line 1293 of file xmlstorage.h.
Referenced by operator!=().
{ const_iterator it1 = _firstNode; const_iterator it2 = other._firstNode; while(it1 || it2) { if (!it1 || !it2) return false; if (it1->first != it2->first) return false; if (it1->second != it2->second) return false; } return !it1 && !it2; }
value_type& XMLStorage::XS_StringMap::operator[] | ( | const key_type & | key ) | [inline] |
Definition at line 1236 of file xmlstorage.h.
References XMLStorage::XS_StringMap::iterator::ptr().
{ iterator last = NULL; iterator node = _firstNode; for(; node; node=(last=node)->_pNext) { int c = node->first.compare(key); if (c == 0) break; // key matched else if (c > 0) { node = NULL; break; } } if (!node) { // insert a new node into the linked list node = new XS_SMNode(key); if (last) { node->_pNext = last->_pNext; last->_pNext = node.ptr(); } else { node->_pNext = _firstNode; _firstNode = node.ptr(); } } return node->second; }
ROS Explorer Source Code Documentation
generated on 02.01.2013 by ![]() |