Fawkes API
Fawkes Development Version
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
All
Classes
Namespaces
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
exceptions.h
1
2
/***************************************************************************
3
* exceptions.h - Interface generator exceptions
4
*
5
* Generated: Tue Oct 10 18:11:59 2006
6
* Copyright 2006 Tim Niemueller [www.niemueller.de]
7
*
8
****************************************************************************/
9
10
/* This program is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; either version 2 of the License, or
13
* (at your option) any later version.
14
*
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU Library General Public License for more details.
19
*
20
* Read the full text in the LICENSE.GPL file in the doc directory.
21
*/
22
23
#ifndef __INTERFACES_GENERATOR_EXCEPTIONS_H_
24
#define __INTERFACES_GENERATOR_EXCEPTIONS_H_
25
26
#include <core/exception.h>
27
28
/** Thrown if document was invalid.
29
* This may happen if the document is not well-formed or if the file does not
30
* exist.
31
*/
32
class
InterfaceGeneratorInvalidDocumentException
:
public
fawkes::Exception
{
33
public
:
34
/** Constructor
35
* @param format message format string, followed by the appropriate number of
36
* arguments. Cf. printf man page for valid format.
37
*/
38
InterfaceGeneratorInvalidDocumentException
(
const
char
*format, ...)
39
: fawkes::
Exception
()
40
{
41
va_list arg;
42
va_start(arg, format);
43
append_va
(format, arg);
44
va_end(arg);
45
}
46
};
47
48
/** Thrown if document contains illegal content.
49
* This happens if there was content in the file which was while syntactically correct
50
* semantically wrong. Examples for this are more than one data segment or no one at all.
51
*/
52
class
InterfaceGeneratorInvalidContentException
:
public
fawkes::Exception
{
53
public
:
54
/** Constructor
55
* @param format message format string, followed by the appropriate number of
56
* arguments. Cf. printf man page for valid format.
57
*/
58
InterfaceGeneratorInvalidContentException
(
const
char
*format, ...)
59
: fawkes::
Exception
()
60
{
61
va_list arg;
62
va_start(arg, format);
63
append_va
(format, arg);
64
va_end(arg);
65
}
66
};
67
68
69
/** Thrown if illegal type is supplied.
70
* Only a few basic types are allowed. If a typo occured or an unknown type was used
71
* this exception is thrown.
72
*/
73
class
InterfaceGeneratorInvalidTypeException
:
public
fawkes::Exception
{
74
public
:
75
/** Constructor
76
* @param item item type
77
* @param name item name
78
* @param type invalid data type
79
*/
80
InterfaceGeneratorInvalidTypeException
(
const
char
*item,
const
char
*name,
const
char
*type)
81
: fawkes::
Exception
()
82
{
83
append
(
"Invalid type for %s item '%s': %s"
, item, name, type);
84
}
85
};
86
87
/** Thrown if illegal value is supplied.
88
* Thrown if wrong value was supplied for a given value
89
*/
90
class
InterfaceGeneratorInvalidValueException
:
public
fawkes::Exception
{
91
public
:
92
/** Constructor
93
* @param name item name
94
* @param type data type
95
* @param value invalid value
96
*/
97
InterfaceGeneratorInvalidValueException
(
const
char
*name,
const
char
*type,
const
char
*value)
98
: fawkes::
Exception
()
99
{
100
append
(
"Invalid value for '%s' of type %s: %s"
, name, type, value);
101
}
102
};
103
104
/** Thrown if illegal attribute is supplied.
105
* Thrown if illegal attribute was supplied for a given value
106
*/
107
class
InterfaceGeneratorInvalidAttributeException
:
public
fawkes::Exception
{
108
public
:
109
/** Constructor
110
* @param name item name
111
* @param type data type
112
* @param attr invalid attribute
113
*/
114
InterfaceGeneratorInvalidAttributeException
(
const
char
*name,
const
char
*type,
const
char
*attr)
115
: fawkes::
Exception
()
116
{
117
append
(
"Attribute '%s' may not be specified for '%s' of type %s"
, attr, name, type);
118
}
119
};
120
121
122
/** Thrown if illegal flag is supplied.
123
* Thrown if illegal flag was supplied for a given value
124
*/
125
class
InterfaceGeneratorInvalidFlagException
:
public
fawkes::Exception
{
126
public
:
127
/** Constructor
128
* @param name item name
129
* @param flag invalid flag
130
*/
131
InterfaceGeneratorInvalidFlagException
(
const
char
*name,
const
char
*flag)
132
: fawkes::
Exception
()
133
{
134
append
(
"Illegal flag '%s' set for %s"
, flag, name);
135
}
136
};
137
138
139
/** Thrown if required attribute is missing supplied.
140
* Thrown if required attribute was not supplied for a given value
141
*/
142
class
InterfaceGeneratorMissingAttributeException
:
public
fawkes::Exception
{
143
public
:
144
/** Constructor
145
* @param name item name
146
* @param type data type
147
* @param attr missing attribute
148
*/
149
InterfaceGeneratorMissingAttributeException
(
const
char
*name,
const
char
*type,
const
char
*attr)
150
: fawkes::
Exception
()
151
{
152
append
(
"Attribute '%s' is required '%s' of type %s"
, attr, name, type);
153
}
154
};
155
156
157
/** Thrown if name is ambiguous. */
158
class
InterfaceGeneratorAmbiguousNameException
:
public
fawkes::Exception
{
159
public
:
160
/** Constructor
161
* @param name ambiguous name
162
* @param item item type
163
*/
164
InterfaceGeneratorAmbiguousNameException
(
const
char
*name,
const
char
*item)
165
: fawkes::
Exception
()
166
{
167
append
(
"There are multiple %s items with name '%s'"
, item, name);
168
}
169
};
170
171
172
#endif
src
libs
interfaces
generator
exceptions.h
Generated by
1.8.1.1