Make exception c'tors/d'tors non-inline again

Otherwise it is not possible to throw/catch it accross
library boundaries under Android.
This commit is contained in:
Martchus 2018-12-22 02:47:33 +01:00
parent 42f37a1852
commit a25282b3d1
4 changed files with 53 additions and 32 deletions

View File

@ -4,5 +4,31 @@ namespace Io {
/*!
* \class CryptoException
* \brief The exception that is thrown when an encryption/decryption error occurs.
* \remarks Must not have any inline methods/c'tors/d'tors (so the vtable is invoked in any compile unit).
* Otherwise it is not possible to throw/catch it accross library boundaries under Android.
*/
/*!
* \brief Constructs a crypto exception.
*/
CryptoException::CryptoException(const std::string &message) noexcept
: runtime_error(message)
{
}
/*!
* \brief Constructs a crypto exception.
*/
CryptoException::CryptoException(const char *message) noexcept
: runtime_error(message)
{
}
/*!
* \brief Destroys the crypto exception.
*/
CryptoException::~CryptoException()
{
}
} // namespace Io

View File

@ -12,24 +12,9 @@ class PASSWORD_FILE_EXPORT CryptoException : public std::runtime_error {
public:
explicit CryptoException(const std::string &message) noexcept;
explicit CryptoException(const char *message) noexcept;
~CryptoException() override;
};
/*!
* \brief Constructs a crypto exception.
*/
inline CryptoException::CryptoException(const std::string &message) noexcept
: runtime_error(message)
{
}
/*!
* \brief Constructs a crypto exception.
*/
inline CryptoException::CryptoException(const char *message) noexcept
: runtime_error(message)
{
}
} // namespace Io
#endif // PASSWORD_FILE_IO_CRYPTOFAILUREEXCEPTION_H

View File

@ -5,6 +5,31 @@ namespace Io {
/*!
* \class ParsingException
* \brief The exception that is thrown when a parsing error occurs.
* \remarks Must not have any inline methods/c'tors/d'tors (so the vtable is invoked in any compile unit).
* Otherwise it is not possible to throw/catch it accross library boundaries under Android.
*/
/*!
* \brief Constructs a parsing exception.
*/
ParsingException::ParsingException(const std::string &message) noexcept
: runtime_error(message)
{
}
/*!
* \brief Constructs a parsing exception.
*/
ParsingException::ParsingException(const char *message) noexcept
: runtime_error(message)
{
}
/*!
* \brief Destroys the parsing exception.
*/
ParsingException::~ParsingException()
{
}
} // namespace Io

View File

@ -12,24 +12,9 @@ class PASSWORD_FILE_EXPORT ParsingException : public std::runtime_error {
public:
explicit ParsingException(const std::string &message = std::string()) noexcept;
explicit ParsingException(const char *message) noexcept;
~ParsingException();
};
/*!
* \brief Constructs a parsing exception.
*/
inline ParsingException::ParsingException(const std::string &message) noexcept
: runtime_error(message)
{
}
/*!
* \brief Constructs a parsing exception.
*/
inline ParsingException::ParsingException(const char *message) noexcept
: runtime_error(message)
{
}
} // namespace Io
#endif // PASSWORD_FILE_IO_PARSINGEXCEPTION_H