Bump version, and draft a fix for CPPXT-40
[shibboleth/cpp-xmltooling.git] / xmltooling / QName.h
index c0e5b95..da068a5 100644 (file)
@@ -42,26 +42,24 @@ namespace xmltooling {
     public:
         /**
          * Constructor
+         * 
          * @param uri       namespace URI
          * @param localPart local name
          * @param prefix    namespace prefix (without the colon)
          */
         QName(const XMLCh* uri=NULL, const XMLCh* localPart=NULL, const XMLCh* prefix=NULL);
-        
-        ~QName();
-#ifndef HAVE_GOOD_STL
-        /**
-         * Deep copy constructor
-         */
-        QName(const QName& src);
 
         /**
-         * Deep assignment operator
+         * Constructor
+         * 
+         * @param uri       namespace URI
+         * @param localPart local name
+         * @param prefix    namespace prefix (without the colon)
          */
-        QName& operator=(const QName& src);
-#endif
+        QName(const char* uri, const char* localPart, const char* prefix=NULL);
+        
+        ~QName();
         
-#ifdef HAVE_GOOD_STL
         /**
          * Indicates whether the QName has a prefix.
          * @return  true iff the prefix is non-empty
@@ -97,61 +95,42 @@ namespace xmltooling {
          * @return  Null-terminated Unicode string containing the local name
          */
         const XMLCh* getLocalPart() const { return m_local.c_str(); }
-#else
-        /**
-         * Indicates whether the QName has a prefix.
-         * @return  true iff the prefix is non-empty
-         */
-        bool hasPrefix() const { return m_prefix && *m_prefix; }
-
-        /**
-         * Indicates whether the QName has a non-empty namespace.
-         * @return  true iff the namespace is non-empty
-         */
-        bool hasNamespaceURI() const { return m_uri && *m_uri; }
-
-        /**
-         * Indicates whether the QName has a non-empty local name.
-         * @return  true iff the local name is non-empty
-         */
-        bool hasLocalPart() const { return m_local && *m_local; }
 
         /**
-         * Returns the namespace prefix
-         * @return  Null-terminated Unicode string containing the prefix, without the colon
+         * Sets the namespace prefix
+         * @param prefix    Null-terminated Unicode string containing the prefix, without the colon
          */
-        const XMLCh* getPrefix() const { return m_prefix; }
+        void setPrefix(const XMLCh* prefix);
 
         /**
-         * Returns the namespace URI
-         * @return  Null-terminated Unicode string containing the URI
+         * Sets the namespace URI
+         * @param uri  Null-terminated Unicode string containing the URI
          */
-        const XMLCh* getNamespaceURI() const { return m_uri; }
-
+        void setNamespaceURI(const XMLCh* uri);
+        
         /**
-         * Returns the local part of the name
-         * @return  Null-terminated Unicode string containing the local name
+         * Sets the local part of the name
+         * @param localPart  Null-terminated Unicode string containing the local name
          */
-        const XMLCh* getLocalPart() const { return m_local; }
-#endif
-
+        void setLocalPart(const XMLCh* localPart);
+        
         /**
          * Sets the namespace prefix
-         * @param prefix    Null-terminated Unicode string containing the prefix, without the colon
+         * @param prefix    Null-terminated ASCII string containing the prefix, without the colon
          */
-        void setPrefix(const XMLCh* prefix);
+        void setPrefix(const char* prefix);
 
         /**
          * Sets the namespace URI
-         * @param uri  Null-terminated Unicode string containing the URI
+         * @param uri  Null-terminated ASCII string containing the URI
          */
-        void setNamespaceURI(const XMLCh* uri);
+        void setNamespaceURI(const char* uri);
         
         /**
          * Sets the local part of the name
-         * @param localPart  Null-terminated Unicode string containing the local name
+         * @param localPart  Null-terminated ASCII string containing the local name
          */
-        void setLocalPart(const XMLCh* localPart);
+        void setLocalPart(const char* localPart);
         
         /**
          * Gets a string representation of the QName for logging, etc.
@@ -162,15 +141,9 @@ namespace xmltooling {
         std::string toString() const;
         
     private:
-#ifdef HAVE_GOOD_STL
         xstring m_uri;
         xstring m_local;
         xstring m_prefix;
-#else
-        XMLCh* m_uri;
-        XMLCh* m_local;
-        XMLCh* m_prefix;
-#endif
     };
 
 #if defined (_MSC_VER)