SourceForge.net Logo
Timezone.hpp
Go to the documentation of this file.
1/*
2 * Copyright (c) 2001, 2008,
3 * DecisionSoft Limited. All rights reserved.
4 * Copyright (c) 2004, 2015 Oracle and/or its affiliates. All rights reserved.
5 *
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19
20#ifndef _TZONE_HPP
21#define _TZONE_HPP
22
23#include <xqilla/framework/XQillaExport.hpp>
26#include <xqilla/mapm/m_apm.h>
27
28#include <xercesc/util/XercesDefs.hpp>
29
30class DynamicContext;
31
32class XQILLA_API Timezone : public ReferenceCounted
33{
34public :
36
40 Timezone(const MAPM &seconds);
41
45 Timezone(const ATDurationOrDerived::Ptr &duration, const DynamicContext* context);
46
50 bool equals(const Timezone::Ptr &other) const;
51
53
58 const XMLCh* asString(const DynamicContext* context) const;
59
63 const MAPM &asSeconds() const { return seconds_; }
64
65 static MAPM convert(bool positive, int hour, int minute);
66
67 static void validate(const MAPM &tz);
68
69private:
70 MAPM seconds_;
71};
72
73#endif // _TZONE_HPP
74
75
RefCountPointer< const ATDurationOrDerived > Ptr
Definition ATDurationOrDerived.hpp:35
The execution time dynamic context interface.
Definition DynamicContext.hpp:39
Super class of all the reference counted wrappers for Items.
Definition ReferenceCounted.hpp:62
ReferenceCounted()
Definition ReferenceCounted.hpp:33
const MAPM & asSeconds() const
Returns the whole timezone expressed in seconds.
Definition Timezone.hpp:63
static void validate(const MAPM &tz)
RefCountPointer< const Timezone > Ptr
Definition Timezone.hpp:35
ATDurationOrDerived::Ptr asDayTimeDuration(const DynamicContext *context) const
static MAPM convert(bool positive, int hour, int minute)
Timezone(const ATDurationOrDerived::Ptr &duration, const DynamicContext *context)
Constructor.
const XMLCh * asString(const DynamicContext *context) const
Returns a string representation of this Timezone.
Timezone(const MAPM &seconds)
Constructor.
bool equals(const Timezone::Ptr &other) const
Returns true if other is equal to this, false otherwise.