QGIS API Documentation
2.4.0-Chugiak
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
src
core
qgserror.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgserror.h - Error container
3
-------------------
4
begin : October 2012
5
copyright : (C) 2012 Radim Blazek
6
email : radim dot blazek at gmail dot com
7
***************************************************************************/
8
9
/***************************************************************************
10
* *
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
15
* *
16
***************************************************************************/
17
#ifndef QGSERROR_H
18
#define QGSERROR_H
19
20
#include <QString>
21
#include <QList>
22
23
// Macro to create Error message including info about where it was created.
24
#define QGS_ERROR_MESSAGE(message, tag) QgsErrorMessage(QString(message),QString(tag), QString(__FILE__), QString(__FUNCTION__), __LINE__)
25
29
class
CORE_EXPORT
QgsErrorMessage
30
{
31
public
:
33
enum
Format
34
{
35
Text
,
// Plain text
36
Html
37
};
38
39
QgsErrorMessage
() {}
40
48
QgsErrorMessage
(
const
QString & theMessage,
const
QString & theTag = QString::null,
const
QString & theFile = QString::null,
const
QString & theFunction = QString::null,
int
theLine = 0 );
49
50
QString
message
()
const
{
return
mMessage; }
51
QString
tag
()
const
{
return
mTag; }
52
QString
file
()
const
{
return
mFile; }
53
QString
function
()
const
{
return
mFunction; }
54
int
line
()
const
{
return
mLine; }
55
56
private
:
58
QString
mMessage
;
59
61
QString
mTag
;
62
64
QString
mFile
;
65
QString
mFunction
;
66
int
mLine
;
67
68
/* Message format */
69
Format
mFormat
;
70
};
71
77
class
CORE_EXPORT
QgsError
78
{
79
public
:
80
81
QgsError
() {}
82
87
QgsError
(
const
QString & theMessage,
const
QString & theTag );
88
93
void
append(
const
QString & theMessage,
const
QString & theTag );
94
98
void
append(
const
QgsErrorMessage
& theMessage );
99
103
bool
isEmpty
()
const
{
return
mMessageList.isEmpty(); }
104
109
QString message(
QgsErrorMessage::Format
theFormat =
QgsErrorMessage::Html
)
const
;
110
114
QString summary()
const
;
115
117
void
clear
() { mMessageList.clear(); }
118
119
private
:
121
QList<QgsErrorMessage>
mMessageList
;
122
};
123
124
#endif
QgsErrorMessage::mMessage
QString mMessage
Error messages.
Definition:
qgserror.h:58
QgsErrorMessage::mLine
int mLine
Definition:
qgserror.h:66
QgsErrorMessage::QgsErrorMessage
QgsErrorMessage()
Definition:
qgserror.h:39
QgsErrorMessage::mTag
QString mTag
Short description.
Definition:
qgserror.h:61
QgsErrorMessage::Format
Format
Format.
Definition:
qgserror.h:33
QgsErrorMessage::mFunction
QString mFunction
Definition:
qgserror.h:65
QgsErrorMessage
QgsErrorMessage represents single error message.
Definition:
qgserror.h:29
QgsErrorMessage::line
int line() const
Definition:
qgserror.h:54
QgsErrorMessage::tag
QString tag() const
Definition:
qgserror.h:51
QgsError::mMessageList
QList< QgsErrorMessage > mMessageList
List of messages.
Definition:
qgserror.h:121
QgsErrorMessage::Text
Definition:
qgserror.h:35
QgsErrorMessage::Html
Definition:
qgserror.h:36
QgsError::isEmpty
bool isEmpty() const
Test if any error is set.
Definition:
qgserror.h:103
QgsError
QgsError is container for error messages (report).
Definition:
qgserror.h:77
QgsError::QgsError
QgsError()
Definition:
qgserror.h:81
QgsErrorMessage::file
QString file() const
Definition:
qgserror.h:52
QgsErrorMessage::message
QString message() const
Definition:
qgserror.h:50
QgsErrorMessage::mFormat
Format mFormat
Definition:
qgserror.h:69
QgsError::clear
void clear()
Clear error messages.
Definition:
qgserror.h:117
QgsErrorMessage::mFile
QString mFile
Detailed debug info.
Definition:
qgserror.h:64
Generated on Fri Jun 27 2014 18:43:41 for QGIS API Documentation by
1.8.7