#include "../../config/pathan_config.h" /* * Copyright (c) 2001, DecisionSoft Limited All rights reserved. * Please see LICENSE.TXT for more information. */ #include "ATBase64BinaryOrDerivedImpl.hpp" #include #include #include #include #include #include // defines X() and XMLCh* #include ATBase64BinaryOrDerivedImpl:: ATBase64BinaryOrDerivedImpl(const XMLCh* typeURI, const XMLCh* typeName, const XMLCh* value, XPath2MemoryManager* memMgr, const DynamicContext* context): ATBase64BinaryOrDerived(memMgr), _typeName(typeName), _typeURI(typeURI){ _base64Data = getMemoryManager()->getPooledString(value); } /* Get the name of the primitive type (basic type) of this type (ie "decimal" for xs:decimal) */ const XMLCh* ATBase64BinaryOrDerivedImpl::getPrimitiveTypeName() const { return this->getPrimitiveName(); } const XMLCh* ATBase64BinaryOrDerivedImpl::getPrimitiveName() { return XERCES_CPP_NAMESPACE_QUALIFIER SchemaSymbols::fgDT_BASE64BINARY; } /* Get the name of this type (ie "integer" for xs:integer) */ const XMLCh* ATBase64BinaryOrDerivedImpl::getTypeName() const { return _typeName; } /* Get the namespace URI for this type */ const XMLCh* ATBase64BinaryOrDerivedImpl::getTypeURI() const { return _typeURI; } AnyAtomicType::AtomicObjectType ATBase64BinaryOrDerivedImpl::getTypeIndex() { return AnyAtomicType::BASE_64_BINARY; } /* returns the XMLCh* (canonical) representation of this type */ const XMLCh* ATBase64BinaryOrDerivedImpl::asString(const DynamicContext* context) const { return _base64Data; } bool ATBase64BinaryOrDerivedImpl::equals(const AnyAtomicType* target, const DynamicContext* context) const { if(this->getPrimitiveTypeIndex() != target->getPrimitiveTypeIndex()) { DSLthrow(IllegalArgumentException,X("ATBase64BinaryOrDerivedImpl::equals"), X("Equality operator for given types not supported")); } return XPath2Utils::equals(((ATBase64BinaryOrDerivedImpl*)target)->_base64Data, _base64Data); } AnyAtomicType::AtomicObjectType ATBase64BinaryOrDerivedImpl::getPrimitiveTypeIndex() const { return this->getTypeIndex(); } /** Releases the memory used by this Item */ void ATBase64BinaryOrDerivedImpl::release() const { //TODO needs to check for ownership before releasing! getMemoryManager()->deallocate((void*)this); }