* Add InvalidDataException

This commit is contained in:
Antidote 2014-02-12 14:52:44 -08:00
parent b4171a76ad
commit 2731ac3dff
3 changed files with 32 additions and 2 deletions

View File

@ -40,7 +40,7 @@ public:
/*! \brief The constructor for an IOException
* \param message The error message to throw
*/
IOException(const std::string& message) :
inline IOException(const std::string& message) :
Exception("IOException: " + message)
{}
};

View File

@ -0,0 +1,29 @@
#ifndef INVALIDDATAEXCEPTION_HPP
#define INVALIDDATAEXCEPTION_HPP
#include "Exception.hpp"
namespace zelda
{
namespace error
{
/*! \class InvalidDataException
* \brief An exception thrown on Invalid Data calls.
*
* This should only be thrown when the library tries to
* e.g pass a NULL pointer to a function which requires a valid pointer.
* <br />
* It is <b>NOT</b> appropriate to use <b>throw new</b> so avoid doing so,
* keeping things on the stack as much as possible is very important for speed.
*/
class InvalidDataException : public Exception
{
public:
inline InvalidDataException(const std::string& error)
: Exception("InvalidDataException: " + error)
{
}
};
}
}
#endif // INVALIDDATAEXCEPTION_HPP

View File

@ -55,7 +55,8 @@ HEADERS += \
$$PWD/include/SpriteFileReader.hpp \
$$PWD/include/SpriteFileWriter.hpp \
$$PWD/include/SpriteFrame.hpp \
$$PWD/include/SpritePart.hpp
$$PWD/include/SpritePart.hpp \
../libzelda/include/InvalidDataException.hpp
SOURCES += \
$$PWD/src/utility.cpp \