Initial unit test plus fixes
[shibboleth/xmltooling.git] / xmltooling / Namespace.cpp
index c4bcca7..21bf4b2 100644 (file)
@@ -25,7 +25,7 @@
 \r
 using namespace xmltooling;\r
 \r
-Namespace::Namespace(const XMLCh* uri, const XMLCh* prefix)\r
+Namespace::Namespace(const XMLCh* uri, const XMLCh* prefix, bool alwaysDeclare) : m_pinned(alwaysDeclare)\r
 {\r
 #ifndef HAVE_GOOD_STL\r
     m_uri=m_prefix=NULL;\r
@@ -75,19 +75,21 @@ Namespace::Namespace(const Namespace& src)
 {\r
     m_uri=XMLString::replicate(src.getNamespaceURI());\r
     m_prefix=XMLString::replicate(src.getNamespacePrefix());\r
+    m_pinned=src.getAlwaysDeclare();\r
 }\r
 \r
 Namespace& Namespace::operator=(const Namespace& src)\r
 {\r
     m_uri=XMLString::replicate(src.getNamespaceURI());\r
     m_prefix=XMLString::replicate(src.getNamespacePrefix());\r
+    m_pinned=src.getAlwaysDeclare();\r
     return *this;\r
 }\r
 \r
 bool xmltooling::operator==(const Namespace& op1, const Namespace& op2)\r
 {\r
-    return (!XMLString::compareString(op1.getNamespaceURI(),op2.getNamespaceURI()) &&\r
-            !XMLString::compareString(op1.getNamespacePrefix(),op2.getNamespacePrefix()));\r
+    return (XMLString::equals(op1.getNamespaceURI(),op2.getNamespaceURI()) &&\r
+            XMLString::equals(op1.getNamespacePrefix(),op2.getNamespacePrefix()));\r
 }\r
 #endif\r
 \r