diff --git a/io/cryptoexception.cpp b/io/cryptoexception.cpp index f019ede..0839cea 100644 --- a/io/cryptoexception.cpp +++ b/io/cryptoexception.cpp @@ -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 diff --git a/io/cryptoexception.h b/io/cryptoexception.h index edb7abe..0a25590 100644 --- a/io/cryptoexception.h +++ b/io/cryptoexception.h @@ -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 diff --git a/io/parsingexception.cpp b/io/parsingexception.cpp index 7116c6c..e16f40e 100644 --- a/io/parsingexception.cpp +++ b/io/parsingexception.cpp @@ -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 diff --git a/io/parsingexception.h b/io/parsingexception.h index 5011b6e..9fcec8c 100644 --- a/io/parsingexception.h +++ b/io/parsingexception.h @@ -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