From: Scott Cantor Date: Tue, 21 Feb 2006 19:46:17 +0000 (+0000) Subject: Tightened up consts. X-Git-Tag: 1.0-alpha1~324 X-Git-Url: http://www.project-moonshot.org/gitweb/?a=commitdiff_plain;ds=sidebyside;h=f57bbff831e6db67bf0f4f897b611008af7a3608;p=shibboleth%2Fcpp-xmltooling.git Tightened up consts. --- diff --git a/xmltooling/util/XMLHelper.cpp b/xmltooling/util/XMLHelper.cpp index cdd32a8..e5962d6 100644 --- a/xmltooling/util/XMLHelper.cpp +++ b/xmltooling/util/XMLHelper.cpp @@ -30,7 +30,7 @@ using namespace xmltooling; static const XMLCh type[]={chLatin_t, chLatin_y, chLatin_p, chLatin_e, chNull }; -bool XMLHelper::hasXSIType(DOMElement* e) +bool XMLHelper::hasXSIType(const DOMElement* e) { if (e) { if (e->hasAttributeNS(XMLConstants::XSI_NS, type)) { @@ -41,7 +41,7 @@ bool XMLHelper::hasXSIType(DOMElement* e) return false; } -QName* XMLHelper::getXSIType(DOMElement* e) +QName* XMLHelper::getXSIType(const DOMElement* e) { DOMAttr* attribute = e->getAttributeNodeNS(XMLConstants::XSI_NS, type); if (attribute) { @@ -60,7 +60,7 @@ QName* XMLHelper::getXSIType(DOMElement* e) return NULL; } -DOMAttr* XMLHelper::getIdAttribute(DOMElement* domElement) +DOMAttr* XMLHelper::getIdAttribute(const DOMElement* domElement) { if(!domElement->hasAttributes()) { return NULL; @@ -78,14 +78,14 @@ DOMAttr* XMLHelper::getIdAttribute(DOMElement* domElement) return NULL; } -QName* XMLHelper::getNodeQName(DOMNode* domNode) +QName* XMLHelper::getNodeQName(const DOMNode* domNode) { if (domNode) return new QName(domNode->getNamespaceURI(), domNode->getLocalName(), domNode->getPrefix()); return NULL; } -QName* XMLHelper::getAttributeValueAsQName(DOMAttr* attribute) +QName* XMLHelper::getAttributeValueAsQName(const DOMAttr* attribute) { if (!attribute) return NULL; diff --git a/xmltooling/util/XMLHelper.h b/xmltooling/util/XMLHelper.h index 5d6925a..9cf69b9 100644 --- a/xmltooling/util/XMLHelper.h +++ b/xmltooling/util/XMLHelper.h @@ -42,7 +42,7 @@ namespace xmltooling { * @param e the DOM element * @return true if there is a type, false if not */ - static bool hasXSIType(DOMElement* e); + static bool hasXSIType(const DOMElement* e); /** * Gets the XSI type for a given element if it has one. @@ -50,7 +50,7 @@ namespace xmltooling { * @param e the element * @return the type or null */ - static QName* getXSIType(DOMElement* e); + static QName* getXSIType(const DOMElement* e); /** * Gets the ID attribute of a DOM element. @@ -58,7 +58,7 @@ namespace xmltooling { * @param domElement the DOM element * @return the ID attribute or null if there isn't one */ - static DOMAttr* getIdAttribute(DOMElement* domElement); + static DOMAttr* getIdAttribute(const DOMElement* domElement); /** * Gets the QName for the given DOM node. @@ -66,7 +66,7 @@ namespace xmltooling { * @param domNode the DOM node * @return the QName for the element or null if the element was null */ - static QName* getNodeQName(DOMNode* domNode); + static QName* getNodeQName(const DOMNode* domNode); /** * Constructs a QName from an attributes value. @@ -74,7 +74,7 @@ namespace xmltooling { * @param attribute the attribute with a QName value * @return a QName from an attributes value, or null if the given attribute is null */ - static QName* getAttributeValueAsQName(DOMAttr* attribute); + static QName* getAttributeValueAsQName(const DOMAttr* attribute); /** * Appends the child Element to the parent Element,