Reducing header overuse, non-inlining selected methods (CPPOST-35).
[shibboleth/cpp-opensaml.git] / saml / saml1 / binding / impl / SAMLArtifactType0001.cpp
index 81c5ca4..74e7f01 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@
 /**
  * SAMLArtifactType0001.cpp
  * 
- * Type 0x0001 SAML 1.x artifact class 
+ * Type 0x0001 SAML 1.x artifact class.
  */
 
 #include "internal.h"
@@ -40,6 +40,10 @@ namespace opensaml {
 const unsigned int SAMLArtifactType0001::SOURCEID_LENGTH = 20;
 const unsigned int SAMLArtifactType0001::HANDLE_LENGTH = 20;
 
+SAMLArtifactType0001::SAMLArtifactType0001(const SAMLArtifactType0001& src) : SAMLArtifact(src)
+{
+}
+
 SAMLArtifactType0001::SAMLArtifactType0001(const char* s) : SAMLArtifact(s)
 {
     // The base class does the work, we just do the checking.
@@ -75,3 +79,27 @@ SAMLArtifactType0001::SAMLArtifactType0001(const string& sourceid, const string&
     m_raw.append(sourceid,0,SOURCEID_LENGTH);
     m_raw.append(handle,0,HANDLE_LENGTH);
 }
+
+SAMLArtifactType0001::~SAMLArtifactType0001()
+{
+}
+
+SAMLArtifactType0001* SAMLArtifactType0001::clone() const
+{
+    return new SAMLArtifactType0001(*this);
+}
+
+string SAMLArtifactType0001::getSource() const
+{
+    return toHex(getSourceID());
+}
+
+string SAMLArtifactType0001::getSourceID() const
+{
+    return m_raw.substr(TYPECODE_LENGTH,SOURCEID_LENGTH);                   // bytes 3-22
+}
+
+string SAMLArtifactType0001::getMessageHandle() const
+{
+    return m_raw.substr(TYPECODE_LENGTH+SOURCEID_LENGTH, HANDLE_LENGTH);    // bytes 23-42
+}