X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-xmltooling.git;a=blobdiff_plain;f=xmltooling%2FQName.cpp;h=2ba752c39aa7f450ab1783ec253871834d421ffa;hp=868725cc456103e8933f83c8edbeb67ad0105e7b;hb=d607c7e778c2c9cadf3a3605c6f66a400a2c223c;hpb=3708c451234f7997f9f7d6112534903d1c2c8704 diff --git a/xmltooling/QName.cpp b/xmltooling/QName.cpp index 868725c..2ba752c 100644 --- a/xmltooling/QName.cpp +++ b/xmltooling/QName.cpp @@ -30,9 +30,6 @@ using xercesc::XMLString; QName::QName(const XMLCh* uri, const XMLCh* localPart, const XMLCh* prefix) { -#ifndef HAVE_GOOD_STL - m_uri=m_prefix=m_local=NULL; -#endif setNamespaceURI(uri); setLocalPart(localPart); setPrefix(prefix); @@ -40,9 +37,6 @@ QName::QName(const XMLCh* uri, const XMLCh* localPart, const XMLCh* prefix) QName::QName(const char* uri, const char* localPart, const char* prefix) { -#ifndef HAVE_GOOD_STL - m_uri=m_prefix=m_local=NULL; -#endif setNamespaceURI(uri); setLocalPart(localPart); setPrefix(prefix); @@ -50,120 +44,62 @@ QName::QName(const char* uri, const char* localPart, const char* prefix) QName::~QName() { -#ifndef HAVE_GOOD_STL - XMLString::release(&m_uri); - XMLString::release(&m_prefix); - XMLString::release(&m_local); -#endif } void QName::setPrefix(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 QName::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 } void QName::setLocalPart(const XMLCh* localPart) { -#ifdef HAVE_GOOD_STL if (localPart) m_local=localPart; else m_local.erase(); -#else - if (m_local) - XMLString::release(&m_local); - m_local=XMLString::replicate(localPart); -#endif } void QName::setPrefix(const char* prefix) { -#ifdef HAVE_GOOD_STL if (prefix) { auto_ptr_XMLCh temp(prefix); m_prefix=temp.get(); } else m_prefix.erase(); -#else - if (m_prefix) - XMLString::release(&m_prefix); - m_prefix=XMLString::transcode(prefix); -#endif } void QName::setNamespaceURI(const char* uri) { -#ifdef HAVE_GOOD_STL if (uri) { auto_ptr_XMLCh temp(uri); m_uri=temp.get(); } else m_uri.erase(); -#else - if (m_uri) - XMLString::release(&m_uri); - m_uri=XMLString::transcode(uri); -#endif } void QName::setLocalPart(const char* localPart) { -#ifdef HAVE_GOOD_STL if (localPart) { auto_ptr_XMLCh temp(localPart); m_local=temp.get(); } else m_local.erase(); -#else - if (m_local) - XMLString::release(&m_local); - m_local=XMLString::transcode(localPart); -#endif } -#ifndef HAVE_GOOD_STL -QName::QName(const QName& src) -{ - m_uri=XMLString::replicate(src.getNamespaceURI()); - m_prefix=XMLString::replicate(src.getPrefix()); - m_local=XMLString::replicate(src.getLocalPart()); -} - -QName& QName::operator=(const QName& src) -{ - m_uri=XMLString::replicate(src.getNamespaceURI()); - m_prefix=XMLString::replicate(src.getPrefix()); - m_local=XMLString::replicate(src.getLocalPart()); - return *this; -} -#endif - bool xmltooling::operator==(const QName& op1, const QName& op2) { if (&op1 == &op2)