|
1 /* |
|
2 * Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef LAYOUTCOMPILERERR_H |
|
21 #define LAYOUTCOMPILERERR_H |
|
22 |
|
23 #include <iosfwd> |
|
24 #include <string> |
|
25 #include <cdlcompilertoolkit/cdltkutil.h> |
|
26 using namespace CdlCompilerToolkit; |
|
27 using namespace std; |
|
28 |
|
29 /** |
|
30 * LayoutCompilerErr |
|
31 * Base class for exceptions in the layout compiler |
|
32 */ |
|
33 class LayoutCompilerErr : public CdlCompilerToolkitErr |
|
34 {}; |
|
35 |
|
36 /** |
|
37 * NotFoundErr |
|
38 * A "not found" exception, which takes a string to explain what was not found |
|
39 */ |
|
40 class NotFoundErr : public LayoutCompilerErr |
|
41 { |
|
42 public: |
|
43 NotFoundErr(const string& aName) : iName(aName) {} |
|
44 void Show(ostream& stream) const; |
|
45 private: |
|
46 string iName; |
|
47 }; |
|
48 |
|
49 /** |
|
50 * GeneralErr |
|
51 * A general compiler error, which takes a string to explain what the error was |
|
52 */ |
|
53 class GeneralErr : public LayoutCompilerErr |
|
54 { |
|
55 public: |
|
56 GeneralErr(const string& aMessage) : iMessage(aMessage) {} |
|
57 void Show(ostream& stream) const; |
|
58 private: |
|
59 string iMessage; |
|
60 }; |
|
61 |
|
62 string StreamLoc(const istream& stream, const string& msg, int before, int after); |
|
63 |
|
64 |
|
65 /** |
|
66 * LayoutProcessArgsErr |
|
67 * A templated exception class that indicated an exception in the command line parameter |
|
68 * processing in the class in which it is instantiated on. |
|
69 */ |
|
70 template<class T> |
|
71 class LayoutProcessArgsErr : public LayoutCompilerErr |
|
72 { |
|
73 void Show(ostream& aStream) const { T::ShowHelp(aStream); } |
|
74 }; |
|
75 |
|
76 |
|
77 |
|
78 #endif |
|
79 |
|
80 // End of File |