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

Public Functions

QDomNodePrivateappendChild (QDomNodePrivate *newChild)
 
QDomNodePrivatecloneNode (bool deep=true)
 
void init ()
 
QDomNodePrivateinsertAfter (QDomNodePrivate *newChild, QDomNodePrivate *refChild)
 
QDomNodePrivateinsertBefore (QDomNodePrivate *newChild, QDomNodePrivate *refChild)
 
virtual bool isDocumentType () const
 
QDomNode::NodeType nodeType () const
 
 QDomDocumentTypePrivate (QDomDocumentPrivate *, QDomNodePrivate *parent=0)
 
 QDomDocumentTypePrivate (QDomDocumentTypePrivate *n, bool deep)
 
QDomNodePrivateremoveChild (QDomNodePrivate *oldChild)
 
QDomNodePrivatereplaceChild (QDomNodePrivate *newChild, QDomNodePrivate *oldChild)
 
void save (QTextStream &s, int, int) const
 
 ~QDomDocumentTypePrivate ()
 
- Public Functions inherited from QDomNodePrivate
virtual void clear ()
 
virtual bool isAttr () const
 
virtual bool isCDATASection () const
 
virtual bool isCharacterData () const
 
virtual bool isComment () const
 
virtual bool isDocument () const
 
virtual bool isDocumentFragment () 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)
 
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

QDomNamedNodeMapPrivateentities
 
QString internalSubset
 
QDomNamedNodeMapPrivatenotations
 
QString publicId
 
QString systemId
 
- 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 283 of file qdom.cpp.

Constructors and Destructors

◆ QDomDocumentTypePrivate() [1/2]

QDomDocumentTypePrivate::QDomDocumentTypePrivate ( QDomDocumentPrivate doc,
QDomNodePrivate parent = 0 
)

Definition at line 3536 of file qdom.cpp.

Referenced by cloneNode().

3537  : QDomNodePrivate(doc, parent)
3538 {
3539  init();
3540 }
QDomNodePrivate(QDomDocumentPrivate *, QDomNodePrivate *parent=0)
Definition: qdom.cpp:1482

◆ QDomDocumentTypePrivate() [2/2]

QDomDocumentTypePrivate::QDomDocumentTypePrivate ( QDomDocumentTypePrivate n,
bool  deep 
)

Definition at line 3542 of file qdom.cpp.

3543  : QDomNodePrivate(n, deep)
3544 {
3545  init();
3546  // Refill the maps with our new children
3547  QDomNodePrivate* p = first;
3548  while (p) {
3549  if (p->isEntity())
3550  // Don't use normal insert function since we would create infinite recursion
3551  entities->map.insertMulti(p->nodeName(), p);
3552  if (p->isNotation())
3553  // Don't use normal insert function since we would create infinite recursion
3554  notations->map.insertMulti(p->nodeName(), p);
3555  p = p->next;
3556  }
3557 }
QHash< QString, QDomNodePrivate * > map
Definition: qdom.cpp:277
virtual bool isNotation() const
Definition: qdom.cpp:179
QDomNamedNodeMapPrivate * entities
Definition: qdom.cpp:305
QDomNodePrivate(QDomDocumentPrivate *, QDomNodePrivate *parent=0)
Definition: qdom.cpp:1482
virtual bool isEntity() const
Definition: qdom.cpp:178
QDomNodePrivate * next
Definition: qdom.cpp:193
QDomNodePrivate * first
Definition: qdom.cpp:195
iterator insertMulti(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
Definition: qhash.h:772
QString nodeName() const
Definition: qdom.cpp:142
QDomNamedNodeMapPrivate * notations
Definition: qdom.cpp:306

◆ ~QDomDocumentTypePrivate()

QDomDocumentTypePrivate::~QDomDocumentTypePrivate ( )

Definition at line 3559 of file qdom.cpp.

3560 {
3561  if (!entities->ref.deref())
3562  delete entities;
3563  if (!notations->ref.deref())
3564  delete notations;
3565 }
QDomNamedNodeMapPrivate * entities
Definition: qdom.cpp:305
bool deref()
Atomically decrements the value of this QAtomicInt.
QDomNamedNodeMapPrivate * notations
Definition: qdom.cpp:306

Functions

◆ appendChild()

QDomNodePrivate * QDomDocumentTypePrivate::appendChild ( QDomNodePrivate newChild)
virtual

Reimplemented from QDomNodePrivate.

Definition at line 3651 of file qdom.cpp.

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

3652 {
3653  return insertAfter(newChild, 0);
3654 }
QDomNodePrivate * insertAfter(QDomNodePrivate *newChild, QDomNodePrivate *refChild)
Definition: qdom.cpp:3605

◆ cloneNode()

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

Reimplemented from QDomNodePrivate.

Definition at line 3584 of file qdom.cpp.

3585 {
3586  QDomNodePrivate* p = new QDomDocumentTypePrivate(this, deep);
3587  // We are not interested in this node
3588  p->ref.deref();
3589  return p;
3590 }
QAtomicInt ref
Definition: qdom.cpp:191
bool deref()
Atomically decrements the value of this QAtomicInt.
QDomDocumentTypePrivate(QDomDocumentPrivate *, QDomNodePrivate *parent=0)
Definition: qdom.cpp:3536

◆ init()

void QDomDocumentTypePrivate::init ( )

Definition at line 3567 of file qdom.cpp.

Referenced by QDomDocumentTypePrivate().

3568 {
3569  entities = new QDomNamedNodeMapPrivate(this);
3570  QT_TRY {
3571  notations = new QDomNamedNodeMapPrivate(this);
3572  publicId.clear();
3573  systemId.clear();
3575 
3576  entities->setAppendToParent(true);
3578  } QT_CATCH(...) {
3579  delete entities;
3580  QT_RETHROW;
3581  }
3582 }
QString internalSubset
Definition: qdom.cpp:309
QDomNamedNodeMapPrivate * entities
Definition: qdom.cpp:305
#define QT_RETHROW
Definition: qglobal.h:1539
#define QT_CATCH(A)
Definition: qglobal.h:1537
void clear()
Clears the contents of the string and makes it empty.
Definition: qstring.h:723
void setAppendToParent(bool b)
Definition: qdom.cpp:267
QDomNamedNodeMapPrivate * notations
Definition: qdom.cpp:306
#define QT_TRY
Definition: qglobal.h:1536

◆ insertAfter()

QDomNodePrivate * QDomDocumentTypePrivate::insertAfter ( QDomNodePrivate newChild,
QDomNodePrivate refChild 
)
virtual

Reimplemented from QDomNodePrivate.

Definition at line 3605 of file qdom.cpp.

Referenced by appendChild().

3606 {
3607  // Call the origianl implementation
3608  QDomNodePrivate* p = QDomNodePrivate::insertAfter(newChild, refChild);
3609  // Update the maps
3610  if (p && p->isEntity())
3611  entities->map.insertMulti(p->nodeName(), p);
3612  else if (p && p->isNotation())
3613  notations->map.insertMulti(p->nodeName(), p);
3614 
3615  return p;
3616 }
virtual QDomNodePrivate * insertAfter(QDomNodePrivate *newChild, QDomNodePrivate *refChild)
Definition: qdom.cpp:1661
QHash< QString, QDomNodePrivate * > map
Definition: qdom.cpp:277
virtual bool isNotation() const
Definition: qdom.cpp:179
QDomNamedNodeMapPrivate * entities
Definition: qdom.cpp:305
virtual bool isEntity() const
Definition: qdom.cpp:178
iterator insertMulti(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
Definition: qhash.h:772
QString nodeName() const
Definition: qdom.cpp:142
QDomNamedNodeMapPrivate * notations
Definition: qdom.cpp:306

◆ insertBefore()

QDomNodePrivate * QDomDocumentTypePrivate::insertBefore ( QDomNodePrivate newChild,
QDomNodePrivate refChild 
)
virtual

Reimplemented from QDomNodePrivate.

Definition at line 3592 of file qdom.cpp.

3593 {
3594  // Call the origianl implementation
3595  QDomNodePrivate* p = QDomNodePrivate::insertBefore(newChild, refChild);
3596  // Update the maps
3597  if (p && p->isEntity())
3598  entities->map.insertMulti(p->nodeName(), p);
3599  else if (p && p->isNotation())
3600  notations->map.insertMulti(p->nodeName(), p);
3601 
3602  return p;
3603 }
QHash< QString, QDomNodePrivate * > map
Definition: qdom.cpp:277
virtual bool isNotation() const
Definition: qdom.cpp:179
QDomNamedNodeMapPrivate * entities
Definition: qdom.cpp:305
virtual bool isEntity() const
Definition: qdom.cpp:178
virtual QDomNodePrivate * insertBefore(QDomNodePrivate *newChild, QDomNodePrivate *refChild)
Definition: qdom.cpp:1566
iterator insertMulti(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
Definition: qhash.h:772
QString nodeName() const
Definition: qdom.cpp:142
QDomNamedNodeMapPrivate * notations
Definition: qdom.cpp:306

◆ isDocumentType()

virtual bool QDomDocumentTypePrivate::isDocumentType ( ) const
inlinevirtual

Reimplemented from QDomNodePrivate.

Definition at line 299 of file qdom.cpp.

299 { return true; }

◆ nodeType()

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

Reimplemented from QDomNodePrivate.

Definition at line 300 of file qdom.cpp.

◆ removeChild()

QDomNodePrivate * QDomDocumentTypePrivate::removeChild ( QDomNodePrivate oldChild)
virtual

Reimplemented from QDomNodePrivate.

Definition at line 3638 of file qdom.cpp.

3639 {
3640  // Call the origianl implementation
3642  // Update the maps
3643  if (p && p->isEntity())
3644  entities->map.remove(p->nodeName());
3645  else if (p && p->isNotation())
3646  notations->map.remove(p ->nodeName());
3647 
3648  return p;
3649 }
int remove(const Key &key)
Removes all the items that have the key from the hash.
Definition: qhash.h:784
QHash< QString, QDomNodePrivate * > map
Definition: qdom.cpp:277
virtual bool isNotation() const
Definition: qdom.cpp:179
QDomNamedNodeMapPrivate * entities
Definition: qdom.cpp:305
virtual bool isEntity() const
Definition: qdom.cpp:178
virtual QDomNodePrivate * removeChild(QDomNodePrivate *oldChild)
Definition: qdom.cpp:1851
QString nodeName() const
Definition: qdom.cpp:142
QDomNamedNodeMapPrivate * notations
Definition: qdom.cpp:306

◆ replaceChild()

QDomNodePrivate * QDomDocumentTypePrivate::replaceChild ( QDomNodePrivate newChild,
QDomNodePrivate oldChild 
)
virtual

Reimplemented from QDomNodePrivate.

Definition at line 3618 of file qdom.cpp.

3619 {
3620  // Call the origianl implementation
3621  QDomNodePrivate* p = QDomNodePrivate::replaceChild(newChild, oldChild);
3622  // Update the maps
3623  if (p) {
3624  if (oldChild && oldChild->isEntity())
3625  entities->map.remove(oldChild->nodeName());
3626  else if (oldChild && oldChild->isNotation())
3627  notations->map.remove(oldChild->nodeName());
3628 
3629  if (p->isEntity())
3630  entities->map.insertMulti(p->nodeName(), p);
3631  else if (p->isNotation())
3632  notations->map.insertMulti(p->nodeName(), p);
3633  }
3634 
3635  return p;
3636 }
virtual QDomNodePrivate * replaceChild(QDomNodePrivate *newChild, QDomNodePrivate *oldChild)
Definition: qdom.cpp:1757
int remove(const Key &key)
Removes all the items that have the key from the hash.
Definition: qhash.h:784
QHash< QString, QDomNodePrivate * > map
Definition: qdom.cpp:277
virtual bool isNotation() const
Definition: qdom.cpp:179
QDomNamedNodeMapPrivate * entities
Definition: qdom.cpp:305
virtual bool isEntity() const
Definition: qdom.cpp:178
iterator insertMulti(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
Definition: qhash.h:772
QString nodeName() const
Definition: qdom.cpp:142
QDomNamedNodeMapPrivate * notations
Definition: qdom.cpp:306

◆ save()

void QDomDocumentTypePrivate::save ( QTextStream s,
int  depth,
int  indent 
) const
virtual
Warning
This function is not part of the public interface. depth is used for indentation, it seems.

Reimplemented from QDomNodePrivate.

Definition at line 3664 of file qdom.cpp.

3665 {
3666  if (name.isEmpty())
3667  return;
3668 
3669  s << "<!DOCTYPE " << name;
3670 
3671  if (!publicId.isNull()) {
3672  s << " PUBLIC " << quotedValue(publicId);
3673  if (!systemId.isNull()) {
3674  s << ' ' << quotedValue(systemId);
3675  }
3676  } else if (!systemId.isNull()) {
3677  s << " SYSTEM " << quotedValue(systemId);
3678  }
3679 
3680  if (entities->length()>0 || notations->length()>0) {
3681  s << " [" << endl;
3682 
3684  for (; it2 != notations->map.constEnd(); ++it2)
3685  (*it2)->save(s, 0, indent);
3686 
3688  for (; it != entities->map.constEnd(); ++it)
3689  (*it)->save(s, 0, indent);
3690 
3691  s << ']';
3692  }
3693 
3694  s << '>' << endl;
3695 }
The QHash::const_iterator class provides an STL-style const iterator for QHash and QMultiHash...
Definition: qhash.h:395
#define it(className, varName)
QHash< QString, QDomNodePrivate * > map
Definition: qdom.cpp:277
QString name
Definition: qdom.cpp:198
QDomNamedNodeMapPrivate * entities
Definition: qdom.cpp:305
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
static QString quotedValue(const QString &data)
Definition: qdom.cpp:3656
uint length() const
Definition: qdom.cpp:3228
bool isNull() const
Returns true if this string is null; otherwise returns false.
Definition: qstring.h:505
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the hash.
Definition: qhash.h:466
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the hash...
Definition: qhash.h:469
QDomNamedNodeMapPrivate * notations
Definition: qdom.cpp:306
Q_CORE_EXPORT QTextStream & endl(QTextStream &s)

Properties

◆ entities

QDomNamedNodeMapPrivate* QDomDocumentTypePrivate::entities

◆ internalSubset

QString QDomDocumentTypePrivate::internalSubset

Definition at line 309 of file qdom.cpp.

Referenced by init().

◆ notations

QDomNamedNodeMapPrivate* QDomDocumentTypePrivate::notations

◆ publicId

QString QDomDocumentTypePrivate::publicId

◆ systemId

QString QDomDocumentTypePrivate::systemId

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