QGIS/python/core/qgserror.sip

83 lines
2.2 KiB
Plaintext
Raw Normal View History

2013-04-08 18:25:44 +02:00
class QgsErrorMessage
{
%TypeHeaderCode
#include <qgserror.h>
%End
public:
2014-01-27 09:22:24 +01:00
/** Format */
2013-04-08 18:25:44 +02:00
enum Format
{
Text, // Plain text
Html
};
QgsErrorMessage();
2014-01-27 09:22:24 +01:00
/** Constructor.
* @param message error message string
* @param tag error label, for example GDAL, GDAL Provider, Raster layer
* @param file the file where error was created
* @param function the function where error was created
* @param line the line where error was created
2014-01-27 09:22:24 +01:00
*/
QgsErrorMessage( const QString &message, const QString &tag = QString::null, const QString &file = QString::null, const QString &function = QString::null, int line = 0 );
2013-04-08 18:25:44 +02:00
QString message() const;
QString tag() const;
QString file() const;
QString function() const;
int line() const;
};
2014-01-27 09:22:24 +01:00
/** \ingroup core
* QgsError is container for error messages (report). It may contain chain
* (sort of traceback) of error messages (e.g. GDAL - provider - layer).
* Higher level messages are appended at the end.
*/
2013-04-08 18:25:44 +02:00
class QgsError
{
%TypeHeaderCode
#include <qgserror.h>
%End
public:
QgsError();
2014-01-27 09:22:24 +01:00
/** Constructor with single message.
* @param message error message
* @param tag short description, e.g. GDAL, Provider, Layer
2014-01-27 09:22:24 +01:00
*/
QgsError( const QString &message, const QString &tag );
2013-04-08 18:25:44 +02:00
2014-01-27 09:22:24 +01:00
/** Append new error message.
* @param message error message string
* @param tag error label, for example GDAL, GDAL Provider, Raster layer
2014-01-27 09:22:24 +01:00
*/
void append( const QString &message, const QString &tag );
2013-04-08 18:25:44 +02:00
2014-01-27 09:22:24 +01:00
/** Append new error message.
* @param message error message
2014-01-27 09:22:24 +01:00
*/
void append( const QgsErrorMessage &message );
2013-04-08 18:25:44 +02:00
2014-01-27 09:22:24 +01:00
/** Test if any error is set.
* @return true if contains error
*/
2013-04-08 18:25:44 +02:00
bool isEmpty() const;
2014-01-27 09:22:24 +01:00
/** Full error messages description
* @param format output format
2014-01-27 09:22:24 +01:00
* @return error report
*/
QString message( QgsErrorMessage::Format format = QgsErrorMessage::Html ) const;
2013-04-08 18:25:44 +02:00
/** Short error description, usually the first error in chain, the real error.
2014-01-27 09:22:24 +01:00
* @return error description
*/
2013-04-08 18:25:44 +02:00
QString summary() const;
2014-01-27 09:22:24 +01:00
/** Clear error messages */
2013-04-08 18:25:44 +02:00
void clear();
};