1 /*
2  *  (c) 2004 Iowa State University
3  *      see the LICENSE file in the top level directory
4  */
5 
6 /*	GlobalExceptions.h
7 
8 	Declarations of the classes which might be 'thrown' and caught within
9 	MacMolPlt.
10 
11 	Brett Bode 4/1998
12 	BMB 1/2001 Added UserCancel class to handle user aborts of long operations
13 */
14 
15 //Global exceptions types
16 
17 #ifndef __GLOBAL_EXCEPTIONS_H__
18 #define __GLOBAL_EXCEPTIONS_H__
19 
20 //The following are for non-Mac systems
21 #if defined(__wxBuild__) && !defined(__WXOSX_CARBON__)
22 typedef long OSErr;
23 const int noErr = 0;
24 const int eofErr = -39;
25 #endif
26 
27 class MemoryError {
28 	private:
29 		char *	ErrorMessage;
30 	public:
MemoryError(void)31 		MemoryError(void) {};
32 		MemoryError(const char *Message);
33 };
34 class DataError {
35 	public:
DataError(void)36 		DataError(void) {};
37 };
38 class FileError {
39 	public:
40 		OSErr	Error;
FileError(void)41 		FileError(void) {
42 			Error = noErr;
43 		};
FileError(OSErr err)44 		FileError(OSErr	err) {
45 			Error = err;
46 		};
47 		void WriteError(void);
48 };
49 class UserCancel {
50 	public:
UserCancel(void)51 		UserCancel(void) {};
52 };
53 
54 #endif
55 
56