configmgr: hide NodeMap implementation.

Change-Id: I57c81b5ec7a6541a825e42f9b68e7c5fa98f316f
This commit is contained in:
Michael Meeks
2014-06-26 14:24:20 +01:00
parent f692c61ab2
commit ff1d2ba501
3 changed files with 29 additions and 7 deletions

View File

@@ -25,11 +25,10 @@
#include <rtl/ref.hxx> #include <rtl/ref.hxx>
#include <salhelper/simplereferenceobject.hxx> #include <salhelper/simplereferenceobject.hxx>
#include "nodemap.hxx"
namespace configmgr { namespace configmgr {
class NodeMap;
class Node: public salhelper::SimpleReferenceObject { class Node: public salhelper::SimpleReferenceObject {
public: public:
enum Kind { enum Kind {

View File

@@ -23,13 +23,36 @@
#include <sal/config.h> #include <sal/config.h>
#include <map> #include <map>
#include <rtl/ref.hxx> #include <rtl/ref.hxx>
#include <node.hxx>
namespace configmgr { namespace configmgr {
class Node; typedef std::map< OUString, rtl::Reference< Node > > NodeMapImpl;
class NodeMap
{
NodeMapImpl aImpl;
public:
typedef NodeMapImpl::iterator iterator;
typedef NodeMapImpl::const_iterator const_iterator;
typedef NodeMapImpl::value_type value_type;
typedef std::map< OUString, rtl::Reference< Node > > NodeMap; NodeMap() {}
~NodeMap() {}
void clear() { aImpl.clear(); }
bool empty() { return aImpl.empty(); }
void erase(const iterator &it) { aImpl.erase(it); }
void erase(const OUString &aStr) { aImpl.erase(aStr); }
iterator find(const OUString &aStr) { return aImpl.find( aStr ); }
const_iterator find(const OUString &aStr) const { return aImpl.find( aStr ); }
rtl::Reference<Node> &operator[](const OUString &aStr) { return aImpl[aStr]; }
iterator begin() { return aImpl.begin(); }
const_iterator begin() const { return aImpl.begin(); }
iterator end() { return aImpl.end(); }
const_iterator end() const { return aImpl.end(); }
std::pair<iterator,bool> insert(const value_type &vt) { return aImpl.insert(vt); }
};
void cloneNodeMap(NodeMap const & source, NodeMap * target); void cloneNodeMap(NodeMap const & source, NodeMap * target);

View File

@@ -359,7 +359,7 @@ bool ValueParser::endElement() {
if (i == members.end()) { if (i == members.end()) {
pLVNode = new LocalizedValueNode(layer_); pLVNode = new LocalizedValueNode(layer_);
members.insert( members.insert(
NodeMap::value_type(localizedName_, pLVNode)); NodeMap::value_type(localizedName_, pLVNode ));
} else { } else {
pLVNode = static_cast< LocalizedValueNode * >(i->second.get()); pLVNode = static_cast< LocalizedValueNode * >(i->second.get());
} }