/* * Copyright (c) 2001, DecisionSoft Limited All rights reserved. * Please see LICENSE.TXT for more information. */ #ifndef _ATDATEORDERIVED_HPP #define _ATDATEORDERIVED_HPP #include #include "DateOrTimeType.hpp" #include class ATDecimalOrDerived; class ATDurationOrDerived; class Timezone; class PATHAN_EXPORT ATDateOrDerived : 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 date, * false otherwise */ virtual bool equals(const AnyAtomicType* target, const DynamicContext* context) const = 0; /** * Returns true if and only if this date is greater than the given date. * The order relation on date values is the order relation on their * starting instants. */ virtual bool greaterThan(const ATDateOrDerived* date, const DynamicContext* context) const = 0; /** * Returns true if and only if this date is less than the given date. * The order relation on date values is the order relation on their * starting instants. */ virtual bool lessThan(const ATDateOrDerived* date, const DynamicContext* context) const = 0; /** * Returns an integer representing the year component of this object */ virtual const ATDecimalOrDerived* getYears() const = 0; /** * Returns an integer representing the month component of this object */ virtual const ATDecimalOrDerived* getMonths() const = 0; /** * Returns an integer representing the day component of this object */ virtual const ATDecimalOrDerived* getDays() 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 ATDateOrDerived* setTimezone(const Timezone* timezone, const DynamicContext* context) const = 0; /** * Returns an ATDateOrDerived with a timezone added to it */ virtual const ATDateOrDerived* addTimezone(const ATDurationOrDerived* timezone, const DynamicContext* context) const = 0; /** * Returns a date with the given yearMonthDuration added to it */ virtual const ATDateOrDerived* addYearMonthDuration(const ATDurationOrDerived* yearMonth, const DynamicContext* context) const = 0; /** * Returns a date with the given dayTimeDuration added to it */ virtual const ATDateOrDerived* addDayTimeDuration(const ATDurationOrDerived* dayTime, const DynamicContext* context) const = 0; /** * Returns a date with the given yearMonthDuration subtracted from it */ virtual const ATDateOrDerived* subtractYearMonthDuration(const ATDurationOrDerived* yearMonth, const DynamicContext* context) const = 0; /** * Returns a date with the given dayTimeDuration subtracted from it */ virtual const ATDateOrDerived* subtractDayTimeDuration(const ATDurationOrDerived* dayTime, const DynamicContext* context) const = 0; /** * Returns a dayTimeDuration corresponding to the difference between this * and the given ATDateOrDerived* */ virtual const ATDurationOrDerived* subtractDate(const ATDateOrDerived* date, const DynamicContext* context) const = 0; virtual AnyAtomicType::AtomicObjectType getPrimitiveTypeIndex() const = 0; virtual const ATDateOrDerived* normalize(const DynamicContext* context) const = 0; protected: /* Protected constructor */ ATDateOrDerived(XPath2MemoryManager* memMgr): DateOrTimeType(memMgr) {}; }; #endif // _ATDATEORDERIVED_HPP