Branch setupapi
[reactos.git] / reactos / tools / rbuild / exception.h
1 #ifndef __EXCEPTION_H
2 #define __EXCEPTION_H
3
4 #include "pch.h"
5
6 class Exception
7 {
8 public:
9 Exception ( const std::string& message );
10 Exception ( const char* format,
11 ...);
12 std::string Message;
13 protected:
14 Exception ();
15 void SetMessage ( const char* message,
16 va_list args);
17 };
18
19
20 class InvalidOperationException : public Exception
21 {
22 public:
23 InvalidOperationException ( const char* filename,
24 const int linenumber);
25 InvalidOperationException ( const char* filename,
26 const int linenumber,
27 const char* message,
28 ... );
29 };
30
31
32 class OutOfMemoryException : public Exception
33 {
34 public:
35 OutOfMemoryException ();
36 };
37
38
39 class FileNotFoundException : public Exception
40 {
41 public:
42 FileNotFoundException ( const std::string& filename );
43 std::string Filename;
44 };
45
46
47 class AccessDeniedException : public Exception
48 {
49 public:
50 AccessDeniedException ( const std::string& filename );
51 std::string Filename;
52 };
53
54 class InvalidBuildFileException : public Exception
55 {
56 public:
57 InvalidBuildFileException ( const std::string& location,
58 const char* message,
59 ...);
60 void SetLocationMessage ( const std::string& location,
61 const char* message,
62 va_list args );
63 protected:
64 InvalidBuildFileException ();
65 };
66
67
68 class XMLSyntaxErrorException : public InvalidBuildFileException
69 {
70 public:
71 XMLSyntaxErrorException ( const std::string& location,
72 const char* message,
73 ... );
74 };
75
76
77 class RequiredAttributeNotFoundException : public InvalidBuildFileException
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 InvalidBuildFileException
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 InvalidBuildFileException
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 #endif /* __EXCEPTION_H */