From c8a539f4f4b6060dff1791a60f2d134c88a291c2 Mon Sep 17 00:00:00 2001 From: Jesse Beder Date: Sat, 19 May 2012 01:32:10 -0500 Subject: [PATCH] Removed old api exceptions --- include/yaml-cpp/exceptions.h | 63 ----------------------------------- 1 file changed, 63 deletions(-) diff --git a/include/yaml-cpp/exceptions.h b/include/yaml-cpp/exceptions.h index 394d586..9e19637 100644 --- a/include/yaml-cpp/exceptions.h +++ b/include/yaml-cpp/exceptions.h @@ -55,10 +55,6 @@ namespace YAML const char * const AMBIGUOUS_ANCHOR = "cannot assign the same alias to multiple nodes"; const char * const UNKNOWN_ANCHOR = "the referenced anchor is not defined"; - const char * const INVALID_SCALAR = "invalid scalar"; - const char * const KEY_NOT_FOUND = "key not found"; - const char * const BAD_DEREFERENCE = "bad dereference"; - const char * const UNMATCHED_GROUP_TAG = "unmatched group tag"; const char * const UNEXPECTED_END_SEQ = "unexpected end sequence token"; const char * const UNEXPECTED_END_MAP = "unexpected end map token"; @@ -70,24 +66,6 @@ namespace YAML const char * const EXPECTED_VALUE_TOKEN = "expected value token"; const char * const UNEXPECTED_KEY_TOKEN = "unexpected key token"; const char * const UNEXPECTED_VALUE_TOKEN = "unexpected value token"; - - template - inline const std::string KEY_NOT_FOUND_WITH_KEY(const T&, typename disable_if >::type * = 0) { - return KEY_NOT_FOUND; - } - - inline const std::string KEY_NOT_FOUND_WITH_KEY(const std::string& key) { - std::stringstream stream; - stream << KEY_NOT_FOUND << ": " << key; - return stream.str(); - } - - template - inline const std::string KEY_NOT_FOUND_WITH_KEY(const T& key, typename enable_if >::type * = 0) { - std::stringstream stream; - stream << KEY_NOT_FOUND << ": " << key; - return stream.str(); - } } class Exception: public std::runtime_error { @@ -113,47 +91,6 @@ namespace YAML : Exception(mark_, msg_) {} }; - class RepresentationException: public Exception { - public: - RepresentationException(const Mark& mark_, const std::string& msg_) - : Exception(mark_, msg_) {} - }; - - // representation exceptions - class InvalidScalar: public RepresentationException { - public: - InvalidScalar(const Mark& mark_) - : RepresentationException(mark_, ErrorMsg::INVALID_SCALAR) {} - }; - - class KeyNotFound: public RepresentationException { - public: - template - KeyNotFound(const Mark& mark_, const T& key_) - : RepresentationException(mark_, ErrorMsg::KEY_NOT_FOUND_WITH_KEY(key_)) {} - }; - - template - class TypedKeyNotFound: public KeyNotFound { - public: - TypedKeyNotFound(const Mark& mark_, const T& key_) - : KeyNotFound(mark_, key_), key(key_) {} - virtual ~TypedKeyNotFound() throw() {} - - T key; - }; - - template - inline TypedKeyNotFound MakeTypedKeyNotFound(const Mark& mark, const T& key) { - return TypedKeyNotFound (mark, key); - } - - class BadDereference: public RepresentationException { - public: - BadDereference() - : RepresentationException(Mark::null(), ErrorMsg::BAD_DEREFERENCE) {} - }; - class EmitterException: public Exception { public: EmitterException(const std::string& msg_)