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