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

#include <qxmlstream_p.h>

Inheritance diagram for QXmlStreamPrivateTagStack:
QXmlStreamReaderPrivate QXmlStreamWriterPrivate

Classes

struct  NamespaceDeclaration
 
struct  Tag
 

Public Functions

QStringRef addToStringStorage (const QStringRef &s)
 
QStringRef addToStringStorage (const QString &s)
 
 QXmlStreamPrivateTagStack ()
 
TagtagStack_pop ()
 
TagtagStack_push ()
 

Public Variables

QXmlStreamSimpleStack< NamespaceDeclarationnamespaceDeclarations
 
bool tagsDone
 
QXmlStreamSimpleStack< TagtagStack
 
QString tagStackStringStorage
 
int tagStackStringStorageSize
 

Detailed Description

Definition at line 678 of file qxmlstream_p.h.

Constructors and Destructors

◆ QXmlStreamPrivateTagStack()

QXmlStreamPrivateTagStack::QXmlStreamPrivateTagStack ( )

Definition at line 807 of file qxmlstream.cpp.

808 {
809  tagStack.reserve(16);
812  NamespaceDeclaration &namespaceDeclaration = namespaceDeclarations.push();
813  namespaceDeclaration.prefix = addToStringStorage(QLatin1String("xml"));
814  namespaceDeclaration.namespaceUri = addToStringStorage(QLatin1String("http://www.w3.org/XML/1998/namespace"));
815 }
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
void reserve(int size)
Attempts to allocate memory for at least size characters.
Definition: qstring.h:881
QXmlStreamSimpleStack< NamespaceDeclaration > namespaceDeclarations
Definition: qxmlstream_p.h:697
QStringRef addToStringStorage(const QStringRef &s)
Definition: qxmlstream_p.h:702
QXmlStreamSimpleStack< Tag > tagStack
Definition: qxmlstream_p.h:721

Functions

◆ addToStringStorage() [1/2]

QStringRef QXmlStreamPrivateTagStack::addToStringStorage ( const QStringRef s)
inline

Definition at line 702 of file qxmlstream_p.h.

Referenced by QXmlStreamWriterPrivate::findNamespace().

702  {
703  int pos = tagStackStringStorageSize;
704  int sz = s.size();
705  if (pos != tagStackStringStorage.size())
707  tagStackStringStorage.insert(pos, s.unicode(), sz);
709  return QStringRef(&tagStackStringStorage, pos, sz);
710  }
int size() const
Returns the number of characters referred to by the string reference.
Definition: qstring.h:1114
int size() const
Returns the number of characters in this string.
Definition: qstring.h:102
const QChar * unicode() const
Returns a Unicode representation of the string reference.
Definition: qstring.h:1153
The QStringRef class provides a thin wrapper around QString substrings.
Definition: qstring.h:1099
void resize(int size)
Sets the size of the string to size characters.
Definition: qstring.cpp:1353
QString & insert(int i, QChar c)
Definition: qstring.cpp:1671

◆ addToStringStorage() [2/2]

QStringRef QXmlStreamPrivateTagStack::addToStringStorage ( const QString s)
inline

Definition at line 711 of file qxmlstream_p.h.

711  {
712  int pos = tagStackStringStorageSize;
713  int sz = s.size();
714  if (pos != tagStackStringStorage.size())
716  tagStackStringStorage.insert(pos, s.unicode(), sz);
718  return QStringRef(&tagStackStringStorage, pos, sz);
719  }
int size() const
Returns the number of characters in this string.
Definition: qstring.h:102
const QChar * unicode() const
Returns a &#39;\0&#39;-terminated Unicode representation of the string.
Definition: qstring.h:706
The QStringRef class provides a thin wrapper around QString substrings.
Definition: qstring.h:1099
void resize(int size)
Sets the size of the string to size characters.
Definition: qstring.cpp:1353
QString & insert(int i, QChar c)
Definition: qstring.cpp:1671

◆ tagStack_pop()

Tag& QXmlStreamPrivateTagStack::tagStack_pop ( )
inline

Definition at line 724 of file qxmlstream_p.h.

Referenced by QXmlStreamWriterPrivate::finishStartElement().

724  {
725  Tag& tag = tagStack.pop();
726  tagStackStringStorageSize = tag.tagStackStringStorageSize;
727  namespaceDeclarations.resize(tag.namespaceDeclarationsSize);
728  tagsDone = tagStack.isEmpty();
729  return tag;
730  }
Tag
Definition: qtranslator.cpp:86
QXmlStreamSimpleStack< NamespaceDeclaration > namespaceDeclarations
Definition: qxmlstream_p.h:697
QXmlStreamSimpleStack< Tag > tagStack
Definition: qxmlstream_p.h:721

◆ tagStack_push()

Tag& QXmlStreamPrivateTagStack::tagStack_push ( )
inline

Definition at line 731 of file qxmlstream_p.h.

731  {
732  Tag &tag = tagStack.push();
733  tag.tagStackStringStorageSize = tagStackStringStorageSize;
734  tag.namespaceDeclarationsSize = namespaceDeclarations.size();
735  return tag;
736  }
Tag
Definition: qtranslator.cpp:86
QXmlStreamSimpleStack< NamespaceDeclaration > namespaceDeclarations
Definition: qxmlstream_p.h:697
QXmlStreamSimpleStack< Tag > tagStack
Definition: qxmlstream_p.h:721

Properties

◆ namespaceDeclarations

QXmlStreamSimpleStack<NamespaceDeclaration> QXmlStreamPrivateTagStack::namespaceDeclarations

◆ tagsDone

bool QXmlStreamPrivateTagStack::tagsDone

Definition at line 700 of file qxmlstream_p.h.

Referenced by QXmlStreamReaderPrivate::init().

◆ tagStack

QXmlStreamSimpleStack<Tag> QXmlStreamPrivateTagStack::tagStack

◆ tagStackStringStorage

QString QXmlStreamPrivateTagStack::tagStackStringStorage

Definition at line 698 of file qxmlstream_p.h.

◆ tagStackStringStorageSize

int QXmlStreamPrivateTagStack::tagStackStringStorageSize

Definition at line 699 of file qxmlstream_p.h.


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