Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
Exceptions.h
Go to the documentation of this file.
1
//
2
// C++ Interface: Audio::Codec
3
//
4
#ifndef __AUDIO_EXCEPTIONS_H__INCLUDED__
5
#define __AUDIO_EXCEPTIONS_H__INCLUDED__
6
7
#include <string>
8
#include <exception>
9
#include "
Format.h
"
10
11
namespace
Audio {
12
19
class
Exception
:
public
std::exception
20
{
21
private
:
22
std::string _message;
23
24
public
:
25
Exception
() {};
26
Exception
(
const
Exception
&other) : _message(other._message) {}
27
explicit
Exception
(
const
std::string &message) : _message(message) {}
28
virtual
~Exception
() throw() {}
29
virtual
const
char
*
what
()
const
throw() {
return
_message.c_str(); }
30
};
31
36
class
FileOpenException
:
public
Exception
{
37
public
:
38
FileOpenException
() {}
39
FileOpenException
(
const
FileOpenException
&other) :
Exception
(other) {}
40
explicit
FileOpenException
(
const
std::string &message) :
Exception
(message) {}
41
};
42
48
class
CodecNotFoundException
:
public
Exception
{
49
public
:
50
CodecNotFoundException
() {}
51
CodecNotFoundException
(
const
CodecNotFoundException
&other) :
Exception
(other) {}
52
explicit
CodecNotFoundException
(
const
std::string &message) :
Exception
(message) {}
53
};
54
59
class
FileFormatException
:
public
Exception
{
60
public
:
61
FileFormatException
() {}
62
FileFormatException
(
const
FileFormatException
&other) :
Exception
(other) {}
63
explicit
FileFormatException
(
const
std::string &message) :
Exception
(message) {}
64
};
65
70
class
EndOfStreamException
:
public
Exception
{
71
public
:
72
EndOfStreamException
() {}
73
EndOfStreamException
(
const
EndOfStreamException
&other) :
Exception
(other) {}
74
explicit
EndOfStreamException
(
const
std::string &message) :
Exception
(message) {}
75
};
76
85
class
CorruptStreamException
:
public
Exception
{
86
bool
fatal;
87
public
:
88
CorruptStreamException
(
const
CorruptStreamException
&other) :
Exception
(other) {}
89
explicit
CorruptStreamException
(
bool
_fatal)
90
:
Exception
(fatal ?
"Fatal corruption on stream"
:
"Recoverable corruption on stream"
),
91
fatal(_fatal)
92
{}
93
94
bool
isFatal
()
const
{
return
fatal; }
95
};
96
102
class
ResourceNotLoadedException
:
public
Exception
{
103
public
:
104
ResourceNotLoadedException
() {}
105
ResourceNotLoadedException
(
const
ResourceNotLoadedException
&other) :
Exception
(other) {}
106
explicit
ResourceNotLoadedException
(
const
std::string &message) :
Exception
(message) {}
107
};
108
115
class
ResourceAlreadyLoadedException
:
public
Exception
{
116
public
:
117
ResourceAlreadyLoadedException
() {}
118
ResourceAlreadyLoadedException
(
const
ResourceAlreadyLoadedException
&other) :
Exception
(other) {}
119
explicit
ResourceAlreadyLoadedException
(
const
std::string &message) :
Exception
(message) {}
120
};
121
126
class
InvalidParametersException
:
public
Exception
{
127
public
:
128
InvalidParametersException
() {}
129
InvalidParametersException
(
const
InvalidParametersException
&other) :
Exception
(other) {}
130
explicit
InvalidParametersException
(
const
std::string &message) :
Exception
(message) {}
131
};
132
136
class
DuplicateObjectException
:
public
Exception
{
137
public
:
138
explicit
DuplicateObjectException
(
const
std::string &name) :
139
Exception
(std::string(
"Object with name \""
) + name +
"\" already existed"
) {}
140
};
141
145
class
NotFoundException
:
public
Exception
{
146
public
:
147
explicit
NotFoundException
(
const
std::string &name) :
148
Exception
(std::string(
"Object with name \""
) + name +
"\" does not exist"
) {}
149
};
150
154
class
NotImplementedException
:
public
Exception
{
155
public
:
156
explicit
NotImplementedException
(
const
std::string &name) :
157
Exception
(name +
" has not been implemented yet"
) {}
158
};
159
163
class
UnsupportedFormatException
:
public
Exception
{
164
Format
format;
165
public
:
166
explicit
UnsupportedFormatException
(
const
std::string &where,
const
Format
&fmt) :
167
Exception
(std::string(
"Unsupported format ("
+ where +
")"
)),
168
format(fmt)
169
{}
170
171
const
Format
&
getFormat
()
const
throw() {
return
format; }
172
};
173
177
class
OutOfMemoryException
:
public
Exception
{
178
public
:
179
OutOfMemoryException
() {}
180
};
181
182
};
183
184
#endif//__AUDIO_EXCEPTIONS_H__INCLUDED__
src
audio
Exceptions.h
Generated on Fri May 29 2015 23:07:06 for Vegastrike 0.5.1 rc1 by
1.8.4