1/****************************************************************************
2**
3** Copyright (C) 2016 The Qt Company Ltd.
4** Contact: https://www.qt.io/licensing/
5**
6** This file is part of the QtXmlPatterns module of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The Qt Company. For licensing terms
14** and conditions see https://www.qt.io/terms-conditions. For further
15** information use the contact form at https://www.qt.io/contact-us.
16**
17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser
19** General Public License version 3 as published by the Free Software
20** Foundation and appearing in the file LICENSE.LGPL3 included in the
21** packaging of this file. Please review the following information to
22** ensure the GNU Lesser General Public License version 3 requirements
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
24**
25** GNU General Public License Usage
26** Alternatively, this file may be used under the terms of the GNU
27** General Public License version 2.0 or (at your option) the GNU General
28** Public license version 3 or any later version approved by the KDE Free
29** Qt Foundation. The licenses are as published by the Free Software
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
31** included in the packaging of this file. Please review the following
32** information to ensure the GNU General Public License requirements will
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and
34** https://www.gnu.org/licenses/gpl-3.0.html.
35**
36** $QT_END_LICENSE$
37**
38****************************************************************************/
39
40#include <limits>
41
42#include "qabstractfloat_p.h"
43#include "qanyuri_p.h"
44#include "qboolean_p.h"
45#include "qdecimal_p.h"
46#include "qinteger_p.h"
47#include "qatomicstring_p.h"
48#include "quntypedatomic_p.h"
49
50#include "qcommonvalues_p.h"
51
52QT_BEGIN_NAMESPACE
53
54using namespace QPatternist;
55
56// STATIC DATA
57const AtomicString::Ptr CommonValues::EmptyString
58 (new AtomicString(QLatin1String("")));
59const AtomicString::Ptr CommonValues::TrueString
60 (new AtomicString(QLatin1String("true")));
61const AtomicString::Ptr CommonValues::FalseString
62 (new AtomicString(QLatin1String("false")));
63
64const UntypedAtomic::Ptr CommonValues::UntypedAtomicTrue
65 (new UntypedAtomic(QLatin1String("true")));
66const UntypedAtomic::Ptr CommonValues::UntypedAtomicFalse
67 (new UntypedAtomic(QLatin1String("false")));
68
69const AtomicValue::Ptr CommonValues::BooleanTrue
70 (new Boolean(true));
71const AtomicValue::Ptr CommonValues::BooleanFalse(new Boolean(false));
72
73const AtomicValue::Ptr CommonValues::DoubleNaN
74 (Double::fromValue(num: std::numeric_limits<xsDouble>::quiet_NaN()));
75
76const AtomicValue::Ptr CommonValues::FloatNaN
77 (Float::fromValue(num: std::numeric_limits<xsFloat>::quiet_NaN()));
78
79const Item CommonValues::IntegerZero
80 (Integer::fromValue(num: 0));
81
82const AtomicValue::Ptr CommonValues::EmptyAnyURI
83 (AnyURI::fromValue(value: QLatin1String("")));
84
85const AtomicValue::Ptr CommonValues::DoubleOne
86 (Double::fromValue(num: 1));
87const AtomicValue::Ptr CommonValues::FloatOne
88 (Float::fromValue(num: 1));
89const AtomicValue::Ptr CommonValues::DecimalOne
90 (Decimal::fromValue(num: 1));
91const Item CommonValues::IntegerOne
92 (Integer::fromValue(num: 1));
93const Item CommonValues::IntegerOneNegative
94 (Integer::fromValue(num: -1));
95
96const AtomicValue::Ptr CommonValues::DoubleZero
97 (Double::fromValue(num: 0));
98const AtomicValue::Ptr CommonValues::FloatZero
99 (Float::fromValue(num: 0));
100const AtomicValue::Ptr CommonValues::DecimalZero
101 (Decimal::fromValue(num: 0));
102
103const Item::EmptyIterator::Ptr CommonValues::emptyIterator
104 (new Item::EmptyIterator());
105
106const AtomicValue::Ptr CommonValues::NegativeInfDouble
107 (Double::fromValue(num: -std::numeric_limits<xsDouble>::infinity()));
108const AtomicValue::Ptr CommonValues::InfDouble
109 (Double::fromValue(num: std::numeric_limits<xsDouble>::infinity()));
110const AtomicValue::Ptr CommonValues::NegativeInfFloat
111 (Float::fromValue(num: -std::numeric_limits<xsFloat>::infinity()));
112const AtomicValue::Ptr CommonValues::InfFloat
113 (Float::fromValue(num: std::numeric_limits<xsFloat>::infinity()));
114
115const DayTimeDuration::Ptr CommonValues::DayTimeDurationZero
116 (DayTimeDuration::fromSeconds(secs: 0));
117const YearMonthDuration::Ptr CommonValues::YearMonthDurationZero
118 (YearMonthDuration::fromComponents(isPositive: true, years: 0, months: 0));
119
120
121QT_END_NAMESPACE
122

source code of qtxmlpatterns/src/xmlpatterns/data/qcommonvalues.cpp