aboutsummaryrefslogtreecommitdiff
path: root/cutl/fs/exception.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'cutl/fs/exception.hxx')
-rw-r--r--cutl/fs/exception.hxx36
1 files changed, 36 insertions, 0 deletions
diff --git a/cutl/fs/exception.hxx b/cutl/fs/exception.hxx
new file mode 100644
index 0000000..b412491
--- /dev/null
+++ b/cutl/fs/exception.hxx
@@ -0,0 +1,36 @@
+// file : cutl/fs/exception.hxx
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : Copyright (c) 2009 Code Synthesis Tools CC
+// license : MIT; see accompanying LICENSE file
+
+#ifndef CUTL_FS_EXCEPTION_HXX
+#define CUTL_FS_EXCEPTION_HXX
+
+#include <cutl/exception.hxx>
+
+namespace cutl
+{
+ namespace fs
+ {
+ struct error: exception
+ {
+ error (int code): code_ (code) {}
+
+ // Error code (errno).
+ //
+ int
+ code () const
+ {
+ return code_;
+ }
+
+ virtual char const*
+ what () const throw ();
+
+ private:
+ int code_;
+ };
+ }
+}
+
+#endif // CUTL_FS_EXCEPTION_HXX