/* * Copyright (c) 2001, DecisionSoft Limited All rights reserved. * Please see LICENSE.TXT for more information. */ #ifndef _ATTIMEORDERIVED_HPP #define _ATTIMEORDERIVED_HPP #include #include "DateOrTimeType.hpp" #include class ATDecimalOrDerived; class ATDurationOrDerived; class Timezone; class PATHAN_EXPORT ATTimeOrDerived : public DateOrTimeType { public: /* Get the name of the primitive type (basic type) of this type * (ie "decimal" for xs:decimal) */ virtual const XMLCh* getPrimitiveTypeName() const = 0; /* Get the namespace URI for this type */ virtual const XMLCh* getTypeURI() const = 0; /* Get the name of this type (ie "integer" for xs:integer) */ virtual const XMLCh* getTypeName() const = 0; /* returns the XMLCh* (lexical) representation of this type */ virtual const XMLCh* asString(const DynamicContext* context) const = 0; /** Releases the memory used by this Item */ virtual void release() const = 0; /* returns true if the two objects represent the same time, * false otherwise */ virtual bool equals(const AnyAtomicType* target, const DynamicContext* context) const = 0; /** * Returns true if and only if this time is greater than the given time. * The order relation on time values is the order relation on their * starting instants. */ virtual bool greaterThan(const ATTimeOrDerived* time, const DynamicContext* context) const = 0; /** * Returns true if and only if this time is less than the given time. * The order relation on time values is the order relation on their * starting instants. */ virtual bool lessThan(const ATTimeOrDerived* time, const DynamicContext* context) const = 0; /** * Returns an integer representing the hour component of this object */ virtual const ATDecimalOrDerived* getHours() const = 0; /** * Returns an integer representing the minute component of this object */ virtual const ATDecimalOrDerived* getMinutes() const = 0; /** * Returns an decimal representing the second component of this object */ virtual const ATDecimalOrDerived* getSeconds() const = 0; /** * Returns a timezone object representing the timezone component of this object */ virtual const Timezone* getTimezone() const = 0; /** * Returns true if the timezone is defined for this object, false otherwise. */ virtual bool hasTimezone() const = 0; /** * Setter for timezone. Overrides the current timezone. (Not to be * confused with addTimezone(). */ virtual const ATTimeOrDerived* setTimezone(const Timezone* timezone, const DynamicContext* context) const = 0; virtual const ATTimeOrDerived* normalize(const DynamicContext* context) const = 0; /** * Returns an ATTimeOrDerived with a timezone added to it */ virtual const ATTimeOrDerived* addTimezone(const ATDurationOrDerived* timezone, const DynamicContext* context) const = 0; /** * Returns a time with the given dayTimeDuration added to it */ virtual const ATTimeOrDerived* addDayTimeDuration(const ATDurationOrDerived* dayTime, const DynamicContext* context) const = 0; /** * Returns a time with the given dayTimeDuration subtracted from it */ virtual const ATTimeOrDerived* subtractDayTimeDuration(const ATDurationOrDerived* dayTime, const DynamicContext* context) const = 0; /** * Returns a dayTimeDuration corresponding to the difference between this * and the given ATTimeOrDerived* */ virtual const ATDurationOrDerived* subtractTime(const ATTimeOrDerived* time, const DynamicContext* context) const = 0; virtual AnyAtomicType::AtomicObjectType getPrimitiveTypeIndex() const = 0; protected: /* Protected constructor */ ATTimeOrDerived(XPath2MemoryManager* memMgr): DateOrTimeType(memMgr) {}; }; #endif // _ATTIMEORDERIVED_HPP