Qt 4.8
qgenericdynamiccontext.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 "qfocus_p.h"
44 #include "qtemplatemode_p.h"
45 
47 
49 
50 using namespace QPatternist;
51 
53  QAbstractMessageHandler *const errHandler,
54  const LocationHash &locations) : m_messageHandler(errHandler)
55  , m_currentDateTime(QDateTime::currentDateTime().toTimeSpec(Qt::UTC))
56  , m_outputReceiver(0)
57  , m_namePool(np)
58  , m_locations(locations)
59  , m_uriResolver(0)
60 {
63 }
64 
66 {
67  /* Or what do you prefer, sir? */
69 }
70 
72 {
73  return m_messageHandler;
74 }
75 
77 {
78  return m_currentDateTime;
79 }
80 
82 {
83  Q_ASSERT_X(false, Q_FUNC_INFO, "That this function is called makes no sense. A Focus should be used.");
84  return 0;
85 }
86 
88 {
89  return Item();
90 }
91 
93 {
94  Q_ASSERT_X(false, Q_FUNC_INFO, "That this function is called makes no sense. A Focus should be used.");
95  return 0;
96 }
97 
99 {
100  Q_ASSERT_X(false, Q_FUNC_INFO, "That this function is called makes no sense. A Focus should be used.");
101 }
102 
104 {
105  return Item::Iterator::Ptr();
106 }
107 
109 {
110  return m_outputReceiver;
111 }
112 
114 {
115  m_outputReceiver = receiver;
116 }
117 
119 {
120  m_nodeBuilder = builder;
121 }
122 
124 {
125  return m_nodeBuilder->create(baseURI);
126 }
127 
129 {
130  return m_resourceLoader;
131 }
132 
134 {
135  m_resourceLoader = loader;
136 }
137 
139 {
141 }
142 
144 {
145  m_externalVariableLoader = loader;
146 }
147 
149 {
150  return m_namePool;
151 }
152 
154 {
155 
156  return m_locations.value(reflection->actualReflection());
157 }
158 
160 {
161  m_nodeModels.append(nm);
162 }
163 
165 {
166  return m_uriResolver;
167 }
168 
170 {
171  if(slot >= m_globalItemCacheCells.size())
173 
174  return m_globalItemCacheCells[slot];
175 }
176 
178 {
181 
183 }
184 
186 {
187  m_uriResolver = resolver;
188 }
189 
191 {
192  return Item();
193 }
194 
196 {
197  return DynamicContext::Ptr();
198 }
199 
201 {
203 }
204 
qint32 VariableSlotID
virtual void setFocusIterator(const Item::Iterator::Ptr &it)
A push interface for the XPath Data Model. Similar to SAX's ContentHandler.
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
virtual Item::Iterator::Ptr focusIterator() const
virtual QAbstractXmlReceiver * outputReceiver() const
qint64 xsInteger
const QAbstractUriResolver * m_uriResolver
virtual const SourceLocationReflection * actualReflection() const =0
virtual void addNodeModel(const QAbstractXmlNodeModel::Ptr &nm)
The QUrl class provides a convenient interface for working with URLs.
Definition: qurl.h:61
virtual QExplicitlySharedDataPointer< TemplateMode > currentTemplateMode() const
Returns the current template mode that is in effect.
The QHash class is a template class that provides a hash-table-based dictionary.
Definition: qdatastream.h:66
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
const T value(const Key &key) const
Returns the value associated with the key.
Definition: qhash.h:606
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
virtual const QAbstractUriResolver * uriResolver() const
The URI resolver in use.
void resize(int size)
Sets the size of the vector to size.
Definition: qvector.h:342
QExplicitlySharedDataPointer< QAbstractXmlForwardIterator< Item > > Ptr
A smart pointer wrapping an instance of a QAbstractXmlForwardIterator subclass.
virtual ItemSequenceCacheCell::Vector & globalItemSequenceCacheCells(const VariableSlotID slot)
virtual NodeBuilder::Ptr nodeBuilder(const QUrl &baseURI) const
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
The QAbstractUriResolver class is a callback interface for resolving Uniform Resource Identifiers...
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
void setResourceLoader(const ResourceLoader::Ptr &loader)
The namespace for the internal API of QtXmlPatterns.
ExternalVariableLoader::Ptr m_externalVariableLoader
Represents a cache entry for a single Item, as opposed to for a sequence of items.
Definition: qcachecells_p.h:81
The QSourceLocation class identifies a location in a resource by URI, line, and column.
virtual NodeBuilder::Ptr create(const QUrl &baseURI) const =0
Creates a copy of this NodeBuilder, that operates independently of this NodeBuilder.
virtual ResourceLoader::Ptr resourceLoader() const
virtual NamePool::Ptr namePool() const
virtual QExplicitlySharedDataPointer< DayTimeDuration > implicitTimezone() const
QAbstractXmlNodeModel::List m_nodeModels
virtual ExternalVariableLoader::Ptr externalVariableLoader() const
#define Q_ASSERT_X(cond, where, what)
Definition: qglobal.h:1837
void setExternalVariableLoader(const ExternalVariableLoader::Ptr &loader)
The QDateTime class provides date and time functions.
Definition: qdatetime.h:216
Represents an item in the XPath 2.0 Data Model.
Definition: qitem_p.h:182
The QAbstractMessageHandler class provides a callback interface for handling messages.
static const DayTimeDuration::Ptr DayTimeDurationZero
virtual QAbstractMessageHandler * messageHandler() const
Definition: qnamespace.h:54
GenericDynamicContext(const NamePool::Ptr &np, QAbstractMessageHandler *const messageHandler, const LocationHash &locations)
QExplicitlySharedDataPointer< DynamicContext > Ptr
virtual QSourceLocation locationFor(const SourceLocationReflection *const reflection) const
Returns the source location applying for reflection.
void setUriResolver(const QAbstractUriResolver *const resolver)
ItemSequenceCacheCell::Vector m_globalItemSequenceCacheCells
virtual ItemCacheCell & globalItemCacheCell(const VariableSlotID slot)
void setNodeBuilder(NodeBuilder::Ptr &builder)
void setOutputReceiver(QAbstractXmlReceiver *const receiver)
int size() const
Returns the number of items in the vector.
Definition: qvector.h:137
virtual DynamicContext::Ptr previousContext() const
Returns always null, since we&#39;re always a top-level context.
Base class for all instances that represents something at a certain location.
#define Q_FUNC_INFO
Definition: qglobal.h:1871