# XQilla Simple API Documentation

- Main Page
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

# ATDurationOrDerived.hpp

Go to the documentation of this file.

    00001 /*
    00002  * Copyright (c) 2001, 2008,
    00003  *     DecisionSoft Limited. All rights reserved.
    00004  * Copyright (c) 2004, 2015 Oracle and/or its affiliates. All rights reserved.
    00005  *
    00006  *
    00007  * Licensed under the Apache License, Version 2.0 (the "License");
    00008  * you may not use this file except in compliance with the License.
    00009  * You may obtain a copy of the License at
    00010  *
    00011  *     http://www.apache.org/licenses/LICENSE-2.0
    00012  *
    00013  * Unless required by applicable law or agreed to in writing, software
    00014  * distributed under the License is distributed on an "AS IS" BASIS,
    00015  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    00016  * See the License for the specific language governing permissions and
    00017  * limitations under the License.
    00018  */
    00019
    00020 #ifndef _ATDURATIONORDERIVED_HPP
    00021 #define _ATDURATIONORDERIVED_HPP
    00022
    00023 #include <xercesc/util/XercesDefs.hpp>
    00024
    00025 #include <xqilla/items/AnyAtomicType.hpp>
    00026 #include <xqilla/framework/XQillaExport.hpp>
    00027 #include <xqilla/items/ATDecimalOrDerived.hpp>
    00028
    00029 class XPath2MemoryManager;
    00030 class DynamicContext;
    00031
    00032 class XQILLA_API ATDurationOrDerived : public AnyAtomicType
    00033 {
    00034 public:
    00035   typedef RefCountPointer<const ATDurationOrDerived> Ptr;
    00036
    00037   /* Get the name of the primitive type (basic type) of this type
    00038    * (ie "decimal" for xs:decimal) */
    00039   virtual const XMLCh* getPrimitiveTypeName() const = 0;
    00040
    00041   /* Get the namespace URI for this type */
    00042   virtual const XMLCh* getTypeURI() const = 0;
    00043
    00044   /* Get the name of this type  (ie "integer" for xs:integer) */
    00045   virtual const XMLCh* getTypeName() const = 0;
    00046
    00047   /* returns the XMLCh* (canonical) representation of this type */
    00048   virtual const XMLCh* asString(const DynamicContext* context) const = 0;
    00049
    00050   /* returns true if this duration is an instance of a xdt:dayTimeDuration */
    00051   virtual bool isDayTimeDuration() const = 0;
    00052
    00053   /* returns true if this duration is an instance of a xdt:yearMonthDuration */
    00054   virtual bool isYearMonthDuration() const = 0;
    00055
    00056   /* returns true if the two objects have the same duration
    00057    * false otherwise */
    00058   virtual bool equals(const AnyAtomicType::Ptr &target, const DynamicContext* context) const = 0;
    00059
    00062   virtual int compare(const ATDurationOrDerived::Ptr &other, const DynamicContext *context) const = 0;
    00063
    00066   virtual ATDurationOrDerived::Ptr divide(const Numeric::Ptr &divisor, const DynamicContext* context) const = 0;
    00067
    00070   virtual ATDecimalOrDerived::Ptr divide(const ATDurationOrDerived::Ptr &divisor, const DynamicContext* context) const = 0;
    00071
    00074   virtual ATDurationOrDerived::Ptr multiply(const Numeric::Ptr &divisor, const DynamicContext* context) const = 0;
    00075
    00078   virtual ATDurationOrDerived::Ptr add(const ATDurationOrDerived::Ptr &other, const DynamicContext* context) const = 0;
    00079
    00082   virtual ATDurationOrDerived::Ptr subtract(const ATDurationOrDerived::Ptr &other, const DynamicContext* context) const = 0;
    00083
    00085   virtual ATDecimalOrDerived::Ptr getYears(const DynamicContext* context) const = 0;
    00086
    00088   virtual ATDecimalOrDerived::Ptr getMonths(const DynamicContext* context) const = 0;
    00089
    00091   virtual ATDecimalOrDerived::Ptr getDays(const DynamicContext* context) const = 0;
    00092
    00094   virtual ATDecimalOrDerived::Ptr getHours(const DynamicContext* context) const = 0;
    00095
    00097   virtual ATDecimalOrDerived::Ptr getMinutes(const DynamicContext* context) const = 0;
    00098
    00100   virtual ATDecimalOrDerived::Ptr getSeconds(const DynamicContext* context) const = 0;
    00101
    00102   /* return this duration in forms of seconds */
    00103   virtual ATDecimalOrDerived::Ptr asSeconds(const DynamicContext* context) const = 0;
    00104
    00105   /* return this duration in forms of months */
    00106   virtual ATDecimalOrDerived::Ptr asMonths(const DynamicContext* context) const = 0;
    00107
    00109   virtual bool isNegative() const = 0;
    00110
    00111   virtual AnyAtomicType::AtomicObjectType getPrimitiveTypeIndex() const = 0;
    00112
    00113   static const XMLCh fgDT_DAYTIMEDURATION[];
    00114   static const XMLCh pattern_DT_DAYTIMEDURATION[];
    00115
    00116   static const XMLCh fgDT_YEARMONTHDURATION[];
    00117   static const XMLCh pattern_DT_YEARMONTHDURATION[];
    00118 };
    00119
    00120 #endif //  _ATDURATIONORDERIVED_HPP
    00121
    00122