fix msvc6 warnings
[reactos.git] / reactos / tools / rbuild / exception.h
1 /*
2 * Copyright (C) 2005 Casper S. Hornstrup
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18 #ifndef __EXCEPTION_H
19 #define __EXCEPTION_H
20
21 #include "pch.h"
22 #include "xml.h"
23
24 class Exception
25 {
26 public:
27 Exception ( const std::string& message );
28 Exception ( const char* format,
29 ...);
30 const std::string& operator *() { return _e; }
31
32 protected:
33 Exception ();
34 void SetMessage ( const char* message, ... );
35 void SetMessageV ( const char* message, va_list args );
36
37 private:
38 std::string _e;
39 };
40
41
42 class InvalidOperationException : public Exception
43 {
44 public:
45 InvalidOperationException ( const char* filename,
46 const int linenumber);
47 InvalidOperationException ( const char* filename,
48 const int linenumber,
49 const char* message,
50 ... );
51 };
52
53
54 class OutOfMemoryException : public Exception
55 {
56 public:
57 OutOfMemoryException ();
58 };
59
60
61 class FileNotFoundException : public Exception
62 {
63 public:
64 FileNotFoundException ( const std::string& filename );
65 std::string Filename;
66 };
67
68
69 class AccessDeniedException : public Exception
70 {
71 public:
72 AccessDeniedException ( const std::string& filename );
73 std::string Filename;
74 };
75
76
77 class RequiredAttributeNotFoundException : public XMLInvalidBuildFileException
78 {
79 public:
80 RequiredAttributeNotFoundException ( const std::string& location,
81 const std::string& attributeName,
82 const std::string& elementName );
83 };
84
85
86 class InvalidAttributeValueException : public XMLInvalidBuildFileException
87 {
88 public:
89 InvalidAttributeValueException ( const std::string& location,
90 const std::string& name,
91 const std::string& value );
92 };
93
94
95 class BackendNameConflictException : public Exception
96 {
97 public:
98 BackendNameConflictException ( const std::string& name );
99 };
100
101
102 class UnknownBackendException : public Exception
103 {
104 public:
105 UnknownBackendException ( const std::string& name );
106 };
107
108 class UnknownModuleTypeException : public XMLInvalidBuildFileException
109 {
110 public:
111 UnknownModuleTypeException ( const std::string& location,
112 int moduletype );
113 };
114
115
116 class InvocationFailedException : public Exception
117 {
118 public:
119 InvocationFailedException ( const std::string& command,
120 int exitcode );
121 std::string Command;
122 int ExitCode;
123 };
124
125
126 class UnsupportedBuildToolException : public Exception
127 {
128 public:
129 UnsupportedBuildToolException ( const std::string& buildtool,
130 const std::string& version );
131 std::string BuildTool;
132 std::string Version;
133 };
134
135 #endif /* __EXCEPTION_H */