Exception handling.
[reactos.git] / reactos / tools / rbuild / exception.cpp
1 #ifdef _MSC_VER
2 #pragma warning ( disable : 4786 ) // identifier was truncated to '255' characters in the debug information
3 #endif//_MSC_VER
4
5 #include <stdarg.h>
6 #include "rbuild.h"
7
8 Exception::Exception()
9 {
10 }
11
12 Exception::Exception(string message)
13 {
14 Message = message;
15 }
16
17 Exception::Exception(const char* format,
18 ...)
19 {
20 va_list args;
21 va_start(args,
22 format);
23 Message = ssvprintf(format,
24 args);
25 va_end(args);
26 }
27
28 void Exception::SetMessage(const char* message,
29 va_list args)
30 {
31 Message = ssvprintf(message,
32 args);
33 }
34
35
36 FileNotFoundException::FileNotFoundException(string filename)
37 : Exception ( "File '%s' not found.", filename.c_str() )
38 {
39 Filename = filename;
40 }
41
42
43 InvalidBuildFileException::InvalidBuildFileException(const char* message,
44 ...)
45 {
46 va_list args;
47 va_start( args, message);
48 SetMessage(message, args);
49 va_end(args);
50 }