diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-05-10 20:20:11 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-05-10 20:20:11 +0000 |
| commit | 711043c7ca9bd675133e9bb1c1a3ec05c83cbeba (patch) | |
| tree | 9395fdf4cc57a8192fc0ebe506dd0f5b9db0d9d3 /src/2geom/exception.h | |
| parent | Do not show/edit image URL for data URIs. (diff) | |
| download | inkscape-711043c7ca9bd675133e9bb1c1a3ec05c83cbeba.tar.gz inkscape-711043c7ca9bd675133e9bb1c1a3ec05c83cbeba.zip | |
update to latest 2geom. this adds gsl dependency, doesn't seem to make inskape executable bigger
(bzr r5649)
Diffstat (limited to 'src/2geom/exception.h')
| -rw-r--r-- | src/2geom/exception.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/2geom/exception.h b/src/2geom/exception.h index 88ecfc51b..2749ec63a 100644 --- a/src/2geom/exception.h +++ b/src/2geom/exception.h @@ -36,7 +36,7 @@ namespace Geom { -// Base exception class, all 2geom exceptions should be derrived from this one. +// Base exception class, all 2geom exceptions should be derived from this one. class Exception : public std::exception { public: Exception(const char * message, const char *file, const int line) { @@ -53,7 +53,7 @@ public: protected: std::string msgstr; }; -#define throwException(message) throw(Geom::Exception(message, __FILE__, __LINE__)) +#define THROW_EXCEPTION(message) throw(Geom::Exception(message, __FILE__, __LINE__)) //----------------------------------------------------------------------- // Two main exception classes: LogicalError and RangeError. @@ -65,14 +65,14 @@ public: LogicalError(const char * message, const char *file, const int line) : Exception(message, file, line) {} }; -#define throwLogicalError(message) throw(LogicalError(message, __FILE__, __LINE__)) +#define THROW_LOGICALERROR(message) throw(LogicalError(message, __FILE__, __LINE__)) class RangeError : public Exception { public: RangeError(const char * message, const char *file, const int line) : Exception(message, file, line) {} }; -#define throwRangeError(message) throw(RangeError(message, __FILE__, __LINE__)) +#define THROW_RANGEERROR(message) throw(RangeError(message, __FILE__, __LINE__)) //----------------------------------------------------------------------- // Special case exceptions. Best used with the defines :) @@ -82,29 +82,29 @@ public: NotImplemented(const char *file, const int line) : LogicalError("Method not implemented", file, line) {} }; -#define throwNotImplemented(i) throw(NotImplemented(__FILE__, __LINE__)) +#define THROW_NOTIMPLEMENTED(i) throw(NotImplemented(__FILE__, __LINE__)) class InvariantsViolation : public LogicalError { public: InvariantsViolation(const char *file, const int line) : LogicalError("Invariants violation", file, line) {} }; -#define throwInvariantsViolation(i) throw(InvariantsViolation(__FILE__, __LINE__)) -#define assert_invariants(e) ((e) ? (void)0 : throwInvariantsViolation()) +#define THROW_INVARIANTSVIOLATION(i) throw(InvariantsViolation(__FILE__, __LINE__)) +#define ASSERT_INVARIANTS(e) ((e) ? (void)0 : THROW_INVARIANTSVIOLATION()) class NotInvertible : public RangeError { public: NotInvertible(const char *file, const int line) : RangeError("Function does not have a unique inverse", file, line) {} }; -#define throwNotInvertible(i) throw(NotInvertible(__FILE__, __LINE__)) +#define THROW_NOTINVERTIBLE(i) throw(NotInvertible(__FILE__, __LINE__)) class ContinuityError : public RangeError { public: ContinuityError(const char *file, const int line) : RangeError("Non-contiguous path", file, line) {} }; -#define throwContinuityError(i) throw(ContinuityError(__FILE__, __LINE__)) +#define THROW_CONTINUITYERROR(i) throw(ContinuityError(__FILE__, __LINE__)) struct SVGPathParseError : public std::exception { char const *what() const throw() { return "parse error"; } |
