Qt 4.8
Public Functions | Properties | List of all members
QXmlParseException Class Reference

The QXmlParseException class is used to report errors with the QXmlErrorHandler interface. More...

#include <qxml.h>

Public Functions

int columnNumber () const
 Returns the column number where the error occurred. More...
 
int lineNumber () const
 Returns the line number where the error occurred. More...
 
QString message () const
 Returns the error message. More...
 
QString publicId () const
 Returns the public identifier where the error occurred. More...
 
 QXmlParseException (const QString &name=QString(), int c=-1, int l=-1, const QString &p=QString(), const QString &s=QString())
 Constructs a parse exception with the error string name for column c and line l for the public identifier p and the system identifier s. More...
 
 QXmlParseException (const QXmlParseException &other)
 Creates a copy of other. More...
 
QString systemId () const
 Returns the system identifier where the error occurred. More...
 
 ~QXmlParseException ()
 Destroys the QXmlParseException. More...
 

Properties

QScopedPointer< QXmlParseExceptionPrivated
 

Detailed Description

The QXmlParseException class is used to report errors with the QXmlErrorHandler interface.

Note
This class or function is reentrant.
Attention
Module: QtXml

The XML subsystem constructs an instance of this class when it detects an error. You can retrieve the place where the error occurred using systemId(), publicId(), lineNumber() and columnNumber(), along with the error message(). The possible error messages are:

Note that, if you want to display these error messages to your application's users, they will be displayed in English unless they are explicitly translated.

See also
QXmlErrorHandler, QXmlReader

Definition at line 192 of file qxml.h.

Constructors and Destructors

◆ QXmlParseException() [1/2]

QXmlParseException::QXmlParseException ( const QString name = QString(),
int  c = -1,
int  l = -1,
const QString p = QString(),
const QString s = QString() 
)
explicit

Constructs a parse exception with the error string name for column c and line l for the public identifier p and the system identifier s.

Definition at line 572 of file qxml.cpp.

575 {
576  d->msg = name;
577  d->column = c;
578  d->line = l;
579  d->pub = p;
580  d->sys = s;
581 }
unsigned char c[8]
Definition: qnumeric_p.h:62
const char * name
QFactoryLoader * l
QScopedPointer< QXmlParseExceptionPrivate > d
Definition: qxml.h:207

◆ QXmlParseException() [2/2]

QXmlParseException::QXmlParseException ( const QXmlParseException other)

Creates a copy of other.

Definition at line 586 of file qxml.cpp.

586  :
587  d(new QXmlParseExceptionPrivate(*other.d))
588 {
589 
590 }
QScopedPointer< QXmlParseExceptionPrivate > d
Definition: qxml.h:207

◆ ~QXmlParseException()

QXmlParseException::~QXmlParseException ( )

Destroys the QXmlParseException.

Definition at line 595 of file qxml.cpp.

596 {
597 }

Functions

◆ columnNumber()

int QXmlParseException::columnNumber ( ) const

Returns the column number where the error occurred.

Definition at line 609 of file qxml.cpp.

Referenced by QDomHandler::fatalError().

610 {
611  return d->column;
612 }
QScopedPointer< QXmlParseExceptionPrivate > d
Definition: qxml.h:207

◆ lineNumber()

int QXmlParseException::lineNumber ( ) const

Returns the line number where the error occurred.

Definition at line 616 of file qxml.cpp.

Referenced by QDomHandler::fatalError().

617 {
618  return d->line;
619 }
QScopedPointer< QXmlParseExceptionPrivate > d
Definition: qxml.h:207

◆ message()

QString QXmlParseException::message ( ) const

Returns the error message.

Definition at line 602 of file qxml.cpp.

Referenced by QDomHandler::fatalError().

603 {
604  return d->msg;
605 }
QScopedPointer< QXmlParseExceptionPrivate > d
Definition: qxml.h:207

◆ publicId()

QString QXmlParseException::publicId ( ) const

Returns the public identifier where the error occurred.

Definition at line 623 of file qxml.cpp.

624 {
625  return d->pub;
626 }
QScopedPointer< QXmlParseExceptionPrivate > d
Definition: qxml.h:207

◆ systemId()

QString QXmlParseException::systemId ( ) const

Returns the system identifier where the error occurred.

Definition at line 630 of file qxml.cpp.

631 {
632  return d->sys;
633 }
QScopedPointer< QXmlParseExceptionPrivate > d
Definition: qxml.h:207

Properties

◆ d

QScopedPointer<QXmlParseExceptionPrivate> QXmlParseException::d
private

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