Qt 4.8
qt-4.8.6
src
xmlpatterns
expr
qemptysequence.cpp
Go to the documentation of this file.
1
/****************************************************************************
2
**
3
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4
** Contact: http://www.qt-project.org/legal
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 Digia. For licensing terms and
14
** conditions see http://qt.digia.com/licensing. For further information
15
** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
20
** Foundation and appearing in the file LICENSE.LGPL included in the
21
** packaging of this file. Please review the following information to
22
** ensure the GNU Lesser General Public License version 2.1 requirements
23
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24
**
25
** In addition, as a special exception, Digia gives you certain additional
26
** rights. These rights are described in the Digia Qt LGPL Exception
27
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28
**
29
** GNU General Public License Usage
30
** Alternatively, this file may be used under the terms of the GNU
31
** General Public License version 3.0 as published by the Free Software
32
** Foundation and appearing in the file LICENSE.GPL included in the
33
** packaging of this file. Please review the following information to
34
** ensure the GNU General Public License version 3.0 requirements will be
35
** met: http://www.gnu.org/copyleft/gpl.html.
36
**
37
**
38
** $QT_END_LICENSE$
39
**
40
****************************************************************************/
41
42
#include "
qcommonvalues_p.h
"
43
#include "
qcommonsequencetypes_p.h
"
44
#include "
qemptysequencetype_p.h
"
45
46
#include "
qemptysequence_p.h
"
47
48
QT_BEGIN_NAMESPACE
49
50
using namespace
QPatternist
;
51
52
Expression::Ptr
EmptySequence::create
(
const
Expression
*
const
replacementFor,
53
const
StaticContext::Ptr
&context)
54
{
55
Q_ASSERT
(replacementFor);
56
Q_ASSERT
(context);
57
58
const
Expression::Ptr
retval(
new
EmptySequence
());
59
context->
wrapExpressionWith
(replacementFor, retval);
60
return
retval;
61
}
62
63
Item::Iterator::Ptr
EmptySequence::evaluateSequence
(
const
DynamicContext::Ptr
&)
const
64
{
65
return
CommonValues::emptyIterator
;
66
}
67
68
Item
EmptySequence::evaluateSingleton
(
const
DynamicContext::Ptr
&)
const
69
{
70
return
Item
();
71
}
72
73
void
EmptySequence::evaluateToSequenceReceiver
(
const
DynamicContext::Ptr
&)
const
74
{
75
}
76
77
ItemType::Ptr
EmptySequence::type
()
const
78
{
79
return
CommonSequenceTypes::Empty
;
80
}
81
82
SequenceType::Ptr
EmptySequence::staticType
()
const
83
{
84
return
CommonSequenceTypes::Empty
;
85
}
86
87
bool
EmptySequence::evaluateEBV
(
const
DynamicContext::Ptr
&)
const
88
{
89
return
false
;
90
}
91
92
QString
EmptySequence::stringValue
()
const
93
{
94
return
QString
();
95
}
96
97
ExpressionVisitorResult::Ptr
EmptySequence::accept
(
const
ExpressionVisitor::Ptr
&visitor)
const
98
{
99
return
visitor->visit(
this
);
100
}
101
102
Expression::ID
EmptySequence::id
()
const
103
{
104
return
IDEmptySequence
;
105
}
106
107
Expression::Properties
EmptySequence::properties
()
const
108
{
109
return
IsEvaluated
;
110
}
111
112
QT_END_NAMESPACE
QPatternist::EmptySequence::accept
virtual ExpressionVisitorResult::Ptr accept(const ExpressionVisitor::Ptr &visitor) const
Definition:
qemptysequence.cpp:97
qemptysequencetype_p.h
QPatternist::Expression::IsEvaluated
Definition:
qexpression_p.h:234
QT_END_NAMESPACE
#define QT_END_NAMESPACE
This macro expands to.
Definition:
qglobal.h:90
QPatternist::Expression
Base class for all AST nodes in an XPath/XQuery/XSL-T expression.
Definition:
qexpression_p.h:165
qcommonvalues_p.h
QPatternist::EmptySequence::stringValue
virtual QString stringValue() const
Definition:
qemptysequence.cpp:92
QPatternist::EmptySequence::EmptySequence
EmptySequence()
Creates an instance of EmptySequence.
Definition:
qemptysequence_p.h:90
qemptysequence_p.h
QExplicitlySharedDataPointer< Expression >
QPatternist::EmptySequence::evaluateSingleton
virtual Item evaluateSingleton(const DynamicContext::Ptr &) const
Definition:
qemptysequence.cpp:68
QString
The QString class provides a Unicode character string.
Definition:
qstring.h:83
QPatternist::Expression::IDEmptySequence
Definition:
qexpression_p.h:468
QPatternist::EmptySequence::create
static Expression::Ptr create(const Expression *const replacementFor, const StaticContext::Ptr &context)
Creates an EmptySequence that is a replacement for replacementFor.
Definition:
qemptysequence.cpp:52
Q_ASSERT
#define Q_ASSERT(cond)
Definition:
qglobal.h:1823
QPatternist::CommonValues::emptyIterator
static const EmptyIterator< Item >::Ptr emptyIterator
Definition:
qcommonvalues_p.h:144
QT_BEGIN_NAMESPACE
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition:
qglobal.h:89
QPatternist::EmptySequence::staticType
virtual SequenceType::Ptr staticType() const
Definition:
qemptysequence.cpp:82
QPatternist::EmptySequence::properties
virtual Properties properties() const
Definition:
qemptysequence.cpp:107
QPatternist
The namespace for the internal API of QtXmlPatterns.
Definition:
qacceliterators_p.h:62
QPatternist::CommonSequenceTypes::Empty
static const EmptySequenceType::Ptr Empty
Definition:
qcommonsequencetypes_p.h:111
QPatternist::Item
Represents an item in the XPath 2.0 Data Model.
Definition:
qitem_p.h:182
QPatternist::EmptySequence::evaluateToSequenceReceiver
virtual void evaluateToSequenceReceiver(const DynamicContext::Ptr &) const
Definition:
qemptysequence.cpp:73
QPatternist::EmptySequence::evaluateEBV
virtual bool evaluateEBV(const DynamicContext::Ptr &context) const
Definition:
qemptysequence.cpp:87
QPatternist::EmptySequence::id
virtual ID id() const
Definition:
qemptysequence.cpp:102
QPatternist::EmptySequence::type
virtual ItemType::Ptr type() const
Definition:
qemptysequence.cpp:77
qcommonsequencetypes_p.h
QPatternist::Expression::ID
ID
Definition:
qexpression_p.h:365
QPatternist::EmptySequence::evaluateSequence
virtual Item::Iterator::Ptr evaluateSequence(const DynamicContext::Ptr &) const
Definition:
qemptysequence.cpp:63
QFlags
The QFlags class provides a type-safe way of storing OR-combinations of enum values.
Definition:
qglobal.h:2313
QPatternist::StaticContext::wrapExpressionWith
void wrapExpressionWith(const SourceLocationReflection *const existingNode, const QExplicitlySharedDataPointer< Expression > &newNode)
Ensures source locations are handled in such a manner that existingNode wraps newNode.
Definition:
qstaticcontext.cpp:55
Qt 4.8 Source Code Browser