diff options
author | Tavian Barnes <tavianator@gmail.com> | 2009-04-12 17:06:48 +0000 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2009-04-12 17:06:48 +0000 |
commit | 6cfdbf44cce0b0881d1811e7ec06c4e79e637c96 (patch) | |
tree | 185ce42e21f39d28611996bee6e10c109b3140ef /libdimensionxx | |
parent | b66a888acd9eb0b28c0e748c4506e267fe47360b (diff) | |
download | dimension-6cfdbf44cce0b0881d1811e7ec06c4e79e637c96.tar.xz |
Write C++ error handling wrapper.
Diffstat (limited to 'libdimensionxx')
-rw-r--r-- | libdimensionxx/Makefile.am | 2 | ||||
-rw-r--r-- | libdimensionxx/dimensionxx/error.hpp | 8 | ||||
-rw-r--r-- | libdimensionxx/error.cpp (renamed from libdimensionxx/geometry.cpp) | 15 |
3 files changed, 24 insertions, 1 deletions
diff --git a/libdimensionxx/Makefile.am b/libdimensionxx/Makefile.am index da8f544..143ab83 100644 --- a/libdimensionxx/Makefile.am +++ b/libdimensionxx/Makefile.am @@ -23,6 +23,6 @@ INCLUDES = -I../libdimension -I../libdimension-png lib_LTLIBRARIES = libdimensionxx.la -libdimensionxx_la_SOURCES = $(nobase_include_HEADERS) canvas.cpp color.cpp cookie.cpp geometry.cpp png.cpp +libdimensionxx_la_SOURCES = $(nobase_include_HEADERS) canvas.cpp color.cpp cookie.cpp error.cpp png.cpp libdimensionxx_la_LDFLAGS = -version-info 0:0:0 libdimensionxx_la_LIBADD = ../libdimension/libdimension.la ../libdimension-png/libdimension-png.la diff --git a/libdimensionxx/dimensionxx/error.hpp b/libdimensionxx/dimensionxx/error.hpp index a6a4ca6..072949f 100644 --- a/libdimensionxx/dimensionxx/error.hpp +++ b/libdimensionxx/dimensionxx/error.hpp @@ -25,6 +25,14 @@ namespace Dimension { + enum Severity { + SEVERITY_LOW = DMNSN_SEVERITY_LOW, + SEVERITY_MEDIUM = DMNSN_SEVERITY_MEDIUM, + SEVERITY_HIGH = DMNSN_SEVERITY_HIGH + }; + + Severity resilience(); + void resilience(Severity resilience); } #endif /* DIMENSIONXX_ERROR_HPP */ diff --git a/libdimensionxx/geometry.cpp b/libdimensionxx/error.cpp index 8b90fe9..fce453e 100644 --- a/libdimensionxx/geometry.cpp +++ b/libdimensionxx/error.cpp @@ -19,3 +19,18 @@ *************************************************************************/ #include "dimensionxx.hpp" + +namespace Dimension +{ + Severity + resilience() + { + return static_cast<Severity>(dmnsn_get_resilience()); + } + + void + resilience(Severity resilience) + { + dmnsn_set_resilience(static_cast<dmnsn_severity>(resilience)); + } +} |