Qt 4.8
Public Functions | Public Variables | List of all members
QXmlQueryPrivate Class Reference

#include <qxmlquery_p.h>

Public Functions

void addAdditionalNamespaceBinding (const QXmlName &binding)
 
void detach ()
 
QPatternist::DynamicContext::Ptr dynamicContext (QAbstractXmlReceiver *const callback=0)
 
QPatternist::Expression::Ptr expression (QIODevice *const queryDevice=0)
 
bool isValid ()
 
QObjectownerObject ()
 
 QXmlQueryPrivate (const QXmlNamePool &np=QXmlNamePool())
 
void recompileRequired ()
 
QPatternist::SequenceType::Ptr requiredType ()
 
QPatternist::AccelTreeResourceLoader::Ptr resourceLoader ()
 
void setExpressionFactory (const QPatternist::ExpressionFactory::Ptr &expr)
 
void setRequiredType (const QPatternist::SequenceType::Ptr &seqType)
 
QPatternist::GenericStaticContext::Ptr staticContext ()
 
QPatternist::VariableLoader::Ptr variableLoader ()
 

Public Variables

QXmlItem contextItem
 
QXmlName initialTemplateName
 
QList< QXmlNamem_additionalNamespaceBindings
 
QPatternist::Expression::Ptr m_expr
 
QPatternist::ExpressionFactory::Ptr m_expressionFactory
 
QPatternist::FunctionFactory::Ptr m_functionFactory
 
QPatternist::NetworkAccessDelegator::Ptr m_networkAccessDelegator
 
QPatternist::ReferenceCountedValue< QObject >::Ptr m_owner
 
QPatternist::SequenceType::Ptr m_requiredType
 
QPatternist::DeviceResourceLoader::Ptr m_resourceLoader
 
QPatternist::StaticContext::Ptr m_staticContext
 
QPatternist::VariableLoader::Ptr m_variableLoader
 
QPointer< QAbstractMessageHandlermessageHandler
 
QXmlNamePool namePool
 
QXmlQuery::QueryLanguage queryLanguage
 
QUrl queryURI
 
const QAbstractUriResolveruriResolver
 
QPointer< QNetworkAccessManageruserNetworkManager
 

Detailed Description

Definition at line 84 of file qxmlquery_p.h.

Constructors and Destructors

◆ QXmlQueryPrivate()

QXmlQueryPrivate::QXmlQueryPrivate ( const QXmlNamePool np = QXmlNamePool())
inline

Definition at line 88 of file qxmlquery_p.h.

88  : namePool(np)
89  , messageHandler(0)
90  , uriResolver(0)
93  {
95  }
QPatternist::NetworkAccessDelegator::Ptr m_networkAccessDelegator
Definition: qxmlquery_p.h:319
QPatternist::VariableLoader::Ptr variableLoader()
Definition: qxmlquery_p.h:125
QXmlNamePool namePool
Definition: qxmlquery_p.h:277
QExplicitlySharedDataPointer< QPatternist::NamePool > d
Definition: qxmlnamepool.h:88
QXmlQuery::QueryLanguage queryLanguage
Definition: qxmlquery_p.h:292
QObject * ownerObject()
Definition: qxmlquery_p.h:295
const QAbstractUriResolver * uriResolver
Definition: qxmlquery_p.h:283
QPointer< QAbstractMessageHandler > messageHandler
Definition: qxmlquery_p.h:278
A value based class that hands out QNetworkAccessManager appropriately for variable bindings...

Functions

◆ addAdditionalNamespaceBinding()

void QXmlQueryPrivate::addAdditionalNamespaceBinding ( const QXmlName binding)
inline

Definition at line 272 of file qxmlquery_p.h.

Referenced by QPatternist::XsdValidatingInstanceReader::createXQuery(), and QPatternist::XsdSchemaParser::readXPathAttribute().

273  {
275  }
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
QList< QXmlName > m_additionalNamespaceBindings
Definition: qxmlquery_p.h:321

◆ detach()

void QXmlQueryPrivate::detach ( )
inline

Definition at line 97 of file qxmlquery_p.h.

Referenced by QXmlQuery::operator=(), and QXmlQuery::QXmlQuery().

98  {
101 
102  delete m_networkAccessDelegator->m_variableURIManager;
104 
105  if(m_resourceLoader)
106  {
111  nev));
112  }
113  }
Handles requests for documents, and instantiates them as AccelTree instances.
QPatternist::NetworkAccessDelegator::Ptr m_networkAccessDelegator
Definition: qxmlquery_p.h:319
Delegates to another ResourceLoader, but in case a URI is in an exception list, it delegates to a dif...
QXmlNamePool namePool
Definition: qxmlquery_p.h:277
QExplicitlySharedDataPointer< VariableLoader > Ptr
QExplicitlySharedDataPointer< QPatternist::NamePool > d
Definition: qxmlnamepool.h:88
QPatternist::DeviceResourceLoader::Ptr m_resourceLoader
Definition: qxmlquery_p.h:306
QObject * ownerObject()
Definition: qxmlquery_p.h:295
QExplicitlySharedDataPointer< ResourceLoader > Ptr
QPatternist::VariableLoader::Ptr m_variableLoader
Definition: qxmlquery_p.h:305

◆ dynamicContext()

QPatternist::DynamicContext::Ptr QXmlQueryPrivate::dynamicContext ( QAbstractXmlReceiver *const  callback = 0)
inline

Definition at line 175 of file qxmlquery_p.h.

Referenced by QPatternist::VariableLoader::evaluateSequence(), and QXmlQuery::evaluateTo().

176  {
177  const QPatternist::StaticContext::Ptr statContext(staticContext());
178  Q_ASSERT(statContext);
179 
180  QPatternist::GenericDynamicContext::Ptr dynContext(new QPatternist::GenericDynamicContext(namePool.d, statContext->messageHandler(),
181  statContext->sourceLocations()));
182 
184  dynContext.data()));
185  dynContext->setNodeBuilder(nodeBuilder);
186 
187  dynContext->setResourceLoader(statContext->resourceLoader());
188  dynContext->setExternalVariableLoader(statContext->externalVariableLoader());
189  dynContext->setUriResolver(uriResolver);
190 
191  if(callback)
192  dynContext->setOutputReceiver(callback);
193 
194  if(contextItem.isNull())
195  return dynContext;
196  else
197  {
200  it->next();
201  focus->setFocusIterator(it);
202  return focus;
203  }
204  }
A DynamicContext supplying basic information that always is used.
A DynamicContext that maintains the focus, a sequence of items.
Definition: qfocus_p.h:75
#define it(className, varName)
A smart pointer very similar to std::auto_ptr.
Definition: qautoptr_p.h:73
Builds an AccelTree from a stream of XML/Item events received through the NodeBuilder interface...
Definition: qacceltree_p.h:69
The QUrl class provides a convenient interface for working with URLs.
Definition: qurl.h:61
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
T * data() const
Returns a pointer to the shared data object.
Definition: qshareddata.h:145
QXmlNamePool namePool
Definition: qxmlquery_p.h:277
QExplicitlySharedDataPointer< QPatternist::NamePool > d
Definition: qxmlnamepool.h:88
QXmlItem contextItem
Definition: qxmlquery_p.h:284
static Item fromPublic(const QXmlItem &i)
Definition: qitem_p.h:408
const QAbstractUriResolver * uriResolver
Definition: qxmlquery_p.h:283
QPatternist::GenericStaticContext::Ptr staticContext()
Definition: qxmlquery_p.h:133
bool isNull() const
Returns true if this QXmlItem is neither a node nor an atomic value.

◆ expression()

QPatternist::Expression::Ptr QXmlQueryPrivate::expression ( QIODevice *const  queryDevice = 0)
inline

Definition at line 235 of file qxmlquery_p.h.

Referenced by QPatternist::VariableLoader::announceExternalVariable(), QPatternist::VariableLoader::evaluateSequence(), QXmlQuery::evaluateTo(), isValid(), and QXmlQuery::setQuery().

236  {
237  if(m_expr && !queryDevice)
238  return m_expr;
239 
240  /* If we need to update, but we don't have any source code, we can
241  * never create an Expression. */
242  if(!queryDevice)
244 
245  try
246  {
247  /* The static context has source locations, and they need to be
248  * updated to the new query. */
250 
253 
254  m_expr = m_expressionFactory->createExpression(queryDevice, staticContext(),
256  requiredType(),
257  queryURI,
259  }
260  catch(const QPatternist::Exception)
261  {
262  m_expr.reset();
263 
264  /* We don't call m_staticContext.reset() because it shouldn't be
265  * necessary, since m_staticContext is changed when the expression
266  * is changed. */
267  }
268 
269  return m_expr;
270  }
The central entry point for compiling expressions.
QPatternist::SequenceType::Ptr requiredType()
Definition: qxmlquery_p.h:224
QXmlName initialTemplateName
Definition: qxmlquery_p.h:285
QExplicitlySharedDataPointer< ExpressionFactory > Ptr
QExplicitlySharedDataPointer< Expression > Ptr
A smart pointer wrapping mutable Expression instances.
QXmlQuery::QueryLanguage queryLanguage
Definition: qxmlquery_p.h:292
QPatternist::ExpressionFactory::Ptr m_expressionFactory
Definition: qxmlquery_p.h:303
QPatternist::StaticContext::Ptr m_staticContext
Definition: qxmlquery_p.h:304
void reset()
Resets this to be null.
Definition: qshareddata.h:150
QPatternist::GenericStaticContext::Ptr staticContext()
Definition: qxmlquery_p.h:133
QPatternist::Expression::Ptr m_expr
Definition: qxmlquery_p.h:310

◆ isValid()

bool QXmlQueryPrivate::isValid ( )
inline

Definition at line 115 of file qxmlquery_p.h.

Referenced by QXmlQuery::isValid().

116  {
117  return expression();
118  }
QPatternist::Expression::Ptr expression(QIODevice *const queryDevice=0)
Definition: qxmlquery_p.h:235

◆ ownerObject()

QObject* QXmlQueryPrivate::ownerObject ( )
inline

Definition at line 295 of file qxmlquery_p.h.

Referenced by detach(), QXmlQueryPrivate(), and staticContext().

296  {
297  if(!m_owner)
299 
300  return m_owner->value;
301  }
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
QPatternist::ReferenceCountedValue< QObject >::Ptr m_owner
Definition: qxmlquery_p.h:311

◆ recompileRequired()

void QXmlQueryPrivate::recompileRequired ( )
inline

Definition at line 120 of file qxmlquery_p.h.

Referenced by QXmlQuery::bindVariable(), and QXmlQuery::setQuery().

121  {
122  m_expr.reset();
123  }
void reset()
Resets this to be null.
Definition: qshareddata.h:150
QPatternist::Expression::Ptr m_expr
Definition: qxmlquery_p.h:310

◆ requiredType()

QPatternist::SequenceType::Ptr QXmlQueryPrivate::requiredType ( )
inline

Definition at line 224 of file qxmlquery_p.h.

Referenced by expression().

225  {
226  if(m_requiredType)
227  return m_requiredType;
228  else
229  {
231  return m_requiredType;
232  }
233  }
static const SequenceType::Ptr ZeroOrMoreItems
QPatternist::SequenceType::Ptr m_requiredType
Definition: qxmlquery_p.h:317

◆ resourceLoader()

QPatternist::AccelTreeResourceLoader::Ptr QXmlQueryPrivate::resourceLoader ( )
inline

Definition at line 206 of file qxmlquery_p.h.

Referenced by QXmlQuery::bindVariable(), and staticContext().

207  {
208  if(!m_resourceLoader)
210 
211  return m_resourceLoader;
212  }
Handles requests for documents, and instantiates them as AccelTree instances.
QPatternist::NetworkAccessDelegator::Ptr m_networkAccessDelegator
Definition: qxmlquery_p.h:319
QXmlNamePool namePool
Definition: qxmlquery_p.h:277
QExplicitlySharedDataPointer< QPatternist::NamePool > d
Definition: qxmlnamepool.h:88
QPatternist::DeviceResourceLoader::Ptr m_resourceLoader
Definition: qxmlquery_p.h:306

◆ setExpressionFactory()

void QXmlQueryPrivate::setExpressionFactory ( const QPatternist::ExpressionFactory::Ptr expr)
inline

Definition at line 287 of file qxmlquery_p.h.

288  {
289  m_expressionFactory = expr;
290  }
QPatternist::ExpressionFactory::Ptr m_expressionFactory
Definition: qxmlquery_p.h:303

◆ setRequiredType()

void QXmlQueryPrivate::setRequiredType ( const QPatternist::SequenceType::Ptr seqType)
inline

Definition at line 214 of file qxmlquery_p.h.

215  {
216  Q_ASSERT(seqType);
217  if(!m_requiredType || m_requiredType->is(seqType))
218  return;
219 
220  m_requiredType = seqType;
222  }
QPatternist::SequenceType::Ptr m_requiredType
Definition: qxmlquery_p.h:317
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
QPatternist::StaticContext::Ptr m_staticContext
Definition: qxmlquery_p.h:304
void reset()
Resets this to be null.
Definition: qshareddata.h:150

◆ staticContext()

QPatternist::GenericStaticContext::Ptr QXmlQueryPrivate::staticContext ( )
inline

Definition at line 133 of file qxmlquery_p.h.

Referenced by dynamicContext(), expression(), and QXmlQuery::setQuery().

134  {
135  if(m_staticContext && m_expr)
136  return m_staticContext;
137  /* Else, re-create the staticContext. */
138 
139  if(!messageHandler)
141 
142  if(!m_functionFactory)
143  {
146  else
148  }
149 
152  queryURI,
154  queryLanguage));
155  genericStaticContext->setResourceLoader(resourceLoader());
156 
157  genericStaticContext->setExternalVariableLoader(variableLoader());
158 
159  m_staticContext = genericStaticContext;
160 
161  if(!contextItem.isNull())
167 
168  for (int i = 0; i < m_additionalNamespaceBindings.count(); ++i) {
169  m_staticContext->namespaceBindings()->addBinding(m_additionalNamespaceBindings.at(i));
170  }
171 
172  return m_staticContext;
173  }
QPatternist::FunctionFactory::Ptr m_functionFactory
Definition: qxmlquery_p.h:318
A StaticContext that carries a specified static type for the context item, but otherwise delegates to...
The QExplicitlySharedDataPointer class represents a pointer to an explicitly shared object...
Definition: qshareddata.h:136
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
static FunctionFactory::Ptr xslt20Factory(const NamePool::Ptr &np)
QPatternist::VariableLoader::Ptr variableLoader()
Definition: qxmlquery_p.h:125
QList< QXmlName > m_additionalNamespaceBindings
Definition: qxmlquery_p.h:321
QXmlNamePool namePool
Definition: qxmlquery_p.h:277
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QExplicitlySharedDataPointer< QPatternist::NamePool > d
Definition: qxmlnamepool.h:88
QXmlItem contextItem
Definition: qxmlquery_p.h:284
static const AnyNodeType::Ptr node
static FunctionFactory::Ptr xpath20Factory(const NamePool::Ptr &np)
QXmlQuery::QueryLanguage queryLanguage
Definition: qxmlquery_p.h:292
QPatternist::StaticContext::Ptr m_staticContext
Definition: qxmlquery_p.h:304
QObject * ownerObject()
Definition: qxmlquery_p.h:295
QPatternist::AccelTreeResourceLoader::Ptr resourceLoader()
Definition: qxmlquery_p.h:206
QPointer< QAbstractMessageHandler > messageHandler
Definition: qxmlquery_p.h:278
QExplicitlySharedDataPointer< StaticContext > Ptr
static ItemType::Ptr qtToXDMType(const QXmlItem &item)
bool isNull() const
Returns true if this QXmlItem is neither a node nor an atomic value.
QPatternist::Expression::Ptr m_expr
Definition: qxmlquery_p.h:310
Provides setters and getters for the properties defined in StaticContext.

◆ variableLoader()

QPatternist::VariableLoader::Ptr QXmlQueryPrivate::variableLoader ( )
inline

Definition at line 125 of file qxmlquery_p.h.

Referenced by QXmlQuery::bindVariable(), QXmlQueryPrivate(), and staticContext().

126  {
127  if(!m_variableLoader)
129 
130  return m_variableLoader;
131  }
QXmlNamePool namePool
Definition: qxmlquery_p.h:277
QExplicitlySharedDataPointer< VariableLoader > Ptr
QExplicitlySharedDataPointer< QPatternist::NamePool > d
Definition: qxmlnamepool.h:88
QPatternist::VariableLoader::Ptr m_variableLoader
Definition: qxmlquery_p.h:305

Properties

◆ contextItem

QXmlItem QXmlQueryPrivate::contextItem

Definition at line 284 of file qxmlquery_p.h.

Referenced by dynamicContext(), QXmlQuery::setFocus(), and staticContext().

◆ initialTemplateName

QXmlName QXmlQueryPrivate::initialTemplateName

◆ m_additionalNamespaceBindings

QList<QXmlName> QXmlQueryPrivate::m_additionalNamespaceBindings

Definition at line 321 of file qxmlquery_p.h.

Referenced by addAdditionalNamespaceBinding(), and staticContext().

◆ m_expr

QPatternist::Expression::Ptr QXmlQueryPrivate::m_expr

This is the AST for the query.

Definition at line 310 of file qxmlquery_p.h.

Referenced by expression(), recompileRequired(), and staticContext().

◆ m_expressionFactory

QPatternist::ExpressionFactory::Ptr QXmlQueryPrivate::m_expressionFactory

Definition at line 303 of file qxmlquery_p.h.

Referenced by expression(), and setExpressionFactory().

◆ m_functionFactory

QPatternist::FunctionFactory::Ptr QXmlQueryPrivate::m_functionFactory

Definition at line 318 of file qxmlquery_p.h.

Referenced by staticContext().

◆ m_networkAccessDelegator

QPatternist::NetworkAccessDelegator::Ptr QXmlQueryPrivate::m_networkAccessDelegator

◆ m_owner

QPatternist::ReferenceCountedValue<QObject>::Ptr QXmlQueryPrivate::m_owner

Definition at line 311 of file qxmlquery_p.h.

Referenced by ownerObject().

◆ m_requiredType

QPatternist::SequenceType::Ptr QXmlQueryPrivate::m_requiredType

This is our effective network manager, that we end up using. The one the user sets is userNetworkManager.

Definition at line 317 of file qxmlquery_p.h.

Referenced by requiredType(), and setRequiredType().

◆ m_resourceLoader

QPatternist::DeviceResourceLoader::Ptr QXmlQueryPrivate::m_resourceLoader

Definition at line 306 of file qxmlquery_p.h.

Referenced by detach(), and resourceLoader().

◆ m_staticContext

QPatternist::StaticContext::Ptr QXmlQueryPrivate::m_staticContext

Definition at line 304 of file qxmlquery_p.h.

Referenced by expression(), setRequiredType(), and staticContext().

◆ m_variableLoader

QPatternist::VariableLoader::Ptr QXmlQueryPrivate::m_variableLoader

Definition at line 305 of file qxmlquery_p.h.

Referenced by detach(), and variableLoader().

◆ messageHandler

QPointer<QAbstractMessageHandler> QXmlQueryPrivate::messageHandler

◆ namePool

QXmlNamePool QXmlQueryPrivate::namePool

◆ queryLanguage

QXmlQuery::QueryLanguage QXmlQueryPrivate::queryLanguage

◆ queryURI

QUrl QXmlQueryPrivate::queryURI

Must be absolute and valid.

Definition at line 282 of file qxmlquery_p.h.

Referenced by expression(), QXmlQuery::setQuery(), and staticContext().

◆ uriResolver

const QAbstractUriResolver* QXmlQueryPrivate::uriResolver

◆ userNetworkManager

QPointer<QNetworkAccessManager> QXmlQueryPrivate::userNetworkManager

Definition at line 293 of file qxmlquery_p.h.


The documentation for this class was generated from the following file: