1
/***************************************************************************
2
qgsproject.cpp - description
4
begin : August 31, 2004
5
copyright : (C) 2004 by Mark Coletti
6
email : mcoletti at gmail.com
7
***************************************************************************/
9
/***************************************************************************
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. *
16
***************************************************************************/
17
/* $Id: qgsexception.h,v 1.4.2.1 2005/07/09 23:51:18 timlinux Exp $ */
18
#ifndef QGSEXCEPTION_H
19
#define QGSEXCEPTION_H
29
Defines a qgis exception class
31
class QgsException : public std::exception
35
QgsException( std::string const & what )
39
QgsException( QString const & what )
40
: what_( (const char *)what.local8Bit() )
43
virtual ~QgsException() throw()
46
const char* what() const throw()
53
/// description of exception
56
}; // class QgsException
59
/** for Qgis I/O related exceptions
61
@note usually thrown for opening file's that don't exist, and the like.
64
class QgsIOException : public QgsException
68
QgsIOException( std::string const & what )
69
: QgsException( what )
72
QgsIOException( QString const & what )
73
: QgsException( what )
76
}; // class QgsIOException
80
/** for files missing from layers while reading project files
83
class QgsProjectBadLayerException : public QgsException
87
QgsProjectBadLayerException( std::list<QDomNode> const & layers )
88
: QgsException(std::string(msg_)),
89
mBrokenLayers( layers )
92
~QgsProjectBadLayerException() throw()
95
std::list<QDomNode> const & layers() const
102
/** QDomNodes representing the state of a layer that couldn't be loaded
104
The layer data was either relocated or deleted. The DOM node also
105
contains ancillary data such as line widths and the like.
108
std::list<QDomNode> mBrokenLayers;
110
static const char * msg_;
112
}; // class QgsProjectBadLayerException