Qt 4.8
|
Delegates to another ResourceLoader, but in case a URI is in an exception list, it delegates to a different loader. More...
#include <qresourcedelegator_p.h>
Public Functions | |
virtual SequenceType::Ptr | announceCollection (const QUrl &uri) |
May be called by the compilation framework at compile time to report that an node collection referenced by uri will be loaded at runtime. More... | |
virtual SequenceType::Ptr | announceDocument (const QUrl &uri, const Usage usageHint) |
May be called by the compilation framework at compile time to report that an XML document referenced by uri will be loaded at runtime. More... | |
virtual ItemType::Ptr | announceUnparsedText (const QUrl &uri) |
May be called by the compilation framework at compile time to report that an unparsed text(plain text) file referenced by uri will be loaded at runtime. More... | |
virtual QSet< QUrl > | deviceURIs () const |
virtual bool | isDocumentAvailable (const QUrl &uri) |
Calls to this function are generated by calls to the fn:doc-available() function. More... | |
virtual bool | isUnparsedTextAvailable (const QUrl &uri, const QString &encoding) |
Calls to this function are generated by calls to the fn:unparsed-text-available() function. More... | |
virtual Item::Iterator::Ptr | openCollection (const QUrl &uri) |
Calls to this function are generated by calls to the fn:collection() function. More... | |
virtual Item | openDocument (const QUrl &uri, const ReportContext::Ptr &context) |
Calls to this function are generated by calls to the fn:document() or fn:doc() function. More... | |
virtual Item | openUnparsedText (const QUrl &uri, const QString &encoding, const ReportContext::Ptr &context, const SourceLocationReflection *const where) |
Calls to this function are generated by calls to the fn:unparsed-text() function. More... | |
ResourceDelegator (const QSet< QUrl > &needsOverride, const ResourceLoader::Ptr &parentLoader, const ResourceLoader::Ptr &forDeviceLoader) | |
Public Functions inherited from QPatternist::ResourceLoader | |
virtual void | clear (const QUrl &uri) |
Asks to unload uri from its document pool, such that a subsequent request will require a new read. More... | |
ResourceLoader () | |
virtual | ~ResourceLoader () |
Public Functions inherited from QSharedData | |
QSharedData () | |
Constructs a QSharedData object with a reference count of 0. More... | |
QSharedData (const QSharedData &) | |
Constructs a QSharedData object with reference count 0. More... | |
Properties | |
const ResourceDelegator::Ptr | m_forDeviceLoader |
const QSet< QUrl > | m_needsOverride |
const ResourceLoader::Ptr | m_parentLoader |
Additional Inherited Members | |
Public Types inherited from QPatternist::DeviceResourceLoader | |
typedef QExplicitlySharedDataPointer< DeviceResourceLoader > | Ptr |
Public Types inherited from QPatternist::ResourceLoader | |
typedef QExplicitlySharedDataPointer< ResourceLoader > | Ptr |
enum | Usage { MayUse, WillUse } |
Public Variables inherited from QSharedData | |
QAtomicInt | ref |
Delegates to another ResourceLoader, but in case a URI is in an exception list, it delegates to a different loader.
This is used for handling device variables, since when a device variable is rebound, a resource loader needs to carry that binding, while the resource loader for the other query remains as is.
Definition at line 76 of file qresourcedelegator_p.h.
|
inline |
Definition at line 79 of file qresourcedelegator_p.h.
|
virtual |
May be called by the compilation framework at compile time to report that an node collection referenced by uri
will be loaded at runtime.
This function can be called an arbitrary amount of times for the same URI. How many times it is called for a URI has no meaning(beyond the first call, that is). For what queries the compilation framework can determine what always will be loaded is generally undefined. It depends on factors such as how simple the query is what information that is statically available and subsequently what optimizations that can apply.
Calls to this function are generated by calls to the fn:collection()
function.
uri | A URI identifying the resource to retrieve. The URI is guaranteed to be valid(QUrl::isValid() returns true ) and to be absolute(QUrl::isRelative() returns false ). |
null
if the ResourceLoader can determine at this stage that no document referenced by uri
will ever be possible to load.uri
succeeds at runtime. This must be CommonSequenceTypes::zeroOrMoreNodes or a sequence type that is a sub type of it. Reimplemented from QPatternist::ResourceLoader.
Definition at line 91 of file qresourcedelegator.cpp.
Referenced by ResourceDelegator().
|
virtual |
May be called by the compilation framework at compile time to report that an XML document referenced by uri
will be loaded at runtime.
This function can be called an arbitrary amount of times for the same URI, but different usageHint
values. How many times it is called for a URI has no meaning(beyond the first call, that is). For what queries the compilation framework can determine what always will be loaded is generally undefined. It depends on factors such as the complexity of the query, what information that is statically available and subsequently what optimizations that can be applied.
Calls to this function are generated by calls to the fn:document()
or fn:doc()
function.
uri | A URI identifying the resource to retrieve. The URI is guaranteed to be valid(QUrl::isValid() returns true ) and to be absolute(QUrl::isRelative() returns false ). |
usageHint | A hint to how the URI will be used. |
null
if the ResourceLoader can determine at this stage that no document referenced by uri
will ever be possible to load.uri
succeeds at runtime. This must be CommonSequenceTypes::zeroOrOneDocument, CommonSequenceTypes::exactlyOneDocument or a sequence type that is a sub type of it. Reimplemented from QPatternist::ResourceLoader.
Definition at line 76 of file qresourcedelegator.cpp.
Referenced by ResourceDelegator().
|
virtual |
May be called by the compilation framework at compile time to report that an unparsed text(plain text) file referenced by uri
will be loaded at runtime.
This function can be called an arbitrary amount of times for the same URI. How many times it is called for a URI has no meaning(beyond the first call, that is). For what queries the compilation framework can determine what always will be loaded is generally undefined. It depends on factors such as how simple the query is what information that is statically available and subsequently what optimizations that can apply.
Calls to this function are generated by calls to the fn:unparsed-text()
function.
uri | A URI identifying the resource to retrieve. The URI is guaranteed to be valid(QUrl::isValid() returns true ) and to be absolute(QUrl::isRelative() returns false ). |
null
if no unparsed file can be loaded for uri
uri
will be an instance of. This is typically xs:string
Reimplemented from QPatternist::ResourceLoader.
Definition at line 54 of file qresourcedelegator.cpp.
Referenced by ResourceDelegator().
Returns the union of the deviceURIs() that ResourceDelegator's two resource loaders has.
Implements QPatternist::DeviceResourceLoader.
Definition at line 96 of file qresourcedelegator.cpp.
Referenced by ResourceDelegator().
|
virtual |
Calls to this function are generated by calls to the fn:doc-available()
function.
uri | A URI identifying the resource to retrieve. The URI is guaranteed to be valid(QUrl::isValid() returns true ) and to be absolute(QUrl::isRelative() returns false ). |
true
if calling openDocument() while passing uri
will successfully load the document. Reimplemented from QPatternist::ResourceLoader.
Definition at line 81 of file qresourcedelegator.cpp.
Referenced by ResourceDelegator().
|
virtual |
Calls to this function are generated by calls to the fn:unparsed-text-available()
function.
uri | A URI identifying the resource to retrieve. The URI is guaranteed to be valid(QUrl::isValid() returns true ) and to be absolute(QUrl::isRelative() returns false ). |
true
if calling openUnparsedText() while passing uri
will successfully load the document. Reimplemented from QPatternist::ResourceLoader.
Definition at line 48 of file qresourcedelegator.cpp.
Referenced by ResourceDelegator().
|
virtual |
Calls to this function are generated by calls to the fn:collection()
function.
uri | A URI identifying the resource to retrieve. The URI is guaranteed to be valid(QUrl::isValid() returns true ) and to be absolute(QUrl::isRelative() returns false ). |
null
if no node collection can be loaded for uri
uri
. Remember that the content of the QAbstractXmlForwardIterator must match the sequence type returned by announceCollection() Reimplemented from QPatternist::ResourceLoader.
Definition at line 86 of file qresourcedelegator.cpp.
Referenced by ResourceDelegator().
|
virtual |
Calls to this function are generated by calls to the fn:document()
or fn:doc()
function.
uri | A URI identifying the resource to retrieve. The URI is guaranteed to be valid(QUrl::isValid() returns true ) and to be absolute(QUrl::isRelative() returns false ). |
null
if no document can be loaded for uri
uri
. Remember that the QXmlNodeModelIndex must match the sequence type returned by announceDocument() Reimplemented from QPatternist::ResourceLoader.
Definition at line 67 of file qresourcedelegator.cpp.
Referenced by ResourceDelegator().
|
virtual |
Calls to this function are generated by calls to the fn:unparsed-text()
function.
uri | A URI identifying the resource to retrieve. The URI is guaranteed to be valid(QUrl::isValid() returns true ) and to be absolute(QUrl::isRelative() returns false ). |
encoding | the encoding to use. If empty, the user hasn't expressed any encoding to use. |
null
if no unparsed file can be loaded for uri
xs:string
value(or subtype) containing the content of the file identified by uri
as text. Remember that its type must match the sequence type returned by announceUnparsedText() Reimplemented from QPatternist::ResourceLoader.
Definition at line 59 of file qresourcedelegator.cpp.
Referenced by ResourceDelegator().
|
private |
Definition at line 112 of file qresourcedelegator_p.h.
Referenced by deviceURIs(), and openDocument().
Definition at line 110 of file qresourcedelegator_p.h.
Referenced by deviceURIs(), and openDocument().
|
private |
Definition at line 111 of file qresourcedelegator_p.h.
Referenced by announceCollection(), announceDocument(), announceUnparsedText(), isDocumentAvailable(), isUnparsedTextAvailable(), openCollection(), openDocument(), openUnparsedText(), and ResourceDelegator().