diff options
author | Aina Niemetz <aina.niemetz@gmail.com> | 2018-09-18 17:22:30 -0700 |
---|---|---|
committer | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2018-09-18 19:22:30 -0500 |
commit | 42c15c764e354046ab511e165caa31e001d14f88 (patch) | |
tree | dc503fc60ab41224378ab816cf81df0ce13c946f /src/api/cvc4cpp.h | |
parent | f87b7ee8fb224eada44eda07a59e01d113f769df (diff) |
New C++ API: Introduce new macro and exception for API checks. (#2486)
Diffstat (limited to 'src/api/cvc4cpp.h')
-rw-r--r-- | src/api/cvc4cpp.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/api/cvc4cpp.h b/src/api/cvc4cpp.h index b1a1e2abd..a701eb472 100644 --- a/src/api/cvc4cpp.h +++ b/src/api/cvc4cpp.h @@ -25,6 +25,7 @@ #include <memory> #include <set> #include <string> +#include <sstream> #include <unordered_map> #include <unordered_set> #include <vector> @@ -45,6 +46,20 @@ class Result; namespace api { /* -------------------------------------------------------------------------- */ +/* Exception */ +/* -------------------------------------------------------------------------- */ + +class CVC4_PUBLIC CVC4ApiException : public std::exception +{ + public: + CVC4ApiException(const std::string& str) : d_msg(str) {} + CVC4ApiException(const std::stringstream& stream) :d_msg(stream.str()) {} + std::string getMessage() const { return d_msg; } + private: + std::string d_msg; +}; + +/* -------------------------------------------------------------------------- */ /* Result */ /* -------------------------------------------------------------------------- */ |