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

#include <qxmlschema_p.h>

Inheritance diagram for QXmlSchemaPrivate:
QSharedData

Public Functions

QUrl documentUri () const
 
bool isValid () const
 
void load (const QUrl &source, const QString &targetNamespace)
 
void load (QIODevice *source, const QUrl &documentUri, const QString &targetNamespace)
 
void load (const QByteArray &data, const QUrl &documentUri, const QString &targetNamespace)
 
QAbstractMessageHandlermessageHandler () const
 
QXmlNamePool namePool () const
 
QNetworkAccessManagernetworkAccessManager () const
 
 QXmlSchemaPrivate (const QXmlNamePool &namePool)
 
 QXmlSchemaPrivate (const QPatternist::XsdSchemaContext::Ptr &schemaContext)
 
 QXmlSchemaPrivate (const QXmlSchemaPrivate &other)
 
void setMessageHandler (QAbstractMessageHandler *handler)
 
void setNetworkAccessManager (QNetworkAccessManager *networkmanager)
 
void setUriResolver (const QAbstractUriResolver *resolver)
 
const QAbstractUriResolveruriResolver () const
 
- 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...
 

Public Variables

QUrl m_documentUri
 
QPatternist::ReferenceCountedValue< QAbstractMessageHandler >::Ptr m_messageHandler
 
QXmlNamePool m_namePool
 
QPatternist::ReferenceCountedValue< QNetworkAccessManager >::Ptr m_networkAccessManager
 
QPatternist::XsdSchemaContext::Ptr m_schemaContext
 
bool m_schemaIsValid
 
QPatternist::XsdSchemaParserContext::Ptr m_schemaParserContext
 
const QAbstractUriResolverm_uriResolver
 
QAbstractMessageHandlerm_userMessageHandler
 
QNetworkAccessManagerm_userNetworkAccessManager
 
- Public Variables inherited from QSharedData
QAtomicInt ref
 

Detailed Description

Definition at line 72 of file qxmlschema_p.h.

Constructors and Destructors

◆ QXmlSchemaPrivate() [1/3]

QXmlSchemaPrivate::QXmlSchemaPrivate ( const QXmlNamePool namePool)

Definition at line 52 of file qxmlschema_p.cpp.

53  : m_namePool(namePool)
55  , m_uriResolver(0)
59  , m_schemaIsValid(false)
60 {
63 }
QPatternist::ReferenceCountedValue< QAbstractMessageHandler >::Ptr m_messageHandler
Definition: qxmlschema_p.h:96
A context for schema parsing and validation.
QPatternist::XsdSchemaContext::Ptr m_schemaContext
Definition: qxmlschema_p.h:99
QPatternist::XsdSchemaParserContext::Ptr m_schemaParserContext
Definition: qxmlschema_p.h:100
const QAbstractUriResolver * m_uriResolver
Definition: qxmlschema_p.h:94
QXmlNamePool m_namePool
Definition: qxmlschema_p.h:92
QExplicitlySharedDataPointer< QPatternist::NamePool > d
Definition: qxmlnamepool.h:88
The QNetworkAccessManager class allows the application to send network requests and receive replies...
QPatternist::ReferenceCountedValue< QNetworkAccessManager >::Ptr m_networkAccessManager
Definition: qxmlschema_p.h:97
QAbstractMessageHandler * m_userMessageHandler
Definition: qxmlschema_p.h:93
QNetworkAccessManager * m_userNetworkAccessManager
Definition: qxmlschema_p.h:95

◆ QXmlSchemaPrivate() [2/3]

QXmlSchemaPrivate::QXmlSchemaPrivate ( const QPatternist::XsdSchemaContext::Ptr schemaContext)

Definition at line 65 of file qxmlschema_p.cpp.

66  : m_namePool(QXmlNamePool(schemaContext->namePool().data()))
68  , m_uriResolver(0)
70  , m_schemaContext(schemaContext)
72  , m_schemaIsValid(false)
73 {
76 }
QPatternist::ReferenceCountedValue< QAbstractMessageHandler >::Ptr m_messageHandler
Definition: qxmlschema_p.h:96
QPatternist::XsdSchemaContext::Ptr m_schemaContext
Definition: qxmlschema_p.h:99
QPatternist::XsdSchemaParserContext::Ptr m_schemaParserContext
Definition: qxmlschema_p.h:100
The QXmlNamePool class is a table of shared strings referenced by instances of QXmlName.
Definition: qxmlnamepool.h:69
const QAbstractUriResolver * m_uriResolver
Definition: qxmlschema_p.h:94
T * data() const
Returns a pointer to the shared data object.
Definition: qshareddata.h:145
QXmlNamePool m_namePool
Definition: qxmlschema_p.h:92
QExplicitlySharedDataPointer< QPatternist::NamePool > d
Definition: qxmlnamepool.h:88
The QNetworkAccessManager class allows the application to send network requests and receive replies...
QPatternist::ReferenceCountedValue< QNetworkAccessManager >::Ptr m_networkAccessManager
Definition: qxmlschema_p.h:97
QAbstractMessageHandler * m_userMessageHandler
Definition: qxmlschema_p.h:93
QNetworkAccessManager * m_userNetworkAccessManager
Definition: qxmlschema_p.h:95

◆ QXmlSchemaPrivate() [3/3]

QXmlSchemaPrivate::QXmlSchemaPrivate ( const QXmlSchemaPrivate other)

Definition at line 78 of file qxmlschema_p.cpp.

79  : QSharedData(other)
80 {
81  m_namePool = other.m_namePool;
87 
92 }
QPatternist::ReferenceCountedValue< QAbstractMessageHandler >::Ptr m_messageHandler
Definition: qxmlschema_p.h:96
QSharedData()
Constructs a QSharedData object with a reference count of 0.
Definition: qshareddata.h:61
QPatternist::XsdSchemaContext::Ptr m_schemaContext
Definition: qxmlschema_p.h:99
QPatternist::XsdSchemaParserContext::Ptr m_schemaParserContext
Definition: qxmlschema_p.h:100
const QAbstractUriResolver * m_uriResolver
Definition: qxmlschema_p.h:94
QXmlNamePool m_namePool
Definition: qxmlschema_p.h:92
QPatternist::ReferenceCountedValue< QNetworkAccessManager >::Ptr m_networkAccessManager
Definition: qxmlschema_p.h:97
QAbstractMessageHandler * m_userMessageHandler
Definition: qxmlschema_p.h:93
QNetworkAccessManager * m_userNetworkAccessManager
Definition: qxmlschema_p.h:95

Functions

◆ documentUri()

QUrl QXmlSchemaPrivate::documentUri ( ) const

Definition at line 163 of file qxmlschema_p.cpp.

Referenced by QXmlSchema::documentUri().

164 {
165  return m_documentUri;
166 }

◆ isValid()

bool QXmlSchemaPrivate::isValid ( ) const

◆ load() [1/3]

void QXmlSchemaPrivate::load ( const QUrl source,
const QString targetNamespace 
)

Definition at line 94 of file qxmlschema_p.cpp.

Referenced by QXmlSchema::load(), load(), and QPatternist::XsdValidatingInstanceReader::loadSchema().

95 {
97 
98  m_schemaContext->setMessageHandler(messageHandler());
99  m_schemaContext->setUriResolver(uriResolver());
100  m_schemaContext->setNetworkAccessManager(networkAccessManager());
101 
104  if (reply)
105  load(reply.data(), source, targetNamespace);
106 }
QAbstractMessageHandler * messageHandler() const
QPatternist::XsdSchemaContext::Ptr m_schemaContext
Definition: qxmlschema_p.h:99
A smart pointer very similar to std::auto_ptr.
Definition: qautoptr_p.h:73
QNetworkAccessManager * networkAccessManager() const
The resource loader will report no error and return an empty QNetworkReply.
static QNetworkReply * load(const QUrl &uri, QNetworkAccessManager *const networkManager, const ReportContext::Ptr &context, ErrorHandling handling=FailOnError)
Helper function that do NetworkAccessDelegator::get(), but does it blocked.
void load(const QUrl &source, const QString &targetNamespace)
static QUrl normalizeQueryURI(const QUrl &uri)
const QAbstractUriResolver * uriResolver() const

◆ load() [2/3]

void QXmlSchemaPrivate::load ( QIODevice source,
const QUrl documentUri,
const QString targetNamespace 
)

Definition at line 118 of file qxmlschema_p.cpp.

119 {
121  m_schemaIsValid = false;
122 
123  if (!source) {
124  qWarning("A null QIODevice pointer cannot be passed.");
125  return;
126  }
127 
128  if (!source->isReadable()) {
129  qWarning("The device must be readable.");
130  return;
131  }
132 
134  m_schemaContext->setMessageHandler(messageHandler());
135  m_schemaContext->setUriResolver(uriResolver());
136  m_schemaContext->setNetworkAccessManager(networkAccessManager());
137 
139  parser.setDocumentURI(documentUri);
140  parser.setTargetNamespace(targetNamespace);
141 
142  try {
143  parser.parse();
144  m_schemaParserContext->resolver()->resolve();
145 
146  m_schemaIsValid = true;
147  } catch (QPatternist::Exception exception) {
148  Q_UNUSED(exception);
149  m_schemaIsValid = false;
150  }
151 }
QAbstractMessageHandler * messageHandler() const
bool isReadable() const
Returns true if data can be read from the device; otherwise returns false.
Definition: qiodevice.cpp:544
QPatternist::XsdSchemaContext::Ptr m_schemaContext
Definition: qxmlschema_p.h:99
QPatternist::XsdSchemaParserContext::Ptr m_schemaParserContext
Definition: qxmlschema_p.h:100
QNetworkAccessManager * networkAccessManager() const
QExplicitlySharedDataPointer< XsdSchemaParserContext > Ptr
Q_CORE_EXPORT void qWarning(const char *,...)
QXmlNamePool m_namePool
Definition: qxmlschema_p.h:92
QExplicitlySharedDataPointer< QPatternist::NamePool > d
Definition: qxmlnamepool.h:88
Implements the parsing of XML schema file.
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729
static QUrl normalizeQueryURI(const QUrl &uri)
const QAbstractUriResolver * uriResolver() const

◆ load() [3/3]

void QXmlSchemaPrivate::load ( const QByteArray data,
const QUrl documentUri,
const QString targetNamespace 
)

Definition at line 108 of file qxmlschema_p.cpp.

109 {
110  QByteArray localData(data);
111 
112  QBuffer buffer(&localData);
113  buffer.open(QIODevice::ReadOnly);
114 
115  load(&buffer, documentUri, targetNamespace);
116 }
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
The QBuffer class provides a QIODevice interface for a QByteArray.
Definition: qbuffer.h:57
void load(const QUrl &source, const QString &targetNamespace)

◆ messageHandler()

QAbstractMessageHandler * QXmlSchemaPrivate::messageHandler ( ) const

Definition at line 173 of file qxmlschema_p.cpp.

Referenced by load(), and QXmlSchema::messageHandler().

174 {
176  return m_userMessageHandler;
177 
178  return m_messageHandler.data()->value;
179 }
QPatternist::ReferenceCountedValue< QAbstractMessageHandler >::Ptr m_messageHandler
Definition: qxmlschema_p.h:96
QAbstractMessageHandler * m_userMessageHandler
Definition: qxmlschema_p.h:93

◆ namePool()

QXmlNamePool QXmlSchemaPrivate::namePool ( ) const

Definition at line 158 of file qxmlschema_p.cpp.

Referenced by QXmlSchema::namePool().

159 {
160  return m_namePool;
161 }
QXmlNamePool m_namePool
Definition: qxmlschema_p.h:92

◆ networkAccessManager()

QNetworkAccessManager * QXmlSchemaPrivate::networkAccessManager ( ) const

Definition at line 196 of file qxmlschema_p.cpp.

Referenced by load(), and QXmlSchema::networkAccessManager().

197 {
200 
201  return m_networkAccessManager.data()->value;
202 }
QPatternist::ReferenceCountedValue< QNetworkAccessManager >::Ptr m_networkAccessManager
Definition: qxmlschema_p.h:97
QNetworkAccessManager * m_userNetworkAccessManager
Definition: qxmlschema_p.h:95

◆ setMessageHandler()

void QXmlSchemaPrivate::setMessageHandler ( QAbstractMessageHandler handler)

Definition at line 168 of file qxmlschema_p.cpp.

Referenced by QXmlSchema::setMessageHandler().

169 {
171 }
QAbstractMessageHandler * m_userMessageHandler
Definition: qxmlschema_p.h:93
QImageIOHandler * handler

◆ setNetworkAccessManager()

void QXmlSchemaPrivate::setNetworkAccessManager ( QNetworkAccessManager networkmanager)

Definition at line 191 of file qxmlschema_p.cpp.

Referenced by QXmlSchema::setNetworkAccessManager().

192 {
193  m_userNetworkAccessManager = networkmanager;
194 }
QNetworkAccessManager * m_userNetworkAccessManager
Definition: qxmlschema_p.h:95

◆ setUriResolver()

void QXmlSchemaPrivate::setUriResolver ( const QAbstractUriResolver resolver)

Definition at line 181 of file qxmlschema_p.cpp.

Referenced by QXmlSchema::setUriResolver().

182 {
183  m_uriResolver = resolver;
184 }
const QAbstractUriResolver * m_uriResolver
Definition: qxmlschema_p.h:94

◆ uriResolver()

const QAbstractUriResolver * QXmlSchemaPrivate::uriResolver ( ) const

Definition at line 186 of file qxmlschema_p.cpp.

Referenced by load(), and QXmlSchema::uriResolver().

187 {
188  return m_uriResolver;
189 }
const QAbstractUriResolver * m_uriResolver
Definition: qxmlschema_p.h:94

Properties

◆ m_documentUri

QUrl QXmlSchemaPrivate::m_documentUri

Definition at line 102 of file qxmlschema_p.h.

Referenced by documentUri(), load(), and QXmlSchemaPrivate().

◆ m_messageHandler

QPatternist::ReferenceCountedValue<QAbstractMessageHandler>::Ptr QXmlSchemaPrivate::m_messageHandler

◆ m_namePool

QXmlNamePool QXmlSchemaPrivate::m_namePool

Definition at line 92 of file qxmlschema_p.h.

Referenced by load(), namePool(), and QXmlSchemaPrivate().

◆ m_networkAccessManager

QPatternist::ReferenceCountedValue<QNetworkAccessManager>::Ptr QXmlSchemaPrivate::m_networkAccessManager

◆ m_schemaContext

QPatternist::XsdSchemaContext::Ptr QXmlSchemaPrivate::m_schemaContext

Definition at line 99 of file qxmlschema_p.h.

Referenced by load(), QXmlSchemaPrivate(), and QXmlSchemaValidatorPrivate::setSchema().

◆ m_schemaIsValid

bool QXmlSchemaPrivate::m_schemaIsValid

Definition at line 101 of file qxmlschema_p.h.

Referenced by isValid(), load(), and QXmlSchemaPrivate().

◆ m_schemaParserContext

QPatternist::XsdSchemaParserContext::Ptr QXmlSchemaPrivate::m_schemaParserContext

◆ m_uriResolver

const QAbstractUriResolver* QXmlSchemaPrivate::m_uriResolver

◆ m_userMessageHandler

QAbstractMessageHandler* QXmlSchemaPrivate::m_userMessageHandler

◆ m_userNetworkAccessManager

QNetworkAccessManager* QXmlSchemaPrivate::m_userNetworkAccessManager

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