Qt 4.8
Public Functions | Public Variables | List of all members
QDomDocumentPrivate Class Reference
Inheritance diagram for QDomDocumentPrivate:
QDomNodePrivate

Public Functions

void clear ()
 
QDomNodePrivatecloneNode (bool deep=true)
 
QDomAttrPrivatecreateAttribute (const QString &name)
 
QDomAttrPrivatecreateAttributeNS (const QString &nsURI, const QString &qName)
 
QDomCDATASectionPrivatecreateCDATASection (const QString &data)
 
QDomCommentPrivatecreateComment (const QString &data)
 
QDomDocumentFragmentPrivatecreateDocumentFragment ()
 
QDomElementPrivatecreateElement (const QString &tagName)
 
QDomElementPrivatecreateElementNS (const QString &nsURI, const QString &qName)
 
QDomEntityReferencePrivatecreateEntityReference (const QString &name)
 
QDomProcessingInstructionPrivatecreateProcessingInstruction (const QString &target, const QString &data)
 
QDomTextPrivatecreateTextNode (const QString &data)
 
QDomDocumentTypePrivatedoctype ()
 
QDomElementPrivatedocumentElement ()
 
QDomImplementationPrivateimplementation ()
 
QDomNodePrivateimportNode (const QDomNodePrivate *importedNode, bool deep)
 
bool isDocument () const
 
QDomNode::NodeType nodeType () const
 
 QDomDocumentPrivate ()
 
 QDomDocumentPrivate (const QString &name)
 
 QDomDocumentPrivate (QDomDocumentTypePrivate *dt)
 
 QDomDocumentPrivate (QDomDocumentPrivate *n, bool deep)
 
void saveDocument (QTextStream &stream, const int indent, QDomNode::EncodingPolicy encUsed) const
 
bool setContent (QXmlInputSource *source, bool namespaceProcessing, QString *errorMsg, int *errorLine, int *errorColumn)
 
bool setContent (QXmlInputSource *source, QXmlReader *reader, QString *errorMsg, int *errorLine, int *errorColumn)
 
 ~QDomDocumentPrivate ()
 
- Public Functions inherited from QDomNodePrivate
virtual QDomNodePrivateappendChild (QDomNodePrivate *newChild)
 
virtual QDomNodePrivateinsertAfter (QDomNodePrivate *newChild, QDomNodePrivate *refChild)
 
virtual QDomNodePrivateinsertBefore (QDomNodePrivate *newChild, QDomNodePrivate *refChild)
 
virtual bool isAttr () const
 
virtual bool isCDATASection () const
 
virtual bool isCharacterData () const
 
virtual bool isComment () const
 
virtual bool isDocumentFragment () const
 
virtual bool isDocumentType () const
 
virtual bool isElement () const
 
virtual bool isEntity () const
 
virtual bool isEntityReference () const
 
virtual bool isNotation () const
 
virtual bool isProcessingInstruction () const
 
virtual bool isText () const
 
QDomNodePrivatenamedItem (const QString &name)
 
QString nodeName () const
 
QString nodeValue () const
 
virtual void normalize ()
 
QDomDocumentPrivateownerDocument ()
 
QDomNodePrivateparent () const
 
 QDomNodePrivate (QDomDocumentPrivate *, QDomNodePrivate *parent=0)
 
 QDomNodePrivate (QDomNodePrivate *n, bool deep)
 
virtual QDomNodePrivateremoveChild (QDomNodePrivate *oldChild)
 
virtual QDomNodePrivatereplaceChild (QDomNodePrivate *newChild, QDomNodePrivate *oldChild)
 
virtual void save (QTextStream &, int, int) const
 
void setLocation (int lineNumber, int columnNumber)
 
virtual void setNodeValue (const QString &v)
 
void setNoParent ()
 
void setOwnerDocument (QDomDocumentPrivate *doc)
 
void setParent (QDomNodePrivate *p)
 
virtual ~QDomNodePrivate ()
 

Public Variables

QExplicitlySharedDataPointer< QDomImplementationPrivateimpl
 
long nodeListTime
 
QExplicitlySharedDataPointer< QDomDocumentTypePrivatetype
 
- Public Variables inherited from QDomNodePrivate
int columnNumber
 
bool createdWithDom1Interface: 1
 
QDomNodePrivatefirst
 
bool hasParent: 1
 
QDomNodePrivatelast
 
int lineNumber
 
QString name
 
QString namespaceURI
 
QDomNodePrivatenext
 
QDomNodePrivateownerNode
 
QString prefix
 
QDomNodePrivateprev
 
QAtomicInt ref
 
QString value
 

Detailed Description

Definition at line 504 of file qdom.cpp.

Constructors and Destructors

◆ QDomDocumentPrivate() [1/4]

QDomDocumentPrivate::QDomDocumentPrivate ( )

Definition at line 6302 of file qdom.cpp.

6303  : QDomNodePrivate(0),
6305  nodeListTime(1)
6306 {
6307  type = new QDomDocumentTypePrivate(this, this);
6308  type->ref.deref();
6309 
6310  name = QLatin1String("#document");
6311 }
QString name
Definition: qdom.cpp:198
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
QAtomicInt ref
Definition: qdom.cpp:191
QDomNodePrivate(QDomDocumentPrivate *, QDomNodePrivate *parent=0)
Definition: qdom.cpp:1482
bool deref()
Atomically decrements the value of this QAtomicInt.
QExplicitlySharedDataPointer< QDomDocumentTypePrivate > type
Definition: qdom.cpp:543
QExplicitlySharedDataPointer< QDomImplementationPrivate > impl
Definition: qdom.cpp:542

◆ QDomDocumentPrivate() [2/4]

QDomDocumentPrivate::QDomDocumentPrivate ( const QString name)

Definition at line 6313 of file qdom.cpp.

6314  : QDomNodePrivate(0),
6316  nodeListTime(1)
6317 {
6318  type = new QDomDocumentTypePrivate(this, this);
6319  type->ref.deref();
6320  type->name = aname;
6321 
6322  name = QLatin1String("#document");
6323 }
QString name
Definition: qdom.cpp:198
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
QAtomicInt ref
Definition: qdom.cpp:191
QDomNodePrivate(QDomDocumentPrivate *, QDomNodePrivate *parent=0)
Definition: qdom.cpp:1482
bool deref()
Atomically decrements the value of this QAtomicInt.
QExplicitlySharedDataPointer< QDomDocumentTypePrivate > type
Definition: qdom.cpp:543
QExplicitlySharedDataPointer< QDomImplementationPrivate > impl
Definition: qdom.cpp:542

◆ QDomDocumentPrivate() [3/4]

QDomDocumentPrivate::QDomDocumentPrivate ( QDomDocumentTypePrivate dt)

Definition at line 6325 of file qdom.cpp.

6326  : QDomNodePrivate(0),
6328  nodeListTime(1)
6329 {
6330  if (dt != 0) {
6331  type = dt;
6332  } else {
6333  type = new QDomDocumentTypePrivate(this, this);
6334  type->ref.deref();
6335  }
6336 
6337  name = QLatin1String("#document");
6338 }
QString name
Definition: qdom.cpp:198
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
QAtomicInt ref
Definition: qdom.cpp:191
QDomNodePrivate(QDomDocumentPrivate *, QDomNodePrivate *parent=0)
Definition: qdom.cpp:1482
bool deref()
Atomically decrements the value of this QAtomicInt.
QExplicitlySharedDataPointer< QDomDocumentTypePrivate > type
Definition: qdom.cpp:543
QExplicitlySharedDataPointer< QDomImplementationPrivate > impl
Definition: qdom.cpp:542

◆ QDomDocumentPrivate() [4/4]

QDomDocumentPrivate::QDomDocumentPrivate ( QDomDocumentPrivate n,
bool  deep 
)

Definition at line 6340 of file qdom.cpp.

6341  : QDomNodePrivate(n, deep),
6342  impl(n->impl->clone()),
6343  nodeListTime(1)
6344 {
6345  type = static_cast<QDomDocumentTypePrivate*>(n->type->cloneNode());
6346  type->setParent(this);
6347 }
QDomNodePrivate(QDomDocumentPrivate *, QDomNodePrivate *parent=0)
Definition: qdom.cpp:1482
QExplicitlySharedDataPointer< QDomDocumentTypePrivate > type
Definition: qdom.cpp:543
QDomImplementationPrivate * clone()
Definition: qdom.cpp:872
void setParent(QDomNodePrivate *p)
Definition: qdom.cpp:162
QDomNodePrivate * cloneNode(bool deep=true)
Definition: qdom.cpp:3584
QExplicitlySharedDataPointer< QDomImplementationPrivate > impl
Definition: qdom.cpp:542

◆ ~QDomDocumentPrivate()

QDomDocumentPrivate::~QDomDocumentPrivate ( )

Definition at line 6349 of file qdom.cpp.

6350 {
6351 }

Functions

◆ clear()

void QDomDocumentPrivate::clear ( void  )
virtual

Reimplemented from QDomNodePrivate.

Definition at line 6353 of file qdom.cpp.

6354 {
6355  impl.reset();
6356  type.reset();
6358 }
QExplicitlySharedDataPointer< QDomDocumentTypePrivate > type
Definition: qdom.cpp:543
void reset()
Resets this to be null.
Definition: qshareddata.h:150
QExplicitlySharedDataPointer< QDomImplementationPrivate > impl
Definition: qdom.cpp:542
virtual void clear()
Definition: qdom.cpp:1539

◆ cloneNode()

QDomNodePrivate * QDomDocumentPrivate::cloneNode ( bool  deep = true)
virtual

Reimplemented from QDomNodePrivate.

Definition at line 6404 of file qdom.cpp.

6405 {
6406  QDomNodePrivate *p = new QDomDocumentPrivate(this, deep);
6407  // We are not interested in this node
6408  p->ref.deref();
6409  return p;
6410 }
QAtomicInt ref
Definition: qdom.cpp:191
bool deref()
Atomically decrements the value of this QAtomicInt.

◆ createAttribute()

QDomAttrPrivate * QDomDocumentPrivate::createAttribute ( const QString name)

Definition at line 6504 of file qdom.cpp.

6505 {
6506  bool ok;
6507  QString fixedName = fixedXmlName(aname, &ok);
6508  if (!ok)
6509  return 0;
6510 
6511  QDomAttrPrivate *a = new QDomAttrPrivate(this, 0, fixedName);
6512  a->ref.deref();
6513  return a;
6514 }
long ASN1_INTEGER_get ASN1_INTEGER * a
The QString class provides a Unicode character string.
Definition: qstring.h:83
QAtomicInt ref
Definition: qdom.cpp:191
bool deref()
Atomically decrements the value of this QAtomicInt.
static QString fixedXmlName(const QString &_name, bool *ok, bool namespaces=false)
Definition: qdom.cpp:645

◆ createAttributeNS()

QDomAttrPrivate * QDomDocumentPrivate::createAttributeNS ( const QString nsURI,
const QString qName 
)

Definition at line 6516 of file qdom.cpp.

6517 {
6518  bool ok;
6519  QString fixedName = fixedXmlName(qName, &ok, true);
6520  if (!ok)
6521  return 0;
6522 
6523  QDomAttrPrivate *a = new QDomAttrPrivate(this, 0, nsURI, fixedName);
6524  a->ref.deref();
6525  return a;
6526 }
long ASN1_INTEGER_get ASN1_INTEGER * a
The QString class provides a Unicode character string.
Definition: qstring.h:83
QAtomicInt ref
Definition: qdom.cpp:191
bool deref()
Atomically decrements the value of this QAtomicInt.
static QString fixedXmlName(const QString &_name, bool *ok, bool namespaces=false)
Definition: qdom.cpp:645

◆ createCDATASection()

QDomCDATASectionPrivate * QDomDocumentPrivate::createCDATASection ( const QString data)

Definition at line 6476 of file qdom.cpp.

Referenced by QDomHandler::characters().

6477 {
6478  bool ok;
6479  QString fixedData = fixedCDataSection(data, &ok);
6480  if (!ok)
6481  return 0;
6482 
6483  QDomCDATASectionPrivate *c = new QDomCDATASectionPrivate(this, 0, fixedData);
6484  c->ref.deref();
6485  return c;
6486 }
unsigned char c[8]
Definition: qnumeric_p.h:62
The QString class provides a Unicode character string.
Definition: qstring.h:83
static QString fixedCDataSection(const QString &data, bool *ok)
Definition: qdom.cpp:753
QAtomicInt ref
Definition: qdom.cpp:191
bool deref()
Atomically decrements the value of this QAtomicInt.

◆ createComment()

QDomCommentPrivate * QDomDocumentPrivate::createComment ( const QString data)

Definition at line 6464 of file qdom.cpp.

Referenced by QDomHandler::comment().

6465 {
6466  bool ok;
6467  QString fixedData = fixedComment(data, &ok);
6468  if (!ok)
6469  return 0;
6470 
6471  QDomCommentPrivate *c = new QDomCommentPrivate(this, 0, fixedData);
6472  c->ref.deref();
6473  return c;
6474 }
unsigned char c[8]
Definition: qnumeric_p.h:62
The QString class provides a Unicode character string.
Definition: qstring.h:83
QAtomicInt ref
Definition: qdom.cpp:191
bool deref()
Atomically decrements the value of this QAtomicInt.
static QString fixedComment(const QString &data, bool *ok)
Definition: qdom.cpp:724

◆ createDocumentFragment()

QDomDocumentFragmentPrivate * QDomDocumentPrivate::createDocumentFragment ( )

Definition at line 6445 of file qdom.cpp.

6446 {
6448  f->ref.deref();
6449  return f;
6450 }
QAtomicInt ref
Definition: qdom.cpp:191
bool deref()
Atomically decrements the value of this QAtomicInt.

◆ createElement()

QDomElementPrivate * QDomDocumentPrivate::createElement ( const QString tagName)

Definition at line 6421 of file qdom.cpp.

Referenced by QDomHandler::startElement().

6422 {
6423  bool ok;
6424  QString fixedName = fixedXmlName(tagName, &ok);
6425  if (!ok)
6426  return 0;
6427 
6428  QDomElementPrivate *e = new QDomElementPrivate(this, 0, fixedName);
6429  e->ref.deref();
6430  return e;
6431 }
The QString class provides a Unicode character string.
Definition: qstring.h:83
QAtomicInt ref
Definition: qdom.cpp:191
bool deref()
Atomically decrements the value of this QAtomicInt.
static QString fixedXmlName(const QString &_name, bool *ok, bool namespaces=false)
Definition: qdom.cpp:645

◆ createElementNS()

QDomElementPrivate * QDomDocumentPrivate::createElementNS ( const QString nsURI,
const QString qName 
)

Definition at line 6433 of file qdom.cpp.

Referenced by QDomHandler::startElement().

6434 {
6435  bool ok;
6436  QString fixedName = fixedXmlName(qName, &ok, true);
6437  if (!ok)
6438  return 0;
6439 
6440  QDomElementPrivate *e = new QDomElementPrivate(this, 0, nsURI, fixedName);
6441  e->ref.deref();
6442  return e;
6443 }
The QString class provides a Unicode character string.
Definition: qstring.h:83
QAtomicInt ref
Definition: qdom.cpp:191
bool deref()
Atomically decrements the value of this QAtomicInt.
static QString fixedXmlName(const QString &_name, bool *ok, bool namespaces=false)
Definition: qdom.cpp:645

◆ createEntityReference()

QDomEntityReferencePrivate * QDomDocumentPrivate::createEntityReference ( const QString name)

Definition at line 6528 of file qdom.cpp.

Referenced by QDomHandler::characters(), and QDomHandler::skippedEntity().

6529 {
6530  bool ok;
6531  QString fixedName = fixedXmlName(aname, &ok);
6532  if (!ok)
6533  return 0;
6534 
6535  QDomEntityReferencePrivate *e = new QDomEntityReferencePrivate(this, 0, fixedName);
6536  e->ref.deref();
6537  return e;
6538 }
The QString class provides a Unicode character string.
Definition: qstring.h:83
QAtomicInt ref
Definition: qdom.cpp:191
bool deref()
Atomically decrements the value of this QAtomicInt.
static QString fixedXmlName(const QString &_name, bool *ok, bool namespaces=false)
Definition: qdom.cpp:645

◆ createProcessingInstruction()

QDomProcessingInstructionPrivate * QDomDocumentPrivate::createProcessingInstruction ( const QString target,
const QString data 
)

Definition at line 6488 of file qdom.cpp.

Referenced by QDomHandler::processingInstruction().

6490 {
6491  bool ok;
6492  QString fixedData = fixedPIData(data, &ok);
6493  if (!ok)
6494  return 0;
6495  // [17] PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))
6496  QString fixedTarget = fixedXmlName(target, &ok);
6497  if (!ok)
6498  return 0;
6499 
6500  QDomProcessingInstructionPrivate *p = new QDomProcessingInstructionPrivate(this, 0, fixedTarget, fixedData);
6501  p->ref.deref();
6502  return p;
6503 }
The QString class provides a Unicode character string.
Definition: qstring.h:83
QAtomicInt ref
Definition: qdom.cpp:191
static QString fixedPIData(const QString &data, bool *ok)
Definition: qdom.cpp:781
bool deref()
Atomically decrements the value of this QAtomicInt.
static QString fixedXmlName(const QString &_name, bool *ok, bool namespaces=false)
Definition: qdom.cpp:645

◆ createTextNode()

QDomTextPrivate * QDomDocumentPrivate::createTextNode ( const QString data)

Definition at line 6452 of file qdom.cpp.

Referenced by QDomHandler::characters().

6453 {
6454  bool ok;
6455  QString fixedData = fixedCharData(data, &ok);
6456  if (!ok)
6457  return 0;
6458 
6459  QDomTextPrivate *t = new QDomTextPrivate(this, 0, fixedData);
6460  t->ref.deref();
6461  return t;
6462 }
static QString fixedCharData(const QString &data, bool *ok)
Definition: qdom.cpp:699
The QString class provides a Unicode character string.
Definition: qstring.h:83
QAtomicInt ref
Definition: qdom.cpp:191
bool deref()
Atomically decrements the value of this QAtomicInt.

◆ doctype()

QDomDocumentTypePrivate* QDomDocumentPrivate::doctype ( )
inline

Definition at line 517 of file qdom.cpp.

Referenced by QDomHandler::characters(), QDomHandler::notationDecl(), QDomHandler::startDTD(), and QDomHandler::unparsedEntityDecl().

517 { return type.data(); }
T * data() const
Returns a pointer to the shared data object.
Definition: qshareddata.h:145
QExplicitlySharedDataPointer< QDomDocumentTypePrivate > type
Definition: qdom.cpp:543

◆ documentElement()

QDomElementPrivate * QDomDocumentPrivate::documentElement ( )

Definition at line 6412 of file qdom.cpp.

6413 {
6414  QDomNodePrivate *p = first;
6415  while (p && !p->isElement())
6416  p = p->next;
6417 
6418  return static_cast<QDomElementPrivate *>(p);
6419 }
virtual bool isElement() const
Definition: qdom.cpp:175
QDomNodePrivate * next
Definition: qdom.cpp:193
QDomNodePrivate * first
Definition: qdom.cpp:195

◆ implementation()

QDomImplementationPrivate* QDomDocumentPrivate::implementation ( )
inline

Definition at line 518 of file qdom.cpp.

518 { return impl.data(); }
T * data() const
Returns a pointer to the shared data object.
Definition: qshareddata.h:145
QExplicitlySharedDataPointer< QDomImplementationPrivate > impl
Definition: qdom.cpp:542

◆ importNode()

QDomNodePrivate * QDomDocumentPrivate::importNode ( const QDomNodePrivate importedNode,
bool  deep 
)

Definition at line 6540 of file qdom.cpp.

6541 {
6542  QDomNodePrivate *node = 0;
6543  switch (importedNode->nodeType()) {
6545  node = new QDomAttrPrivate((QDomAttrPrivate*)importedNode, true);
6546  break;
6548  node = new QDomDocumentFragmentPrivate((QDomDocumentFragmentPrivate*)importedNode, deep);
6549  break;
6550  case QDomNode::ElementNode:
6551  node = new QDomElementPrivate((QDomElementPrivate*)importedNode, deep);
6552  break;
6553  case QDomNode::EntityNode:
6554  node = new QDomEntityPrivate((QDomEntityPrivate*)importedNode, deep);
6555  break;
6557  node = new QDomEntityReferencePrivate((QDomEntityReferencePrivate*)importedNode, false);
6558  break;
6560  node = new QDomNotationPrivate((QDomNotationPrivate*)importedNode, deep);
6561  break;
6563  node = new QDomProcessingInstructionPrivate((QDomProcessingInstructionPrivate*)importedNode, deep);
6564  break;
6565  case QDomNode::TextNode:
6566  node = new QDomTextPrivate((QDomTextPrivate*)importedNode, deep);
6567  break;
6569  node = new QDomCDATASectionPrivate((QDomCDATASectionPrivate*)importedNode, deep);
6570  break;
6571  case QDomNode::CommentNode:
6572  node = new QDomCommentPrivate((QDomCommentPrivate*)importedNode, deep);
6573  break;
6574  default:
6575  break;
6576  }
6577  if (node) {
6578  node->setOwnerDocument(this);
6579  // The QDomNode constructor increases the refcount, so deref first to
6580  // keep refcount balanced.
6581  node->ref.deref();
6582  }
6583  return node;
6584 }
virtual QDomNode::NodeType nodeType() const
Definition: qdom.cpp:184
QAtomicInt ref
Definition: qdom.cpp:191
bool deref()
Atomically decrements the value of this QAtomicInt.
void setOwnerDocument(QDomDocumentPrivate *doc)
Definition: qdom.cpp:1476

◆ isDocument()

bool QDomDocumentPrivate::isDocument ( ) const
inlinevirtual

Reimplemented from QDomNodePrivate.

Definition at line 537 of file qdom.cpp.

537 { return true; }

◆ nodeType()

QDomNode::NodeType QDomDocumentPrivate::nodeType ( ) const
inlinevirtual

Reimplemented from QDomNodePrivate.

Definition at line 538 of file qdom.cpp.

◆ saveDocument()

void QDomDocumentPrivate::saveDocument ( QTextStream stream,
const int  indent,
QDomNode::EncodingPolicy  encUsed 
) const

Definition at line 6586 of file qdom.cpp.

6587 {
6588  const QDomNodePrivate* n = first;
6589 
6590  if(encUsed == QDomNode::EncodingFromDocument) {
6591 #ifndef QT_NO_TEXTCODEC
6592  const QDomNodePrivate* n = first;
6593 
6594  QTextCodec *codec = 0;
6595 
6596  if (n && n->isProcessingInstruction() && n->nodeName() == QLatin1String("xml")) {
6597  // we have an XML declaration
6598  QString data = n->nodeValue();
6599  QRegExp encoding(QString::fromLatin1("encoding\\s*=\\s*((\"([^\"]*)\")|('([^']*)'))"));
6600  encoding.indexIn(data);
6601  QString enc = encoding.cap(3);
6602  if (enc.isEmpty())
6603  enc = encoding.cap(5);
6604  if (!enc.isEmpty())
6605  codec = QTextCodec::codecForName(enc.toLatin1().data());
6606  }
6607  if (!codec)
6608  codec = QTextCodec::codecForName("UTF-8");
6609  if (codec)
6610  s.setCodec(codec);
6611 #endif
6612  bool doc = false;
6613 
6614  while (n) {
6615  if (!doc && !(n->isProcessingInstruction() && n->nodeName() == QLatin1String("xml"))) {
6616  // save doctype after XML declaration
6617  type->save(s, 0, indent);
6618  doc = true;
6619  }
6620  n->save(s, 0, indent);
6621  n = n->next;
6622  }
6623  }
6624  else {
6625 
6626  // Write out the XML declaration.
6627 #ifdef QT_NO_TEXTCODEC
6628  const QLatin1String codecName("iso-8859-1");
6629 #else
6630  const QTextCodec *const codec = s.codec();
6631  Q_ASSERT_X(codec, "QDomNode::save()", "A codec must be specified in the text stream.");
6632  const QByteArray codecName = codec->name();
6633 #endif
6634 
6635  s << "<?xml version=\"1.0\" encoding=\""
6636  << codecName
6637  << "\"?>\n";
6638 
6639  // Skip the first processing instruction by name "xml", if any such exists.
6640  const QDomNodePrivate* startNode = n;
6641 
6642  // First, we try to find the PI and sets the startNode to the one appearing after it.
6643  while (n) {
6644  if(n->isProcessingInstruction() && n->nodeName() == QLatin1String("xml")) {
6645  startNode = n->next;
6646  break;
6647  }
6648  else
6649  n = n->next;
6650  }
6651 
6652  // Now we serialize all the nodes after the faked XML declaration(the PI).
6653  while(startNode) {
6654  startNode->save(s, 0, indent);
6655  startNode = startNode->next;
6656  }
6657  }
6658 }
char * data()
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:429
The QRegExp class provides pattern matching using regular expressions.
Definition: qregexp.h:61
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
virtual void save(QTextStream &, int, int) const
Definition: qdom.cpp:1945
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
Definition: qstring.h:83
QString nodeValue() const
Definition: qdom.cpp:143
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
QExplicitlySharedDataPointer< QDomDocumentTypePrivate > type
Definition: qdom.cpp:543
static const char * data(const QByteArray &arr)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
static QTextCodec * codec(MYSQL *mysql)
Definition: qsql_mysql.cpp:220
QDomNodePrivate * next
Definition: qdom.cpp:193
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
Definition: qstring.cpp:3993
virtual QByteArray name() const =0
QTextCodec subclasses must reimplement this function.
#define Q_ASSERT_X(cond, where, what)
Definition: qglobal.h:1837
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
static QTextCodec * codecForName(const QByteArray &name)
Searches all installed QTextCodec objects and returns the one which best matches name; the match is c...
QDomNodePrivate * first
Definition: qdom.cpp:195
The QTextCodec class provides conversions between text encodings.
Definition: qtextcodec.h:62
virtual bool isProcessingInstruction() const
Definition: qdom.cpp:180
QString nodeName() const
Definition: qdom.cpp:142
void save(QTextStream &s, int, int) const
Definition: qdom.cpp:3664

◆ setContent() [1/2]

bool QDomDocumentPrivate::setContent ( QXmlInputSource source,
bool  namespaceProcessing,
QString errorMsg,
int *  errorLine,
int *  errorColumn 
)

Definition at line 6367 of file qdom.cpp.

6368 {
6369  QXmlSimpleReader reader;
6370  initializeReader(reader, namespaceProcessing);
6371  return setContent(source, &reader, errorMsg, errorLine, errorColumn);
6372 }
The QXmlSimpleReader class provides an implementation of a simple XML parser.
Definition: qxml.h:241
bool setContent(QXmlInputSource *source, bool namespaceProcessing, QString *errorMsg, int *errorLine, int *errorColumn)
Definition: qdom.cpp:6367
static void initializeReader(QXmlSimpleReader &reader, bool namespaceProcessing)
Definition: qdom.cpp:6360

◆ setContent() [2/2]

bool QDomDocumentPrivate::setContent ( QXmlInputSource source,
QXmlReader reader,
QString errorMsg,
int *  errorLine,
int *  errorColumn 
)

Definition at line 6374 of file qdom.cpp.

6375 {
6376  clear();
6378  type = new QDomDocumentTypePrivate(this, this);
6379  type->ref.deref();
6380 
6381  bool namespaceProcessing = reader->feature(QLatin1String("http://xml.org/sax/features/namespaces"))
6382  && !reader->feature(QLatin1String("http://xml.org/sax/features/namespace-prefixes"));
6383 
6384  QDomHandler hnd(this, namespaceProcessing);
6385  reader->setContentHandler(&hnd);
6386  reader->setErrorHandler(&hnd);
6387  reader->setLexicalHandler(&hnd);
6388  reader->setDeclHandler(&hnd);
6389  reader->setDTDHandler(&hnd);
6390 
6391  if (!reader->parse(source)) {
6392  if (errorMsg)
6393  *errorMsg = hnd.errorMsg;
6394  if (errorLine)
6395  *errorLine = hnd.errorLine;
6396  if (errorColumn)
6397  *errorColumn = hnd.errorColumn;
6398  return false;
6399  }
6400 
6401  return true;
6402 }
virtual void setContentHandler(QXmlContentHandler *handler)=0
Sets the content handler to handler.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
QAtomicInt ref
Definition: qdom.cpp:191
bool deref()
Atomically decrements the value of this QAtomicInt.
QExplicitlySharedDataPointer< QDomDocumentTypePrivate > type
Definition: qdom.cpp:543
virtual void setDTDHandler(QXmlDTDHandler *handler)=0
Sets the DTD handler to handler.
virtual void setDeclHandler(QXmlDeclHandler *handler)=0
Sets the declaration handler to handler.
virtual void setErrorHandler(QXmlErrorHandler *handler)=0
Sets the error handler to handler.
virtual void setLexicalHandler(QXmlLexicalHandler *handler)=0
Sets the lexical handler to handler.
virtual bool parse(const QXmlInputSource &input)=0
Parses the given input.
virtual bool feature(const QString &name, bool *ok=0) const =0
If the reader has the feature called name, the feature&#39;s value is returned.
QExplicitlySharedDataPointer< QDomImplementationPrivate > impl
Definition: qdom.cpp:542

Properties

◆ impl

Definition at line 542 of file qdom.cpp.

◆ nodeListTime

long QDomDocumentPrivate::nodeListTime

◆ type

Definition at line 543 of file qdom.cpp.


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