aboutsummaryrefslogtreecommitdiff
path: root/libcutl/fs/exception.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'libcutl/fs/exception.hxx')
-rw-r--r--libcutl/fs/exception.hxx36
1 files changed, 36 insertions, 0 deletions
diff --git a/libcutl/fs/exception.hxx b/libcutl/fs/exception.hxx
new file mode 100644
index 0000000..511d86f
--- /dev/null
+++ b/libcutl/fs/exception.hxx
@@ -0,0 +1,36 @@
+// file : libcutl/fs/exception.hxx
+// license : MIT; see accompanying LICENSE file
+
+#ifndef LIBCUTL_FS_EXCEPTION_HXX
+#define LIBCUTL_FS_EXCEPTION_HXX
+
+#include <libcutl/exception.hxx>
+
+#include <libcutl/export.hxx>
+
+namespace cutl
+{
+ namespace fs
+ {
+ struct LIBCUTL_EXPORT error: exception
+ {
+ error (int code): code_ (code) {}
+
+ // Error code (errno).
+ //
+ int
+ code () const
+ {
+ return code_;
+ }
+
+ virtual char const*
+ what () const noexcept;
+
+ private:
+ int code_;
+ };
+ }
+}
+
+#endif // LIBCUTL_FS_EXCEPTION_HXX