Qt 4.8
Protected Functions | Protected Variables | Private Functions | Properties | List of all members
QPatternist::MaintainingReader< TokenLookupClass, LookupKey > Class Template Referenceabstract

Base class for tokenizers that reads XML formats. This is XSLTTokenizer, and the W3C XML Schema parser. More...

#include <qmaintainingreader_p.h>

Inheritance diagram for QPatternist::MaintainingReader< TokenLookupClass, LookupKey >:
QXmlStreamReader

Protected Functions

TokenLookupClass::NodeName currentElementName () const
 
virtual QUrl documentURI () const =0
 Returns the location of the document that MaintainingReader is parsing. Used for error reporting. More...
 
void error (const QString &message, const ReportContext::ErrorCode code) const
 Convenience function for calling ReportContext::error(). More...
 
bool hasAttribute (const QString &namespaceURI, const QString &localName) const
 Returns true if the current element has an attribute whose name is namespaceURI and local name is localName. More...
 
bool hasAttribute (const QString &localName) const
 Returns true if the current element has an attribute whose local name is localName and namespace URI is null. More...
 
virtual bool isAnyAttributeAllowed () const =0
 Returns true, if any attribute is allowed on the element currently being validated. More...
 
bool isWhitespace () const
 
 MaintainingReader (const typename ElementDescription< TokenLookupClass, LookupKey >::Hash &elementDescriptions, const QSet< typename TokenLookupClass::NodeName > &standardAttributes, const ReportContext::Ptr &context, QIODevice *const queryDevice)
 
QString readAttribute (const QString &localName, const QString &namespaceURI=QString()) const
 Returns the value for attribute by name name. More...
 
TokenType readNext ()
 
void validateElement (const LookupKey name) const
 
void warning (const QString &message) const
 Convenience function for calling ReportContext::warning(). More...
 
virtual ~MaintainingReader ()
 

Protected Variables

QXmlStreamAttributes m_currentAttributes
 
bool m_hasHandledStandardAttributes
 
QStack< bool > m_stripWhitespace
 

Private Functions

QSourceLocation currentLocation () const
 

Properties

const ReportContext::Ptr m_context
 
TokenLookupClass::NodeName m_currentElementName
 
const ElementDescription< TokenLookupClass, LookupKey >::Hash m_elementDescriptions
 
const QSet< typename TokenLookupClass::NodeName > m_standardAttributes
 

Additional Inherited Members

- Public Types inherited from QXmlStreamReader
enum  Error {
  NoError, UnexpectedElementError, CustomError, NotWellFormedError,
  PrematureEndOfDocumentError
}
 This enum specifies different error cases. More...
 
enum  ReadElementTextBehaviour { ErrorOnUnexpectedElement, IncludeChildElements, SkipChildElements }
 This enum specifies the different behaviours of readElementText(). More...
 
enum  TokenType {
  NoToken = 0, Invalid, StartDocument, EndDocument,
  StartElement, EndElement, Characters, Comment,
  DTD, EntityReference, ProcessingInstruction
}
 This enum specifies the type of token the reader just read. More...
 
- Public Functions inherited from QXmlStreamReader
void addData (const QByteArray &data)
 Adds more data for the reader to read. More...
 
void addData (const QString &data)
 Adds more data for the reader to read. More...
 
void addData (const char *data)
 Adds more data for the reader to read. More...
 
void addExtraNamespaceDeclaration (const QXmlStreamNamespaceDeclaration &extraNamespaceDeclaraction)
 Adds an extraNamespaceDeclaration. More...
 
void addExtraNamespaceDeclarations (const QXmlStreamNamespaceDeclarations &extraNamespaceDeclaractions)
 Adds a vector of declarations specified by extraNamespaceDeclarations. More...
 
bool atEnd () const
 Returns true if the reader has read until the end of the XML document, or if an error() has occurred and reading has been aborted. More...
 
QXmlStreamAttributes attributes () const
 Returns the attributes of a StartElement. More...
 
qint64 characterOffset () const
 Returns the current character offset, starting with 0. More...
 
void clear ()
 Removes any device() or data from the reader and resets its internal state to the initial state. More...
 
qint64 columnNumber () const
 Returns the current column number, starting with 0. More...
 
QIODevicedevice () const
 Returns the current device associated with the QXmlStreamReader, or 0 if no device has been assigned. More...
 
QStringRef documentEncoding () const
 If the state() is StartDocument , this function returns the encoding string as specified in the XML declaration. More...
 
QStringRef documentVersion () const
 If the state() is StartDocument , this function returns the version string as specified in the XML declaration. More...
 
QStringRef dtdName () const
 If the state() is DTD , this function returns the DTD's name. More...
 
QStringRef dtdPublicId () const
 If the state() is DTD , this function returns the DTD's public identifier. More...
 
QStringRef dtdSystemId () const
 If the state() is DTD , this function returns the DTD's system identifier. More...
 
QXmlStreamEntityDeclarations entityDeclarations () const
 If the state() is DTD , this function returns the DTD's unparsed (external) entity declarations. More...
 
QXmlStreamEntityResolverentityResolver () const
 Returns the entity resolver, or 0 if there is no entity resolver. More...
 
Error error () const
 Returns the type of the current error, or NoError if no error occurred. More...
 
QString errorString () const
 Returns the error message that was set with raiseError(). More...
 
bool hasError () const
 Returns true if an error has occurred, otherwise false. More...
 
bool isCDATA () const
 Returns true if the reader reports characters that stem from a CDATA section; otherwise returns false. More...
 
bool isCharacters () const
 Returns true if tokenType() equals Characters ; otherwise returns false. More...
 
bool isComment () const
 Returns true if tokenType() equals Comment ; otherwise returns false. More...
 
bool isDTD () const
 Returns true if tokenType() equals DTD ; otherwise returns false. More...
 
bool isEndDocument () const
 Returns true if tokenType() equals EndDocument ; otherwise returns false. More...
 
bool isEndElement () const
 Returns true if tokenType() equals EndElement ; otherwise returns false. More...
 
bool isEntityReference () const
 Returns true if tokenType() equals EntityReference ; otherwise returns false. More...
 
bool isProcessingInstruction () const
 Returns true if tokenType() equals ProcessingInstruction ; otherwise returns false. More...
 
bool isStandaloneDocument () const
 Returns true if this document has been declared standalone in the XML declaration; otherwise returns false. More...
 
bool isStartDocument () const
 Returns true if tokenType() equals StartDocument ; otherwise returns false. More...
 
bool isStartElement () const
 Returns true if tokenType() equals StartElement ; otherwise returns false. More...
 
bool isWhitespace () const
 Returns true if the reader reports characters that only consist of white-space; otherwise returns false. More...
 
qint64 lineNumber () const
 Returns the current line number, starting with 1. More...
 
QStringRef name () const
 Returns the local name of a StartElement, EndElement, or an EntityReference. More...
 
QXmlStreamNamespaceDeclarations namespaceDeclarations () const
 If the state() is StartElement , this function returns the element's namespace declarations. More...
 
bool namespaceProcessing () const
 This property controls whether or not the stream reader processes namespaces. More...
 
QStringRef namespaceUri () const
 Returns the namespaceUri of a StartElement or EndElement. More...
 
QXmlStreamNotationDeclarations notationDeclarations () const
 If the state() is DTD , this function returns the DTD's notation declarations. More...
 
QStringRef prefix () const
 Returns the prefix of a StartElement or EndElement. More...
 
QStringRef processingInstructionData () const
 Returns the data of a ProcessingInstruction. More...
 
QStringRef processingInstructionTarget () const
 Returns the target of a ProcessingInstruction. More...
 
QStringRef qualifiedName () const
 Returns the qualified name of a StartElement or EndElement;. More...
 
 QXmlStreamReader ()
 Constructs a stream reader. More...
 
 QXmlStreamReader (QIODevice *device)
 Creates a new stream reader that reads from device. More...
 
 QXmlStreamReader (const QByteArray &data)
 Creates a new stream reader that reads from data. More...
 
 QXmlStreamReader (const QString &data)
 Creates a new stream reader that reads from data. More...
 
 QXmlStreamReader (const char *data)
 Creates a new stream reader that reads from data. More...
 
void raiseError (const QString &message=QString())
 Raises a custom error with an optional error message. More...
 
QString readElementText (ReadElementTextBehaviour behaviour)
 Convenience function to be called in case a StartElement was read. More...
 
QString readElementText ()
 
TokenType readNext ()
 Reads the next token and returns its type. More...
 
bool readNextStartElement ()
 Reads until the next start element within the current element. More...
 
void setDevice (QIODevice *device)
 Sets the current device to device. More...
 
void setEntityResolver (QXmlStreamEntityResolver *resolver)
 Makes resolver the new entityResolver(). More...
 
void setNamespaceProcessing (bool)
 
void skipCurrentElement ()
 Reads until the end of the current element, skipping any child nodes. More...
 
QStringRef text () const
 Returns the text of Characters , Comment , DTD , or EntityReference. More...
 
QString tokenString () const
 Returns the reader's current token as string. More...
 
TokenType tokenType () const
 Returns the type of the current token. More...
 
 ~QXmlStreamReader ()
 Destructs the reader. More...
 

Detailed Description

template<typename TokenLookupClass, typename LookupKey = typename TokenLookupClass::NodeName>
class QPatternist::MaintainingReader< TokenLookupClass, LookupKey >

Base class for tokenizers that reads XML formats. This is XSLTTokenizer, and the W3C XML Schema parser.

MaintainingReader is intended for sub-classing.

Template Parameters
TokenLookupClassThe name of the class that is generated by QTokenAutomaton and which supplies tokenizing tokens. For XSLTTokenizer, this is XSLTTokenLookup, for instance.
LookupKeyThe type that is passed to validateElement() and is the key in ElementDescription. For the schema code, where elements have different interpretations depending on context, the lookup key is hence not equal element name.
Author
Frans Englich frans.nosp@m..eng.nosp@m.lich@.nosp@m.noki.nosp@m.a.com
Since
4.5

Definition at line 112 of file qmaintainingreader_p.h.

Constructors and Destructors

◆ MaintainingReader()

template<typename TokenLookupClass, typename LookupKey>
QPatternist::MaintainingReader< TokenLookupClass, LookupKey >::MaintainingReader ( const typename ElementDescription< TokenLookupClass, LookupKey >::Hash &  elementDescriptions,
const QSet< typename TokenLookupClass::NodeName > &  standardAttributes,
const ReportContext::Ptr context,
QIODevice *const  queryDevice 
)
protected

Definition at line 51 of file qmaintainingreader.cpp.

54  : QXmlStreamReader(queryDevice)
56  , m_context(context)
57  , m_elementDescriptions(elementDescriptions)
58  , m_standardAttributes(standardAttributes)
59 {
61  Q_ASSERT(!m_elementDescriptions.isEmpty());
62 
63  /* We start with stripping. */
64  m_stripWhitespace.push(true);
65 }
const ElementDescription< TokenLookupClass, LookupKey >::Hash m_elementDescriptions
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
QXmlStreamReader()
Constructs a stream reader.
Definition: qxmlstream.cpp:406
const QSet< typename TokenLookupClass::NodeName > m_standardAttributes
void push(const T &t)
Adds element t to the top of the stack.
Definition: qstack.h:60
const ReportContext::Ptr m_context

◆ ~MaintainingReader()

template<typename TokenLookupClass , typename LookupKey >
QPatternist::MaintainingReader< TokenLookupClass, LookupKey >::~MaintainingReader ( )
protectedvirtual

Definition at line 69 of file qmaintainingreader.cpp.

70 {
71 }

Functions

◆ currentElementName()

template<typename TokenLookupClass , typename LookupKey >
TokenLookupClass::NodeName QPatternist::MaintainingReader< TokenLookupClass, LookupKey >::currentElementName ( ) const
inlineprotected

Returns the name of the current element.

Definition at line 137 of file qmaintainingreader.cpp.

138 {
139  return m_currentElementName;
140 }
TokenLookupClass::NodeName m_currentElementName

◆ currentLocation()

template<typename TokenLookupClass , typename LookupKey >
QSourceLocation QPatternist::MaintainingReader< TokenLookupClass, LookupKey >::currentLocation ( ) const
inlineprivate

Returns the current location that QXmlStreamReader has.

Definition at line 75 of file qmaintainingreader.cpp.

76 {
78  lineNumber(),
79  columnNumber());
80 }
qint64 lineNumber() const
Returns the current line number, starting with 1.
The QSourceLocation class identifies a location in a resource by URI, line, and column.
virtual QUrl documentURI() const =0
Returns the location of the document that MaintainingReader is parsing. Used for error reporting...
qint64 columnNumber() const
Returns the current column number, starting with 0.

◆ documentURI()

template<typename TokenLookupClass, typename LookupKey = typename TokenLookupClass::NodeName>
virtual QUrl QPatternist::MaintainingReader< TokenLookupClass, LookupKey >::documentURI ( ) const
protectedpure virtual

Returns the location of the document that MaintainingReader is parsing. Used for error reporting.

Implemented in QPatternist::XsdSchemaParser, and QPatternist::XSLTTokenizer.

◆ error()

template<typename TokenLookupClass , typename LookupKey >
void QPatternist::MaintainingReader< TokenLookupClass, LookupKey >::error ( const QString message,
const ReportContext::ErrorCode  code 
) const
protected

Convenience function for calling ReportContext::error().

Definition at line 122 of file qmaintainingreader.cpp.

124 {
125  m_context->error(message, code, currentLocation());
126 }
QSourceLocation currentLocation() const
const ReportContext::Ptr m_context

◆ hasAttribute() [1/2]

template<typename TokenLookupClass , typename LookupKey >
bool QPatternist::MaintainingReader< TokenLookupClass, LookupKey >::hasAttribute ( const QString namespaceURI,
const QString localName 
) const
protected

Returns true if the current element has an attribute whose name is namespaceURI and local name is localName.

Definition at line 247 of file qmaintainingreader.cpp.

249 {
251  return m_currentAttributes.hasAttribute(namespaceURI, localName);
252 }
QXmlStreamAttributes m_currentAttributes
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
bool hasAttribute(const QString &qualifiedName) const
Definition: qxmlstream.h:181
TokenType tokenType() const
Returns the type of the current token.
Definition: qxmlstream.cpp:656

◆ hasAttribute() [2/2]

template<typename TokenLookupClass , typename LookupKey >
bool QPatternist::MaintainingReader< TokenLookupClass, LookupKey >::hasAttribute ( const QString localName) const
inlineprotected

Returns true if the current element has an attribute whose local name is localName and namespace URI is null.

Definition at line 256 of file qmaintainingreader.cpp.

257 {
258  return hasAttribute(QString(), localName);
259 }
The QString class provides a Unicode character string.
Definition: qstring.h:83
bool hasAttribute(const QString &namespaceURI, const QString &localName) const
Returns true if the current element has an attribute whose name is namespaceURI and local name is loc...

◆ isAnyAttributeAllowed()

template<typename TokenLookupClass, typename LookupKey = typename TokenLookupClass::NodeName>
virtual bool QPatternist::MaintainingReader< TokenLookupClass, LookupKey >::isAnyAttributeAllowed ( ) const
protectedpure virtual

Returns true, if any attribute is allowed on the element currently being validated.

Implemented in QPatternist::XsdSchemaParser, and QPatternist::XSLTTokenizer.

◆ isWhitespace()

template<typename TokenLookupClass , typename LookupKey >
bool QPatternist::MaintainingReader< TokenLookupClass, LookupKey >::isWhitespace ( ) const
protected

QXmlStreamReader::isWhitespace() returns true for whitespace that is not expressed as character references, while XSL-T operatates ontop of the XDM, which means we needs to return true for those too.

See also
4 Data Model

Definition at line 113 of file qmaintainingreader.cpp.

114 {
117 }
bool isWhitespace() const
Returns true if the reader reports characters that only consist of white-space; otherwise returns fal...
QStringRef text() const
Returns the text of Characters , Comment , DTD , or EntityReference.
static bool isWhitespaceOnly(const QStringRef &string)
Determines whether consists only of whitespace. Characters considered whitespace are the ones for whi...

◆ readAttribute()

template<typename TokenLookupClass , typename LookupKey >
QString QPatternist::MaintainingReader< TokenLookupClass, LookupKey >::readAttribute ( const QString localName,
const QString namespaceURI = QString() 
) const
protected

Returns the value for attribute by name name.

If it doesn't exist, an error is raised.

It is assumed that m_reader's current state is QXmlStreamReader::StartElement.

Definition at line 263 of file qmaintainingreader.cpp.

265 {
267 
268  Q_ASSERT_X(m_currentAttributes.hasAttribute(namespaceURI, localName),
269  Q_FUNC_INFO,
270  "Validation must be done before this function is called.");
271 
272  return m_currentAttributes.value(namespaceURI, localName).toString();
273 }
QString toString() const
Returns a copy of the string reference as a QString object.
Definition: qstring.cpp:8653
QXmlStreamAttributes m_currentAttributes
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
bool hasAttribute(const QString &qualifiedName) const
Definition: qxmlstream.h:181
QStringRef value(const QString &namespaceUri, const QString &name) const
Returns the value of the attribute name in the namespace described with namespaceUri, or an empty string reference if the attribute is not defined.
TokenType tokenType() const
Returns the type of the current token.
Definition: qxmlstream.cpp:656
#define Q_ASSERT_X(cond, where, what)
Definition: qglobal.h:1837
#define Q_FUNC_INFO
Definition: qglobal.h:1871

◆ readNext()

template<typename TokenLookupClass , typename LookupKey >
QXmlStreamReader::TokenType QPatternist::MaintainingReader< TokenLookupClass, LookupKey >::readNext ( )
protected

Definition at line 84 of file qmaintainingreader.cpp.

85 {
86  const TokenType retval = QXmlStreamReader::readNext();
87 
88  switch(retval)
89  {
90  case StartElement:
91  {
92  m_currentElementName = TokenLookupClass::toToken(name());
95 
98  break;
99  }
100  case EndElement:
101  m_currentElementName = TokenLookupClass::toToken(name());
103  break;
104  default:
105  break;
106  }
107 
108  return retval;
109 }
QXmlStreamAttributes m_currentAttributes
QStringRef name() const
Returns the local name of a StartElement, EndElement, or an EntityReference.
TokenType
This enum specifies the type of token the reader just read.
Definition: qxmlstream.h:293
bool hasAttribute(const QString &qualifiedName) const
Definition: qxmlstream.h:181
T pop()
Removes the top item from the stack and returns it.
Definition: qstack.h:67
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
void push(const T &t)
Adds element t to the top of the stack.
Definition: qstack.h:60
TokenType readNext()
Reads the next token and returns its type.
Definition: qxmlstream.cpp:623
QXmlStreamAttributes attributes() const
Returns the attributes of a StartElement.
TokenLookupClass::NodeName m_currentElementName
T & top()
Returns a reference to the stack&#39;s top item.
Definition: qstack.h:72

◆ validateElement()

template<typename TokenLookupClass , typename LookupKey>
void QPatternist::MaintainingReader< TokenLookupClass, LookupKey >::validateElement ( const LookupKey  name) const
protected

This function is not merged with handleStandardAttributes() because handleStandardAttributes() needs to be called for all elements, while validateElement() only applies to XSL-T elements.

See also
handleStandardAttributes()

Definition at line 144 of file qmaintainingreader.cpp.

Referenced by QPatternist::XSLTTokenizer::validateElement().

145 {
147 
148  if(m_elementDescriptions.contains(elementName))
149  {
150  // QHash::value breaks in Metrowerks Compiler
151  const ElementDescription<TokenLookupClass, LookupKey> &desc = *m_elementDescriptions.find(elementName);
152  const int attCount = m_currentAttributes.count();
153 
154  QSet<typename TokenLookupClass::NodeName> encounteredXSLTAtts;
155 
156  for(int i = 0; i < attCount; ++i)
157  {
158  const QXmlStreamAttribute &attr = m_currentAttributes.at(i);
159  if(attr.namespaceUri().isEmpty())
160  {
161  const typename TokenLookupClass::NodeName attrName(TokenLookupClass::toToken(attr.name()));
162  encounteredXSLTAtts.insert(attrName);
163 
164  if(!desc.requiredAttributes.contains(attrName) &&
165  !desc.optionalAttributes.contains(attrName) &&
166  !m_standardAttributes.contains(attrName) &&
168  {
169  QString translationString;
170 
171  QList<typename TokenLookupClass::NodeName> all(desc.requiredAttributes.toList() + desc.optionalAttributes.toList());
172  const int totalCount = all.count();
173  QStringList allowed;
174 
175  for(int i = 0; i < totalCount; ++i)
177 
178  /* Note, we can't run toString() on attrName, because we're in this branch,
179  * the token lookup doesn't have the string(!).*/
180  const QString stringedName(attr.name().toString());
181 
182  if(totalCount == 0)
183  {
184  translationString = QtXmlPatterns::tr("Attribute %1 cannot appear on the element %2. Only the standard attributes can appear.")
185  .arg(formatKeyword(stringedName),
186  formatKeyword(name()));
187  }
188  else if(totalCount == 1)
189  {
190  translationString = QtXmlPatterns::tr("Attribute %1 cannot appear on the element %2. Only %3 is allowed, and the standard attributes.")
191  .arg(formatKeyword(stringedName),
192  formatKeyword(name()),
193  allowed.first());
194  }
195  else if(totalCount == 1)
196  {
197  /* Note, allowed has already had formatKeyword() applied. */
198  translationString = QtXmlPatterns::tr("Attribute %1 cannot appear on the element %2. Allowed is %3, %4, and the standard attributes.")
199  .arg(formatKeyword(stringedName),
200  formatKeyword(name()),
201  allowed.first(),
202  allowed.last());
203  }
204  else
205  {
206  /* Note, allowed has already had formatKeyword() applied. */
207  translationString = QtXmlPatterns::tr("Attribute %1 cannot appear on the element %2. Allowed is %3, and the standard attributes.")
208  .arg(formatKeyword(stringedName),
209  formatKeyword(name()),
210  allowed.join(QLatin1String(", ")));
211  }
212 
213  m_context->error(translationString,
215  currentLocation());
216  }
217  }
218  else if(attr.namespaceUri() == namespaceUri())
219  {
220  m_context->error(QtXmlPatterns::tr("XSL-T attributes on XSL-T elements must be in the null namespace, not in the XSL-T namespace which %1 is.")
221  .arg(formatKeyword(attr.name())),
223  currentLocation());
224  }
225  /* Else, attributes in other namespaces are allowed, continue. */
226  }
227 
228  const QSet<typename TokenLookupClass::NodeName> requiredButMissing(QSet<typename TokenLookupClass::NodeName>(desc.requiredAttributes).subtract(encounteredXSLTAtts));
229 
230  if(!requiredButMissing.isEmpty())
231  {
232  error(QtXmlPatterns::tr("The attribute %1 must appear on element %2.")
233  .arg(QPatternist::formatKeyword(TokenLookupClass::toString(*requiredButMissing.constBegin())),
234  formatKeyword(name())),
236  }
237  }
238  else
239  {
240  error(QtXmlPatterns::tr("The element with local name %1 does not exist in XSL-T.").arg(formatKeyword(name())),
242  }
243 }
Error error() const
Returns the type of the current error, or NoError if no error occurred.
QString toString() const
Returns a copy of the string reference as a QString object.
Definition: qstring.cpp:8653
const ElementDescription< TokenLookupClass, LookupKey >::Hash m_elementDescriptions
QString formatKeyword(const QString &keyword)
int count(const T &t) const
Returns the number of occurrences of value in the vector.
Definition: qvector.h:742
QXmlStreamAttributes m_currentAttributes
QStringRef name() const
Returns the local name of a StartElement, EndElement, or an EntityReference.
The QString class provides a Unicode character string.
Definition: qstring.h:83
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
The QXmlStreamAttribute class represents a single XML attribute.
Definition: qxmlstream.h:135
QStringRef namespaceUri() const
Returns the namespaceUri of a StartElement or EndElement.
static QString toString(Register *reg, int type, bool *ok=0)
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
TokenType tokenType() const
Returns the type of the current token.
Definition: qxmlstream.cpp:656
bool contains(const T &value) const
Definition: qset.h:91
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
bool isEmpty() const
Returns true if the string reference has no characters; otherwise returns false.
Definition: qstring.h:1169
const_iterator insert(const T &value)
Definition: qset.h:179
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
const QSet< typename TokenLookupClass::NodeName > m_standardAttributes
QStringRef name() const
Returns the attribute&#39;s local name.
Definition: qxmlstream.h:149
QSet< T > & subtract(const QSet< T > &other)
Definition: qset.h:270
const T & at(int i) const
Returns the item at index position i in the vector.
Definition: qvector.h:350
T & first()
Returns a reference to the first item in the list.
Definition: qlist.h:282
QString join(const QString &sep) const
Joins all the string list&#39;s strings into a single string with each element separated by the given sep...
Definition: qstringlist.h:162
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
Definition: qstring.cpp:7186
QSourceLocation currentLocation() const
T & last()
Returns a reference to the last item in the list.
Definition: qlist.h:284
virtual bool isAnyAttributeAllowed() const =0
Returns true, if any attribute is allowed on the element currently being validated.
const ReportContext::Ptr m_context
The QList class is a template class that provides lists.
Definition: qdatastream.h:62
QStringRef namespaceUri() const
Returns the attribute&#39;s resolved namespaceUri, or an empty string reference if the attribute does not...
Definition: qxmlstream.h:148

◆ warning()

template<typename TokenLookupClass , typename LookupKey >
void QPatternist::MaintainingReader< TokenLookupClass, LookupKey >::warning ( const QString message) const
protected

Convenience function for calling ReportContext::warning().

Definition at line 130 of file qmaintainingreader.cpp.

Referenced by QPatternist::MaintainingReader< XSLTTokenLookup >::warning().

131 {
132  m_context->warning(message, currentLocation());
133 }
QSourceLocation currentLocation() const
const ReportContext::Ptr m_context

Properties

◆ m_context

template<typename TokenLookupClass, typename LookupKey = typename TokenLookupClass::NodeName>
const ReportContext::Ptr QPatternist::MaintainingReader< TokenLookupClass, LookupKey >::m_context
private

This member is private, see the error() and warning() functions in this class.

Definition at line 214 of file qmaintainingreader_p.h.

◆ m_currentAttributes

template<typename TokenLookupClass, typename LookupKey = typename TokenLookupClass::NodeName>
QXmlStreamAttributes QPatternist::MaintainingReader< TokenLookupClass, LookupKey >::m_currentAttributes
protected

Definition at line 172 of file qmaintainingreader_p.h.

◆ m_currentElementName

template<typename TokenLookupClass, typename LookupKey = typename TokenLookupClass::NodeName>
TokenLookupClass::NodeName QPatternist::MaintainingReader< TokenLookupClass, LookupKey >::m_currentElementName
private

Definition at line 208 of file qmaintainingreader_p.h.

◆ m_elementDescriptions

template<typename TokenLookupClass, typename LookupKey = typename TokenLookupClass::NodeName>
const ElementDescription<TokenLookupClass, LookupKey>::Hash QPatternist::MaintainingReader< TokenLookupClass, LookupKey >::m_elementDescriptions
private

Definition at line 221 of file qmaintainingreader_p.h.

◆ m_hasHandledStandardAttributes

template<typename TokenLookupClass, typename LookupKey = typename TokenLookupClass::NodeName>
bool QPatternist::MaintainingReader< TokenLookupClass, LookupKey >::m_hasHandledStandardAttributes
protected

Definition at line 174 of file qmaintainingreader_p.h.

◆ m_standardAttributes

template<typename TokenLookupClass, typename LookupKey = typename TokenLookupClass::NodeName>
const QSet<typename TokenLookupClass::NodeName> QPatternist::MaintainingReader< TokenLookupClass, LookupKey >::m_standardAttributes
private

Definition at line 222 of file qmaintainingreader_p.h.

◆ m_stripWhitespace

template<typename TokenLookupClass, typename LookupKey = typename TokenLookupClass::NodeName>
QStack<bool> QPatternist::MaintainingReader< TokenLookupClass, LookupKey >::m_stripWhitespace
protected

This stack mirrors the depth of elements in the parsed document. If no xml:space is present on the current element, MaintainingReader simply pushes the current top(). However, it never sets the value depending on xml:space's value.

Definition at line 182 of file qmaintainingreader_p.h.


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