summaryrefslogtreecommitdiff
path: root/libodb-oracle/odb/oracle/exceptions.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'libodb-oracle/odb/oracle/exceptions.hxx')
-rw-r--r--libodb-oracle/odb/oracle/exceptions.hxx135
1 files changed, 135 insertions, 0 deletions
diff --git a/libodb-oracle/odb/oracle/exceptions.hxx b/libodb-oracle/odb/oracle/exceptions.hxx
new file mode 100644
index 0000000..d21b742
--- /dev/null
+++ b/libodb-oracle/odb/oracle/exceptions.hxx
@@ -0,0 +1,135 @@
+// file : odb/oracle/exceptions.hxx
+// license : ODB NCUEL; see accompanying LICENSE file
+
+#ifndef ODB_ORACLE_EXCEPTIONS_HXX
+#define ODB_ORACLE_EXCEPTIONS_HXX
+
+#include <odb/pre.hxx>
+
+#include <string>
+#include <vector>
+
+#include <odb/exceptions.hxx>
+#include <odb/details/config.hxx> // ODB_NOTHROW_NOEXCEPT
+
+#include <odb/oracle/version.hxx>
+#include <odb/oracle/forward.hxx>
+#include <odb/oracle/oracle-fwd.hxx>
+#include <odb/oracle/details/export.hxx>
+
+namespace odb
+{
+ namespace oracle
+ {
+ struct LIBODB_ORACLE_EXPORT database_exception: odb::database_exception
+ {
+ struct record
+ {
+ record (sb4 error, const std::string& message);
+
+ sb4
+ error () const
+ {
+ return error_;
+ }
+
+ const std::string&
+ message () const
+ {
+ return message_;
+ }
+
+ private:
+ sb4 error_;
+ std::string message_;
+ };
+
+ typedef std::vector<record> records;
+
+ typedef records::size_type size_type;
+ typedef records::const_iterator iterator;
+
+ iterator
+ begin () const
+ {
+ return records_.begin ();
+ }
+
+ iterator
+ end () const
+ {
+ return records_.end ();
+ }
+
+ size_type
+ size () const
+ {
+ return records_.size ();
+ }
+
+ public:
+ ~database_exception () ODB_NOTHROW_NOEXCEPT;
+
+ database_exception ();
+ database_exception (sb4 error, const std::string& message);
+
+ virtual const char*
+ what () const ODB_NOTHROW_NOEXCEPT;
+
+ virtual database_exception*
+ clone () const;
+
+ void
+ append (sb4 error, const std::string& message);
+
+ private:
+ records records_;
+ std::string what_;
+ };
+
+ struct LIBODB_ORACLE_EXPORT lob_comparison: odb::exception
+ {
+ virtual const char*
+ what () const ODB_NOTHROW_NOEXCEPT;
+
+ virtual lob_comparison*
+ clone () const;
+ };
+
+ struct LIBODB_ORACLE_EXPORT cli_exception: odb::exception
+ {
+ cli_exception (const std::string& what);
+ ~cli_exception () ODB_NOTHROW_NOEXCEPT;
+
+ virtual const char*
+ what () const ODB_NOTHROW_NOEXCEPT;
+
+ virtual cli_exception*
+ clone () const;
+
+ private:
+ std::string what_;
+ };
+
+ struct LIBODB_ORACLE_EXPORT invalid_oci_handle: odb::exception
+ {
+ virtual const char*
+ what () const ODB_NOTHROW_NOEXCEPT;
+
+ virtual invalid_oci_handle*
+ clone () const;
+ };
+
+ namespace core
+ {
+ using oracle::database_exception;
+ using oracle::lob_comparison;
+ using oracle::cli_exception;
+ using oracle::invalid_oci_handle;
+ }
+ }
+}
+
+#include <odb/post.hxx>
+
+#endif // ODB_ORACLE_EXCEPTIONS_HXX