Add Status base class.
[shibboleth/cpp-opensaml.git] / saml / saml1 / core / impl / ProtocolsImpl.cpp
index a28a905..684c1e2 100644 (file)
@@ -641,6 +641,24 @@ namespace opensaml {
             IMPL_TYPED_CHILD(StatusMessage);
             IMPL_TYPED_CHILD(StatusDetail);
 
+            // Base class methods.
+            const XMLCh* getTopStatus() const {
+                const xmltooling::QName* code = getStatusCode() ? getStatusCode()->getValue() : nullptr;
+                return code ? code->getLocalPart() : nullptr;
+            }
+            const XMLCh* getSubStatus() const {
+                const StatusCode* sc = getStatusCode() ? getStatusCode()->getStatusCode() : nullptr;
+                if (sc)
+                    return sc->getValue() ? sc->getValue()->getLocalPart() : nullptr;
+                return nullptr;
+            }
+            bool hasAdditionalStatus() const {
+                return (getStatusCode() && getStatusCode()->getStatusCode() && getStatusCode()->getStatusCode()->getStatusCode());
+            }
+            const XMLCh* getMessage() const {
+                return getStatusMessage() ? getStatusMessage()->getMessage() : nullptr;
+            }
+
         protected:
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
                 PROC_TYPED_CHILD(StatusCode,SAML1P_NS,false);