diff options
author | Bardur Arantsson <bardur@scientician.net> | 2015-02-23 09:11:55 +0100 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2015-02-23 09:11:55 +0100 |
commit | 062cd07342edc2b003555e90dd2cee0514b9f64a (patch) | |
tree | 3c73893dae8a9380c9f24e9c5822c5ec6bf671d5 /vendor/bandit/bandit/assertion_exception.h | |
parent | ffee481435ac0afe3f9a5a3eb07b2f2a46467089 (diff) |
Add BanditCpp 1.1.4 test harness
Diffstat (limited to 'vendor/bandit/bandit/assertion_exception.h')
-rw-r--r-- | vendor/bandit/bandit/assertion_exception.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/vendor/bandit/bandit/assertion_exception.h b/vendor/bandit/bandit/assertion_exception.h new file mode 100644 index 00000000..33d7474f --- /dev/null +++ b/vendor/bandit/bandit/assertion_exception.h @@ -0,0 +1,39 @@ +#ifndef BANDIT_ASSERTION_EXCEPTION_H +#define BANDIT_ASSERTION_EXCEPTION_H + +namespace bandit { namespace detail { + + struct assertion_exception : public std::runtime_error + { + assertion_exception(const std::string& message, + const std::string& file_name, const unsigned int line_number) + : std::runtime_error(message), file_name_(file_name), line_number_(line_number) + {} + + assertion_exception(const std::string& message) + : std::runtime_error(message), line_number_(0) + {} + + // + // To make gcc < 4.7 happy. + // + virtual ~assertion_exception() throw() + {} + + const std::string& file_name() const + { + return file_name_; + } + + unsigned int line_number() const + { + return line_number_; + } + + private: + std::string file_name_; + unsigned int line_number_; + }; +}} + +#endif |