00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00048 #ifndef STLSOFT_INCL_STLSOFT_ERROR_HPP_CONVERSION_ERROR
00049 #define STLSOFT_INCL_STLSOFT_ERROR_HPP_CONVERSION_ERROR
00050
00051 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00052 # define STLSOFT_VER_STLSOFT_ERROR_HPP_CONVERSION_ERROR_MAJOR 1
00053 # define STLSOFT_VER_STLSOFT_ERROR_HPP_CONVERSION_ERROR_MINOR 0
00054 # define STLSOFT_VER_STLSOFT_ERROR_HPP_CONVERSION_ERROR_REVISION 6
00055 # define STLSOFT_VER_STLSOFT_ERROR_HPP_CONVERSION_ERROR_EDIT 10
00056 #endif
00057
00058
00059
00060
00061
00062 #ifndef STLSOFT_INCL_STLSOFT_H_STLSOFT
00063 # include <stlsoft/stlsoft.h>
00064 #endif
00065
00066 #ifndef STLSOFT_INCL_STDEXCEPT
00067 # define STLSOFT_INCL_STDEXCEPT
00068 # include <stdexcept>
00069 #endif
00070 #ifndef STLSOFT_INCL_STRING
00071 # define STLSOFT_INCL_STRING
00072 # include <string>
00073 #endif
00074
00075
00076
00077
00078
00079 #ifndef _STLSOFT_NO_NAMESPACE
00080 namespace stlsoft
00081 {
00082 #endif
00083
00084
00085
00086
00087
00095 class conversion_error_base
00096 : public stlsoft_ns_qual_std(runtime_error)
00097 {
00100 public:
00102 typedef stlsoft_ns_qual_std(runtime_error) parent_class_type;
00104 typedef conversion_error_base class_type;
00106 typedef stlsoft_ns_qual_std(string) string_type;
00108
00111 protected:
00112 ss_explicit_k conversion_error_base(string_type const& message)
00113 : parent_class_type(message)
00114 {}
00115 ss_explicit_k conversion_error_base(char const* message)
00116 : parent_class_type(message)
00117 {}
00118 #if !defined(STLSOFT_COMPILER_IS_MSVC) || \
00119 _MSC_VER > 1200
00120
00121
00122 virtual ~conversion_error_base() stlsoft_throw_0() = 0;
00123 #endif
00125 };
00126
00131 class conversion_error
00132 : public conversion_error_base
00133 {
00136 public:
00138 typedef conversion_error_base parent_class_type;
00140 typedef conversion_error class_type;
00142 typedef stlsoft_ns_qual_std(string) string_type;
00144 typedef int error_code_type;
00146
00149 public:
00151 conversion_error(string_type const& message, error_code_type code)
00152 : parent_class_type(message)
00153 , m_code(code)
00154 {}
00156 conversion_error(char const* message, error_code_type code)
00157 : parent_class_type(message)
00158 , m_code(code)
00159 {}
00160
00161 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00162 public:
00163 conversion_error(class_type const& rhs)
00164 : parent_class_type(rhs)
00165 , m_code(rhs.m_code)
00166 {}
00167 virtual ~conversion_error() stlsoft_throw_0()
00168 {}
00169 private:
00170 class_type& operator =(class_type const&);
00171 #endif
00173
00176 public:
00177 error_code_type get_error_code() const
00178 {
00179 return m_code;
00180 }
00181
00182 error_code_type get_last_error() const
00183 {
00184 return get_error_code();
00185 }
00187
00190 private:
00191 const error_code_type m_code;
00193 };
00194
00195
00196
00197
00198
00199 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00200
00201 # if !defined(STLSOFT_COMPILER_IS_MSVC) || \
00202 _MSC_VER > 1200
00203 inline conversion_error_base::~conversion_error_base() stlsoft_throw_0()
00204 {}
00205 # endif
00206
00207 #endif
00208
00209
00210
00211 #ifndef _STLSOFT_NO_NAMESPACE
00212 }
00213 #endif
00214
00215
00216
00217 #endif
00218
00219