1 /*
2  * HLLib
3  * Copyright (C) 2006-2010 Ryan Gregg
4 
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later
9  * version.
10  */
11 
12 #ifndef ERROR_H
13 #define ERROR_H
14 
15 #include <stdarg.h>
16 
17 #include "stdafx.h"
18 
19 #define ERROR_STRING_SIZE 4096
20 
21 namespace HLLib
22 {
23 	class HLLIB_API CError
24 	{
25 	private:
26 		hlChar lpError[ERROR_STRING_SIZE];
27 
28 		hlUInt uiSystemError;
29 		hlChar lpSystemError[ERROR_STRING_SIZE];
30 
31 		hlChar lpShortFormattedError[ERROR_STRING_SIZE];
32 		hlChar lpLongFormattedError[ERROR_STRING_SIZE];
33 
34 	public:
35 		CError();
36 		~CError();
37 
38 		hlVoid Clear();
39 
40 		const hlChar *GetErrorMessage() const;
41 
42 		hlUInt GetSystemError() const;
43 		const hlChar *GetSystemErrorMessage() const;
44 
45 		const hlChar *GetShortFormattedErrorMessage();
46 		const hlChar *GetLongFormattedErrorMessage();
47 
48 		hlVoid SetErrorMessage(const hlChar *lpError);
49 		hlVoid SetErrorMessageFormated(const hlChar *lpFormat, ...);
50 
51 		hlVoid SetSystemErrorMessage(const hlChar *lpError);
52 		hlVoid SetSystemErrorMessageFormated(const hlChar *lpFormat, ...);
53 	};
54 }
55 
56 #endif
57