X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=xmltoolingtest%2FXMLObjectBaseTestCase.h;h=d2d56c0f04abc40724347caac86de289fa804463;hb=38003505e53ef5b8c2590af38cfbb0d405ad245f;hp=ba1116f7268a464f6da25b6ded4445a317815fb8;hpb=c162396a9f005de0648b6e6598ff90b4d641deb1;p=shibboleth%2Fcpp-xmltooling.git diff --git a/xmltoolingtest/XMLObjectBaseTestCase.h b/xmltoolingtest/XMLObjectBaseTestCase.h index ba1116f..d2d56c0 100644 --- a/xmltoolingtest/XMLObjectBaseTestCase.h +++ b/xmltoolingtest/XMLObjectBaseTestCase.h @@ -15,6 +15,7 @@ */ #include +#include #include #include #include @@ -23,19 +24,19 @@ #include #include #include -#ifndef XMLTOOLING_NO_XMLSEC - #include -#endif #include #include #include #include +#ifndef XMLTOOLING_NO_XMLSEC + #include + using namespace xmlsignature; +#endif + using namespace xmltooling; using namespace std; -extern ParserPool* validatingPool; -extern ParserPool* nonvalidatingPool; extern string data_path; #if defined (_MSC_VER) @@ -43,7 +44,11 @@ extern string data_path; #pragma warning( disable : 4250 4251 ) #endif -class SimpleXMLObject : public AbstractDOMCachingXMLObject, public AbstractXMLObjectMarshaller, public AbstractXMLObjectUnmarshaller +class SimpleXMLObject + : public AbstractComplexElement, + public AbstractDOMCachingXMLObject, + public AbstractXMLObjectMarshaller, + public AbstractXMLObjectUnmarshaller { protected: SimpleXMLObject(const SimpleXMLObject& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src), @@ -110,6 +115,10 @@ public: VectorOf(SimpleXMLObject) getSimpleXMLObjects() { return VectorOf(SimpleXMLObject)(this, m_simples, &m_children, m_children.end()); } + + const std::vector& getSimpleXMLObjects() const { + return m_simples; + } protected: void marshallAttributes(DOMElement* domElement) const { @@ -175,6 +184,15 @@ public: ) const { return new SimpleXMLObject(nsURI, localName, prefix, schemaType); } + + static SimpleXMLObject* newSimpleXMLObject() { + const SimpleXMLObjectBuilder* b = dynamic_cast( + XMLObjectBuilder::getBuilder(QName(SimpleXMLObject::NAMESPACE,SimpleXMLObject::LOCAL_NAME)) + ); + if (b) + return b->buildObject(); + throw XMLObjectException("Unable to obtain typed builder for SimpleXMLObject."); + } }; #if defined (_MSC_VER)