[cpp-xmltooling COMMIT] in /branches/REL_1/xmltooling: AbstractAttributeExtensibleXMLObject.cpp AbstractAttributeExte...

noreply at shibboleth.net noreply at shibboleth.net
Thu Mar 29 22:14:19 BST 2012


Author: scantor
Date: Thu Mar 29 22:14:19 2012
New Revision: 969

URL: http://svn.shibboleth.net/view/cpp-xmltooling?rev=969&view=rev
Log:
Add xml:lang support to XMLObject

Modified:
    branches/REL_1/xmltooling/AbstractAttributeExtensibleXMLObject.cpp
    branches/REL_1/xmltooling/AbstractAttributeExtensibleXMLObject.h
    branches/REL_1/xmltooling/AbstractXMLObject.cpp
    branches/REL_1/xmltooling/XMLObject.h

Modified: branches/REL_1/xmltooling/AbstractAttributeExtensibleXMLObject.cpp
URL: http://svn.shibboleth.net/view/cpp-xmltooling/branches/REL_1/xmltooling/AbstractAttributeExtensibleXMLObject.cpp?rev=969&r1=968&r2=969&view=diff
==============================================================================
--- branches/REL_1/xmltooling/AbstractAttributeExtensibleXMLObject.cpp (original)
+++ branches/REL_1/xmltooling/AbstractAttributeExtensibleXMLObject.cpp Thu Mar 29 22:14:19 2012
@@ -135,6 +135,13 @@
     return (i != m_attributeMap.end()) ? i->second : nullptr;
 }
 
+const XMLCh* AbstractAttributeExtensibleXMLObject::getLang() const
+{
+    static const XMLCh _lang[] = UNICODE_LITERAL_4(l,a,n,g);
+    static xmltooling::QName qname(xmlconstants::XML_NS, _lang);
+    return getAttribute(qname);
+}
+
 void AbstractAttributeExtensibleXMLObject::setAttribute(const xmltooling::QName& qualifiedName, const XMLCh* value, bool ID)
 {
     map<xmltooling::QName,XMLCh*>::iterator i=m_attributeMap.find(qualifiedName);

Modified: branches/REL_1/xmltooling/AbstractAttributeExtensibleXMLObject.h
URL: http://svn.shibboleth.net/view/cpp-xmltooling/branches/REL_1/xmltooling/AbstractAttributeExtensibleXMLObject.h?rev=969&r1=968&r2=969&view=diff
==============================================================================
--- branches/REL_1/xmltooling/AbstractAttributeExtensibleXMLObject.h (original)
+++ branches/REL_1/xmltooling/AbstractAttributeExtensibleXMLObject.h Thu Mar 29 22:14:19 2012
@@ -54,6 +54,7 @@
         void setAttribute(const QName& qualifiedName, const XMLCh* value, bool ID=false);
         const std::map<QName,XMLCh*>& getExtensionAttributes() const;
         const XMLCh* getXMLID() const;
+        const XMLCh* getLang() const;
     
      protected:
         AbstractAttributeExtensibleXMLObject();

Modified: branches/REL_1/xmltooling/AbstractXMLObject.cpp
URL: http://svn.shibboleth.net/view/cpp-xmltooling/branches/REL_1/xmltooling/AbstractXMLObject.cpp?rev=969&r1=968&r2=969&view=diff
==============================================================================
--- branches/REL_1/xmltooling/AbstractXMLObject.cpp (original)
+++ branches/REL_1/xmltooling/AbstractXMLObject.cpp Thu Mar 29 22:14:19 2012
@@ -56,53 +56,9 @@
     releaseDOM();
 }
 
-AbstractXMLObject::AbstractXMLObject(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
-    : m_log(logging::Category::getInstance(XMLTOOLING_LOGCAT".XMLObject")),
-    	m_schemaLocation(nullptr), m_noNamespaceSchemaLocation(nullptr), m_nil(xmlconstants::XML_BOOL_NULL),
-        m_parent(nullptr), m_elementQname(nsURI, localName, prefix)
-{
-    addNamespace(Namespace(nsURI, prefix, false, Namespace::VisiblyUsed));
-    if (schemaType) {
-        m_typeQname.reset(new QName(*schemaType));
-        addNamespace(Namespace(m_typeQname->getNamespaceURI(), m_typeQname->getPrefix(), false, Namespace::NonVisiblyUsed));
-    }
-}
-
-AbstractXMLObject::AbstractXMLObject(const AbstractXMLObject& src)
-    : m_namespaces(src.m_namespaces), m_log(src.m_log), m_schemaLocation(XMLString::replicate(src.m_schemaLocation)),
-        m_noNamespaceSchemaLocation(XMLString::replicate(src.m_noNamespaceSchemaLocation)), m_nil(src.m_nil),
-        m_parent(nullptr), m_elementQname(src.m_elementQname),
-        m_typeQname(src.m_typeQname.get() ? new QName(*src.m_typeQname) : nullptr)
-{
-}
-
-AbstractXMLObject::~AbstractXMLObject()
-{
-    xercesc::XMLString::release(&m_schemaLocation);
-    xercesc::XMLString::release(&m_noNamespaceSchemaLocation);
-}
-
-void AbstractXMLObject::detach()
-{
-    if (!getParent())
-        return;
-    else if (getParent()->hasParent())
-        throw XMLObjectException("Cannot detach an object whose parent is itself a child.");
-
-    // Pull ourselves out of the parent and then blast him.
-    getParent()->removeChild(this);
-    delete m_parent;
-    m_parent = nullptr;
-}
-
-const QName& AbstractXMLObject::getElementQName() const
-{
-    return m_elementQname;
-}
-
-const set<Namespace>& AbstractXMLObject::getNamespaces() const
-{
-    return m_namespaces;
+const XMLCh* XMLObject::getLang() const
+{
+    return nullptr;
 }
 
 void XMLObject::setNil(const XMLCh* value)
@@ -128,6 +84,55 @@
     else {
         nil(xmlconstants::XML_BOOL_NULL);
     }
+}
+
+AbstractXMLObject::AbstractXMLObject(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+    : m_log(logging::Category::getInstance(XMLTOOLING_LOGCAT".XMLObject")),
+    	m_schemaLocation(nullptr), m_noNamespaceSchemaLocation(nullptr), m_nil(xmlconstants::XML_BOOL_NULL),

[... 68 lines stripped ...]


More information about the commits mailing list