Use noexcept directly

This commit is contained in:
Martchus 2019-02-17 17:14:07 +01:00
parent 296e5d11b6
commit bd7d5b00d7
2 changed files with 48 additions and 48 deletions

View File

@ -13,21 +13,21 @@ namespace TagParser {
/*! /*!
* \brief Constructs a new exception. * \brief Constructs a new exception.
*/ */
Failure::Failure() USE_NOTHROW Failure::Failure() noexcept
{ {
} }
/*! /*!
* \brief Destroys the exception. * \brief Destroys the exception.
*/ */
Failure::~Failure() USE_NOTHROW Failure::~Failure() noexcept
{ {
} }
/*! /*!
* \brief Returns a C-style character string describing the cause of the exception. * \brief Returns a C-style character string describing the cause of the exception.
*/ */
const char *Failure::what() const USE_NOTHROW const char *Failure::what() const noexcept
{ {
return "unable to parse given data"; return "unable to parse given data";
} }
@ -42,21 +42,21 @@ const char *Failure::what() const USE_NOTHROW
/*! /*!
* \brief Constructs a new exception. * \brief Constructs a new exception.
*/ */
NoDataFoundException::NoDataFoundException() USE_NOTHROW NoDataFoundException::NoDataFoundException() noexcept
{ {
} }
/*! /*!
* \brief Destroys the exception. * \brief Destroys the exception.
*/ */
NoDataFoundException::~NoDataFoundException() USE_NOTHROW NoDataFoundException::~NoDataFoundException() noexcept
{ {
} }
/*! /*!
* \brief Returns a C-style character string describing the cause of the exception. * \brief Returns a C-style character string describing the cause of the exception.
*/ */
const char *NoDataFoundException::what() const USE_NOTHROW const char *NoDataFoundException::what() const noexcept
{ {
return "no parsable data has been found"; return "no parsable data has been found";
} }
@ -70,21 +70,21 @@ const char *NoDataFoundException::what() const USE_NOTHROW
/*! /*!
* \brief Constructs a new exception. * \brief Constructs a new exception.
*/ */
InvalidDataException::InvalidDataException() USE_NOTHROW InvalidDataException::InvalidDataException() noexcept
{ {
} }
/*! /*!
* \brief Destroys the exception. * \brief Destroys the exception.
*/ */
InvalidDataException::~InvalidDataException() USE_NOTHROW InvalidDataException::~InvalidDataException() noexcept
{ {
} }
/*! /*!
* \brief Returns a C-style character string describing the cause of the exception. * \brief Returns a C-style character string describing the cause of the exception.
*/ */
const char *InvalidDataException::what() const USE_NOTHROW const char *InvalidDataException::what() const noexcept
{ {
return "data to be parsed or to be made seems to be invalid"; return "data to be parsed or to be made seems to be invalid";
} }
@ -98,21 +98,21 @@ const char *InvalidDataException::what() const USE_NOTHROW
/*! /*!
* \brief Constructs a new exception. * \brief Constructs a new exception.
*/ */
NoDataProvidedException::NoDataProvidedException() USE_NOTHROW NoDataProvidedException::NoDataProvidedException() noexcept
{ {
} }
/*! /*!
* \brief Destroys the exception. * \brief Destroys the exception.
*/ */
NoDataProvidedException::~NoDataProvidedException() USE_NOTHROW NoDataProvidedException::~NoDataProvidedException() noexcept
{ {
} }
/*! /*!
* \brief Returns a C-style character string describing the cause of the exception. * \brief Returns a C-style character string describing the cause of the exception.
*/ */
const char *NoDataProvidedException::what() const USE_NOTHROW const char *NoDataProvidedException::what() const noexcept
{ {
return "can not write empty value"; return "can not write empty value";
} }
@ -126,21 +126,21 @@ const char *NoDataProvidedException::what() const USE_NOTHROW
/*! /*!
* \brief Constructs a new exception. * \brief Constructs a new exception.
*/ */
TruncatedDataException::TruncatedDataException() USE_NOTHROW TruncatedDataException::TruncatedDataException() noexcept
{ {
} }
/*! /*!
* \brief Destroys the exception. * \brief Destroys the exception.
*/ */
TruncatedDataException::~TruncatedDataException() USE_NOTHROW TruncatedDataException::~TruncatedDataException() noexcept
{ {
} }
/*! /*!
* \brief Returns a C-style character string describing the cause of the exception. * \brief Returns a C-style character string describing the cause of the exception.
*/ */
const char *TruncatedDataException::what() const USE_NOTHROW const char *TruncatedDataException::what() const noexcept
{ {
return "data to be parsed seems to be truncated"; return "data to be parsed seems to be truncated";
} }
@ -154,21 +154,21 @@ const char *TruncatedDataException::what() const USE_NOTHROW
/*! /*!
* \brief Constructs a new exception. * \brief Constructs a new exception.
*/ */
OperationAbortedException::OperationAbortedException() USE_NOTHROW OperationAbortedException::OperationAbortedException() noexcept
{ {
} }
/*! /*!
* \brief Destroys the exception. * \brief Destroys the exception.
*/ */
OperationAbortedException::~OperationAbortedException() USE_NOTHROW OperationAbortedException::~OperationAbortedException() noexcept
{ {
} }
/*! /*!
* \brief Returns a C-style character string describing the cause of the exception. * \brief Returns a C-style character string describing the cause of the exception.
*/ */
const char *OperationAbortedException::what() const USE_NOTHROW const char *OperationAbortedException::what() const noexcept
{ {
return "operation has been aborted"; return "operation has been aborted";
} }
@ -182,21 +182,21 @@ const char *OperationAbortedException::what() const USE_NOTHROW
/*! /*!
* \brief Constructs a new exception. * \brief Constructs a new exception.
*/ */
VersionNotSupportedException::VersionNotSupportedException() USE_NOTHROW VersionNotSupportedException::VersionNotSupportedException() noexcept
{ {
} }
/*! /*!
* \brief Destroys the exception. * \brief Destroys the exception.
*/ */
VersionNotSupportedException::~VersionNotSupportedException() USE_NOTHROW VersionNotSupportedException::~VersionNotSupportedException() noexcept
{ {
} }
/*! /*!
* \brief Returns a C-style character string describing the cause of the exception. * \brief Returns a C-style character string describing the cause of the exception.
*/ */
const char *VersionNotSupportedException::what() const USE_NOTHROW const char *VersionNotSupportedException::what() const noexcept
{ {
return "the version of the data to be parsed is not supported"; return "the version of the data to be parsed is not supported";
} }
@ -210,21 +210,21 @@ const char *VersionNotSupportedException::what() const USE_NOTHROW
/*! /*!
* \brief Constructs a new exception. * \brief Constructs a new exception.
*/ */
NotImplementedException::NotImplementedException() USE_NOTHROW NotImplementedException::NotImplementedException() noexcept
{ {
} }
/*! /*!
* \brief Destroys the exception. * \brief Destroys the exception.
*/ */
NotImplementedException::~NotImplementedException() USE_NOTHROW NotImplementedException::~NotImplementedException() noexcept
{ {
} }
/*! /*!
* \brief Returns a C-style character string describing the cause of the exception. * \brief Returns a C-style character string describing the cause of the exception.
*/ */
const char *NotImplementedException::what() const USE_NOTHROW const char *NotImplementedException::what() const noexcept
{ {
return "the operation has not been implemented yet"; return "the operation has not been implemented yet";
} }

View File

@ -10,58 +10,58 @@ namespace TagParser {
class TAG_PARSER_EXPORT Failure : public std::exception { class TAG_PARSER_EXPORT Failure : public std::exception {
public: public:
Failure() USE_NOTHROW; Failure() noexcept;
virtual ~Failure() USE_NOTHROW; virtual ~Failure() noexcept;
virtual const char *what() const USE_NOTHROW; virtual const char *what() const noexcept;
}; };
class TAG_PARSER_EXPORT NoDataFoundException : public Failure { class TAG_PARSER_EXPORT NoDataFoundException : public Failure {
public: public:
NoDataFoundException() USE_NOTHROW; NoDataFoundException() noexcept;
virtual ~NoDataFoundException() USE_NOTHROW; virtual ~NoDataFoundException() noexcept;
virtual const char *what() const USE_NOTHROW; virtual const char *what() const noexcept;
}; };
class TAG_PARSER_EXPORT InvalidDataException : public Failure { class TAG_PARSER_EXPORT InvalidDataException : public Failure {
public: public:
InvalidDataException() USE_NOTHROW; InvalidDataException() noexcept;
virtual ~InvalidDataException() USE_NOTHROW; virtual ~InvalidDataException() noexcept;
virtual const char *what() const USE_NOTHROW; virtual const char *what() const noexcept;
}; };
class TAG_PARSER_EXPORT NoDataProvidedException : public Failure { class TAG_PARSER_EXPORT NoDataProvidedException : public Failure {
public: public:
NoDataProvidedException() USE_NOTHROW; NoDataProvidedException() noexcept;
virtual ~NoDataProvidedException() USE_NOTHROW; virtual ~NoDataProvidedException() noexcept;
virtual const char *what() const USE_NOTHROW; virtual const char *what() const noexcept;
}; };
class TAG_PARSER_EXPORT TruncatedDataException : public InvalidDataException { class TAG_PARSER_EXPORT TruncatedDataException : public InvalidDataException {
public: public:
TruncatedDataException() USE_NOTHROW; TruncatedDataException() noexcept;
virtual ~TruncatedDataException() USE_NOTHROW; virtual ~TruncatedDataException() noexcept;
virtual const char *what() const USE_NOTHROW; virtual const char *what() const noexcept;
}; };
class TAG_PARSER_EXPORT OperationAbortedException : public Failure { class TAG_PARSER_EXPORT OperationAbortedException : public Failure {
public: public:
OperationAbortedException() USE_NOTHROW; OperationAbortedException() noexcept;
virtual ~OperationAbortedException() USE_NOTHROW; virtual ~OperationAbortedException() noexcept;
virtual const char *what() const USE_NOTHROW; virtual const char *what() const noexcept;
}; };
class TAG_PARSER_EXPORT VersionNotSupportedException : public Failure { class TAG_PARSER_EXPORT VersionNotSupportedException : public Failure {
public: public:
VersionNotSupportedException() USE_NOTHROW; VersionNotSupportedException() noexcept;
virtual ~VersionNotSupportedException() USE_NOTHROW; virtual ~VersionNotSupportedException() noexcept;
virtual const char *what() const USE_NOTHROW; virtual const char *what() const noexcept;
}; };
class TAG_PARSER_EXPORT NotImplementedException : public Failure { class TAG_PARSER_EXPORT NotImplementedException : public Failure {
public: public:
NotImplementedException() USE_NOTHROW; NotImplementedException() noexcept;
virtual ~NotImplementedException() USE_NOTHROW; virtual ~NotImplementedException() noexcept;
virtual const char *what() const USE_NOTHROW; virtual const char *what() const noexcept;
}; };
/*! /*!