From: cantor Date: Wed, 26 Aug 2009 20:43:53 +0000 (+0000) Subject: Additional work for CPPXT-40. X-Git-Tag: 1.4.1~191 X-Git-Url: http://www.project-moonshot.org/gitweb/?a=commitdiff_plain;h=e94558a62a08cd6a7f53825d5334c6f8af6aab45;hp=098b7eb2551b7a0a251a1af1a1ce13f2e6c285e5;p=shibboleth%2Fxmltooling.git Additional work for CPPXT-40. git-svn-id: https://svn.middleware.georgetown.edu/cpp-xmltooling/branches/REL_1@643 de75baf8-a10c-0410-a50a-987c0e22f00f --- diff --git a/xmltooling/Namespace.cpp b/xmltooling/Namespace.cpp index 57ca9d6..38f1f74 100644 --- a/xmltooling/Namespace.cpp +++ b/xmltooling/Namespace.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Internet2 + * Copyright 2001-2009 Internet2 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,74 +29,30 @@ using xercesc::XMLString; Namespace::Namespace(const XMLCh* uri, const XMLCh* prefix, bool alwaysDeclare) : m_pinned(alwaysDeclare) { -#ifndef HAVE_GOOD_STL - m_uri=m_prefix=NULL; -#endif setNamespaceURI(uri); setNamespacePrefix(prefix); } Namespace::~Namespace() { -#ifndef HAVE_GOOD_STL - XMLString::release(&m_uri); - XMLString::release(&m_prefix); -#endif } void Namespace::setNamespacePrefix(const XMLCh* prefix) { -#ifdef HAVE_GOOD_STL if (prefix) m_prefix=prefix; else m_prefix.erase(); -#else - if (m_prefix) - XMLString::release(&m_prefix); - m_prefix=XMLString::replicate(prefix); -#endif } void Namespace::setNamespaceURI(const XMLCh* uri) { -#ifdef HAVE_GOOD_STL if (uri) m_uri=uri; else m_uri.erase(); -#else - if (m_uri) - XMLString::release(&m_uri); - m_uri=XMLString::replicate(uri); -#endif } -#ifndef HAVE_GOOD_STL -Namespace::Namespace(const Namespace& src) -{ - m_uri=XMLString::replicate(src.getNamespaceURI()); - m_prefix=XMLString::replicate(src.getNamespacePrefix()); - m_pinned=src.alwaysDeclare(); -} - -Namespace& Namespace::operator=(const Namespace& src) -{ - m_uri=XMLString::replicate(src.getNamespaceURI()); - m_prefix=XMLString::replicate(src.getNamespacePrefix()); - m_pinned=src.alwaysDeclare(); - return *this; -} - -bool xmltooling::operator==(const Namespace& op1, const Namespace& op2) -{ - if (&op1 == &op2) - return true; - return (XMLString::equals(op1.getNamespaceURI(),op2.getNamespaceURI()) && - XMLString::equals(op1.getNamespacePrefix(),op2.getNamespacePrefix())); -} -#endif - bool xmltooling::operator<(const Namespace& op1, const Namespace& op2) { int i=XMLString::compareString(op1.getNamespaceURI(),op2.getNamespaceURI()); diff --git a/xmltooling/Namespace.h b/xmltooling/Namespace.h index 7b02c1a..a948477 100644 --- a/xmltooling/Namespace.h +++ b/xmltooling/Namespace.h @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Internet2 + * Copyright 2001-2009 Internet2 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,19 +47,7 @@ namespace xmltooling { Namespace(const XMLCh* uri=NULL, const XMLCh* prefix=NULL, bool alwaysDeclare=false); ~Namespace(); -#ifndef HAVE_GOOD_STL - /** - * Deep copy constructor - */ - Namespace(const Namespace& src); - - /** - * Deep assignment operator - */ - Namespace& operator=(const Namespace& src); -#endif -#ifdef HAVE_GOOD_STL /** * Returns the namespace prefix * @return Null-terminated Unicode string containing the prefix, without the colon @@ -71,19 +59,6 @@ namespace xmltooling { * @return Null-terminated Unicode string containing the URI */ const XMLCh* getNamespaceURI() const { return m_uri.c_str(); } -#else - /** - * Returns the namespace prefix - * @return Null-terminated Unicode string containing the prefix, without the colon - */ - const XMLCh* getNamespacePrefix() const { return m_prefix; } - - /** - * Returns the namespace URI - * @return Null-terminated Unicode string containing the URI - */ - const XMLCh* getNamespaceURI() const { return m_uri; } -#endif /** * Returns true iff the namespace should always be declared regardless of in-scope declarations @@ -111,13 +86,8 @@ namespace xmltooling { private: bool m_pinned; -#ifdef HAVE_GOOD_STL xstring m_uri; xstring m_prefix; -#else - XMLCh* m_uri; - XMLCh* m_prefix; -#endif }; #if defined (_MSC_VER) diff --git a/xmltooling/QName.cpp b/xmltooling/QName.cpp index 2ba752c..7aa88d2 100644 --- a/xmltooling/QName.cpp +++ b/xmltooling/QName.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Internet2 + * Copyright 2001-2009 Internet2 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/xmltooling/QName.h b/xmltooling/QName.h index da068a5..a8bdd57 100644 --- a/xmltooling/QName.h +++ b/xmltooling/QName.h @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Internet2 + * Copyright 2001-2009 Internet2 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.