Code

Rework Stack class to TokenExecutor, to support an Axis stack
[inkscape.git] / src / dom / dom.h
index da40edef7e4682aac2be252870da34747a640cb1..6741d375dbc5916bc62700348d476f557b828f6b 100644 (file)
@@ -12,7 +12,7 @@
  * Authors:
  *   Bob Jamison
  *
- * Copyright (C) 2005 Bob Jamison
+ * Copyright (C) 2006 Bob Jamison
  *
  *  This library is free software; you can redistribute it and/or
  *  modify it under the terms of the GNU Lesser General Public
  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <string>
 #include <vector>
 
-#define OWN_STRING
+//# include this before the #ifdefs below
+#include "domconfig.h"
 
-#ifdef OWN_STRING
+#ifdef DOM_STRING_OWN
 #include "domstring.h"
 #else
+#ifdef DOM_STRING_GLIBMM
 #include <glibmm.h>
-typedef Glib::ustring DOMString
+#else
+#include <string>
+#endif
 #endif
 
 #define XMLNSNAME "http://www.w3.org/2000/xmlns/"
@@ -52,11 +55,18 @@ namespace dom
 
 
 
-#ifndef OWN_STRING
-typedef unsigned short XMLCh;
+#ifdef DOM_STRING_OWN
+#else
+#ifdef DOM_STRING_GLIBMM
+typedef Glib::ustring DOMString;
+typedef gunichar XMLCh;
+#else
 typedef std::string DOMString;
+typedef unsigned short XMLCh;
+#endif
 #endif
 
+
 /**
  *
  */
@@ -249,6 +259,15 @@ public:
         strings = other.strings;
         }
 
+    /**
+     *
+     */
+    DOMStringList &operator=(const DOMStringList &other)
+        {
+        strings = other.strings;
+        return *this;
+        }
+
     /**
      *
      */
@@ -287,6 +306,12 @@ public:
         namespaceURI = other.namespaceURI;
         name         = other.name;
         }
+    NamePair &operator=(const NamePair &other)
+        {
+        namespaceURI = other.namespaceURI;
+        name         = other.name;
+        return *this;
+        }
     virtual ~NamePair() {}
 
     DOMString namespaceURI;
@@ -372,6 +397,15 @@ public:
         namePairs = other.namePairs;
         }
 
+    /**
+     *
+     */
+    NameList &operator=(const NameList &other)
+        {
+        namePairs = other.namePairs;
+        return *this;
+        }
+
     /**
      *
      */
@@ -429,6 +463,15 @@ public:
         implementations = other.implementations;
         }
 
+    /**
+     *
+     */
+    DOMImplementationList &operator=(const DOMImplementationList &other)
+        {
+        implementations = other.implementations;
+        return *this;
+        }
+
     /**
      *
      */
@@ -825,11 +868,28 @@ public:
         nodes = other.nodes;
         }
 
+    /**
+     *
+     */
+    NodeList &operator=(const NodeList &other)
+        {
+        nodes = other.nodes;
+        return *this;
+        }
+
     /**
      *
      */
     virtual ~NodeList() {}
 
+    /**
+     *
+     */
+    virtual void clear()
+        {
+        nodes.clear();
+        }
+
 protected:
 
 friend class NodeImpl;
@@ -869,13 +929,22 @@ public:
         }
     NamedNodeMapEntry(const NamedNodeMapEntry &other)
         {
-        namespaceURI = other.namespaceURI;
-        name         = other.name;
-        node         = other.node;
+        assign(other);
+        }
+    NamedNodeMapEntry &operator=(const NamedNodeMapEntry &other)
+        {
+        assign(other);
+        return *this;
         }
     virtual ~NamedNodeMapEntry()
         {
         }
+    void assign(const NamedNodeMapEntry &other)
+        {
+        namespaceURI = other.namespaceURI;
+        name         = other.name;
+        node         = other.node;
+        }
     DOMString namespaceURI;
     DOMString name;
     Node      *node;
@@ -1046,6 +1115,15 @@ public:
         entries = other.entries;
         }
 
+    /**
+     *
+     */
+    NamedNodeMap &operator=(const NamedNodeMap &other)
+        {
+        entries = other.entries;
+        return *this;
+        }
+
 
     /**
      *
@@ -1531,9 +1609,9 @@ public:
 
     typedef enum
         {
-        SEVERITY_WARNING     = 1,
-        SEVERITY_ERROR       = 2,
-        SEVERITY_FATAL_ERROR = 3
+        DOMERROR_SEVERITY_WARNING     = 1,
+        DOMERROR_SEVERITY_ERROR       = 2,
+        DOMERROR_SEVERITY_FATAL_ERROR = 3
         } ErrorSeverity;