| c53e6443 |
sago007 |
2012-04-17 11:04 |
1 |
/* |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
2 |
=========================================================================== |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
3 |
blockattack - Block Attack - Rise of the Blocks |
| af35c39d |
sago007 |
2013-11-16 16:37 |
4 |
Copyright (C) 2005-2013 Poul Sander |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
5 |
|
| c53e6443 |
sago007 |
2012-04-17 11:04 |
6 |
This program is free software: you can redistribute it and/or modify |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
7 |
it under the terms of the GNU General Public License as published by |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
8 |
the Free Software Foundation, either version 2 of the License, or |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
9 |
(at your option) any later version. |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
10 |
|
| c53e6443 |
sago007 |
2012-04-17 11:04 |
11 |
This program is distributed in the hope that it will be useful, |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
12 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
13 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
14 |
GNU General Public License for more details. |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
15 |
|
| c53e6443 |
sago007 |
2012-04-17 11:04 |
16 |
You should have received a copy of the GNU General Public License |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
17 |
along with this program. If not, see http://www.gnu.org/licenses/ |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
18 |
|
| c53e6443 |
sago007 |
2012-04-17 11:04 |
19 |
Source information and contacts persons can be found at |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
20 |
http://blockattack.sf.net |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
21 |
=========================================================================== |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
22 |
*/ |
| 3db6ed5d |
sago007 |
2010-12-07 17:19 |
23 |
|
| 3db6ed5d |
sago007 |
2010-12-07 17:19 |
24 |
#ifndef _CPPSDLEXCEPTION_HPP |
| 3db6ed5d |
sago007 |
2010-12-07 17:19 |
25 |
#define _CPPSDLEXCEPTION_HPP |
| 3db6ed5d |
sago007 |
2010-12-07 17:19 |
26 |
|
| 3db6ed5d |
sago007 |
2010-12-07 17:19 |
27 |
#include <string> |
| 3db6ed5d |
sago007 |
2010-12-07 17:19 |
28 |
|
| 1df28151 |
sago007 |
2010-12-23 22:51 |
29 |
#define CPPSDL_ERROR_DATA 1 |
| 1df28151 |
sago007 |
2010-12-23 22:51 |
30 |
#define CPPSDL_ERROR_INVALID 2 |
| 1df28151 |
sago007 |
2010-12-23 22:51 |
31 |
#define CPPSDL_ERROR_MISSINGFILE 3 |
| 1df28151 |
sago007 |
2010-12-23 22:51 |
32 |
#define CPPSDL_ERROR_NULLPOINTER 4 |
| 1df28151 |
sago007 |
2010-12-23 22:51 |
33 |
|
| 1df28151 |
sago007 |
2010-12-23 22:51 |
34 |
enum Subsystem {OTHER,IMAGE,TILE,SPRITE,LAYER,SCREEN }; |
| 1df28151 |
sago007 |
2010-12-23 22:51 |
35 |
|
| 3db6ed5d |
sago007 |
2010-12-07 17:19 |
36 |
|
| c53e6443 |
sago007 |
2012-04-17 11:04 |
37 |
namespace CppSdl |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
38 |
{ |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
39 |
class CppSdlException : std::exception |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
40 |
{ |
| 3db6ed5d |
sago007 |
2010-12-07 17:19 |
41 |
public: |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
42 |
//CppSdlException(); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
43 |
/** |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
44 |
* Constructor for making a fully CppSdl compliant expection |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
45 |
* @param subsystem Can be: OTHER,IMAGE,TILE,SPRITE,LAYER,SCREEN |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
46 |
* @param errorNumber 1=Data error, 2=Invalid, 3=Missingfile, 4=null pointer |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
47 |
* @param msg Human readable error message. |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
48 |
*/ |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
49 |
CppSdlException(Subsystem subsystem, long errorNumber, std::string msg); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
50 |
CppSdlException(const CppSdlException& orig); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
51 |
virtual ~CppSdlException() throw(); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
52 |
virtual const char* what() const throw(); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
53 |
long GetErrorNumber(); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
54 |
Subsystem GetSubSystem(); |
| 3db6ed5d |
sago007 |
2010-12-07 17:19 |
55 |
private: |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
56 |
std::string _message; |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
57 |
long _errorNumber; |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
58 |
Subsystem _subsystem; |
| 3db6ed5d |
sago007 |
2010-12-07 17:19 |
59 |
}; |
| 3db6ed5d |
sago007 |
2010-12-07 17:19 |
60 |
|
| 3db6ed5d |
sago007 |
2010-12-07 17:19 |
61 |
|
| 3db6ed5d |
sago007 |
2010-12-07 17:19 |
62 |
} |
| 3db6ed5d |
sago007 |
2010-12-07 17:19 |
63 |
#endif /* _CPPSDLEXCEPTION_HPP */ |
| 3db6ed5d |
sago007 |
2010-12-07 17:19 |
64 |
|
|
|
1970-01-01 00:00 |
65 |
|