-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathexceptions.cpp
232 lines (197 loc) · 4.92 KB
/
exceptions.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
#include "./exceptions.h"
using namespace std;
namespace TagParser {
/*!
* \class TagParser::Failure
* \brief The class inherits from std::exception and serves as base class for exceptions
* thrown by the elements of the Media namespace.
*/
/*!
* \brief Constructs a new exception.
*/
Failure::Failure() noexcept
{
}
/*!
* \brief Destroys the exception.
*/
Failure::~Failure() noexcept
{
}
/*!
* \brief Returns a C-style character string describing the cause of the exception.
*/
const char *Failure::what() const noexcept
{
return "unable to parse given data";
}
/*!
* \class TagParser::NoDataFoundException
* \brief The exception that is thrown when the data to be parsed holds no
* parsable information (e.g. relevant section in the file does not exist or
* has size of zero).
*/
/*!
* \brief Constructs a new exception.
*/
NoDataFoundException::NoDataFoundException() noexcept
{
}
/*!
* \brief Destroys the exception.
*/
NoDataFoundException::~NoDataFoundException() noexcept
{
}
/*!
* \brief Returns a C-style character string describing the cause of the exception.
*/
const char *NoDataFoundException::what() const noexcept
{
return "no parsable data has been found";
}
/*!
* \class TagParser::InvalidDataException
* \brief The exception that is thrown when the data to be parsed or to be made seems
* invalid and therefore can not be parsed.
*/
/*!
* \brief Constructs a new exception.
*/
InvalidDataException::InvalidDataException() noexcept
{
}
/*!
* \brief Destroys the exception.
*/
InvalidDataException::~InvalidDataException() noexcept
{
}
/*!
* \brief Returns a C-style character string describing the cause of the exception.
*/
const char *InvalidDataException::what() const noexcept
{
return "data to be parsed or to be made seems to be invalid";
}
/*!
* \class TagParser::NoDataProvidedException
* \brief The exception that is thrown when the value to be written is empty but that
* is not allowed in that context (e.g. an empty ID3v2 frame is not allowed).
*/
/*!
* \brief Constructs a new exception.
*/
NoDataProvidedException::NoDataProvidedException() noexcept
{
}
/*!
* \brief Destroys the exception.
*/
NoDataProvidedException::~NoDataProvidedException() noexcept
{
}
/*!
* \brief Returns a C-style character string describing the cause of the exception.
*/
const char *NoDataProvidedException::what() const noexcept
{
return "can not write empty value";
}
/*!
* \class TagParser::TruncatedDataException
* \brief The exception that is thrown when the data to be parsed is truncated
* and therefore can not be parsed at all.
*/
/*!
* \brief Constructs a new exception.
*/
TruncatedDataException::TruncatedDataException() noexcept
{
}
/*!
* \brief Destroys the exception.
*/
TruncatedDataException::~TruncatedDataException() noexcept
{
}
/*!
* \brief Returns a C-style character string describing the cause of the exception.
*/
const char *TruncatedDataException::what() const noexcept
{
return "data to be parsed seems to be truncated";
}
/*!
* \class TagParser::OperationAbortedException
* \brief The exception that is thrown when an operation has been stopped
* and thus not successfully completed because it has been aborted.
*/
/*!
* \brief Constructs a new exception.
*/
OperationAbortedException::OperationAbortedException() noexcept
{
}
/*!
* \brief Destroys the exception.
*/
OperationAbortedException::~OperationAbortedException() noexcept
{
}
/*!
* \brief Returns a C-style character string describing the cause of the exception.
*/
const char *OperationAbortedException::what() const noexcept
{
return "operation has been aborted";
}
/*!
* \class TagParser::VersionNotSupportedException
* \brief The exception that is thrown when an operation fails because the
* detected or specified version is not supported by the implementation.
*/
/*!
* \brief Constructs a new exception.
*/
VersionNotSupportedException::VersionNotSupportedException() noexcept
{
}
/*!
* \brief Destroys the exception.
*/
VersionNotSupportedException::~VersionNotSupportedException() noexcept
{
}
/*!
* \brief Returns a C-style character string describing the cause of the exception.
*/
const char *VersionNotSupportedException::what() const noexcept
{
return "the version of the data to be parsed is not supported";
}
/*!
* \class TagParser::NotImplementedException
* \brief This exception is thrown when the an operation is invoked that has not
* been implemented yet.
*/
/*!
* \brief Constructs a new exception.
*/
NotImplementedException::NotImplementedException() noexcept
{
}
/*!
* \brief Destroys the exception.
*/
NotImplementedException::~NotImplementedException() noexcept
{
}
/*!
* \brief Returns a C-style character string describing the cause of the exception.
*/
const char *NotImplementedException::what() const noexcept
{
return "the operation has not been implemented yet";
}
} // namespace TagParser