/* libxml++
 * Copyright (C) 2000  Ari Johnson
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 */

/* Modified by Motama GmbH, Copyright (C) 2006-2007 Motama GmbH */


#ifndef NMM_XML_PROPERTY_HPP
#define NMM_XML_PROPERTY_HPP NMM_XML_PROPERTY_HPP

#include "nmm/nmm_prefix.hpp"

#include <string>
#include <list>

#include "nmm/nmm_hash_map.hpp"

namespace HASH_MAP_STL {
  template<> struct hash<std::string> {
    size_t operator()(const std::string &s) const {
      return __stl_hash_string(s.c_str());
    };
  };
}

namespace NMM {
  
  class XMLProperty;
  
  typedef std::list<XMLProperty*> XMLPropertyList;
  typedef XMLPropertyList::iterator XMLPropertyIterator;
  typedef XMLPropertyList::const_iterator XMLPropertyConstIterator;
  typedef HASH_MAP_STL::hash_map<std::string, XMLProperty*> XMLPropertyHash;
  
  class XMLProperty {
  private:
    std::string _name;
    std::string _value;
  public:
    XMLProperty(const std::string &n, const std::string &v = std::string())
      : _name(n), _value(v) { };
    const std::string & name(void) const           { return _name; };
    const std::string & value(void) const          { return _value; };
    const std::string & set_value(const std::string &v) { return _value = v; };
    std::string & value(void)                { return _value; };  
  };
  
}

#include "nmm/nmm_suffix.hpp"

#endif
