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
00041
00042
00043
00044
00045 #ifndef RECLS_DOCUMENTATION_SKIP_SECTION
00046 # define RECLS_VER_RECLS_CPP_HPP_RECLSHPP_MAJOR 3
00047 # define RECLS_VER_RECLS_CPP_HPP_RECLSHPP_MINOR 0
00048 # define RECLS_VER_RECLS_CPP_HPP_RECLSHPP_REVISION 2
00049 # define RECLS_VER_RECLS_CPP_HPP_RECLSHPP_EDIT 21
00050 #endif
00051
00056
00057
00058
00059
00060 #include <recls/recls.h>
00061
00062 #if RECLS_VER < RECLS_VER_1_9_1
00063 # error The recls C++ mapping now requires version 1.9.1 or later of the recls C API
00064 #endif
00065
00066 #include <stlsoft/stlsoft.h>
00067 #if !defined(_STLSOFT_VER_1_9_1)
00068 # error STLSoft version 1.9.1 or greater required. (www.stlsoft.org/downloads.html)
00069 #endif
00070
00071 #ifdef RECLS_CPP_STRING_HEADER
00072 # include RECLS_CPP_STRING_HEADER
00073 #else
00074 # include <string>
00075 #endif
00076
00077 #if defined(RECLS_COMPILER_IS_DMC)
00078 # include <stlsoft/iterator.hpp>
00079 #endif
00080
00081 #ifdef RECLS_CPP_METHOD_PROPERTY_SUPPORT
00082 # undef RECLS_CPP_METHOD_PROPERTY_SUPPORT
00083 #endif
00084
00085 #if defined(RECLS_CPP_FORCE_METHOD_PROPERTY_SUPPORT)
00086 # define RECLS_CPP_METHOD_PROPERTY_SUPPORT
00087 #elif defined(RECLS_CPP_NO_METHOD_PROPERTY_SUPPORT)
00088
00089 #else
00090 # if defined(STLSOFT_COMPILER_IS_BORLAND)
00091
00092 # elif defined(STLSOFT_COMPILER_IS_DMC)
00093
00094
00095
00096
00097 # elif defined(STLSOFT_COMPILER_IS_GCC) && \
00098 ( __GNUC__ >= 4 || \
00099 ( __GNUC__ == 3 && \
00100 __GNUC_MINOR__ >= 3))
00101 # define RECLS_CPP_METHOD_PROPERTY_SUPPORT
00102 # elif defined(STLSOFT_COMPILER_IS_INTEL)
00103 # define RECLS_CPP_METHOD_PROPERTY_SUPPORT
00104 # elif defined(STLSOFT_COMPILER_IS_MSVC)
00105 # if _MSC_VER >= 1310
00106 # define RECLS_CPP_METHOD_PROPERTY_SUPPORT
00107 # endif
00108 # elif defined(STLSOFT_COMPILER_IS_MWERKS)
00109 # define RECLS_CPP_METHOD_PROPERTY_SUPPORT
00110 # endif
00111 #endif
00112
00113 #ifdef RECLS_CPP_METHOD_PROPERTY_SUPPORT
00114 # include <stlsoft/method_properties.hpp>
00115 #endif
00116
00117
00118
00119
00120
00121 #ifdef RECLS_CPP_METHOD_PROPERTY_SUPPORT
00122 # define RECLS_CPP_OPT_METHOD_PROPERTY_GET(V, R, C, GM, P) STLSOFT_METHOD_PROPERTY_GET(V, R, C, GM, P)
00123 # define RECLS_CPP_OPT_METHOD_PROPERTY_GET_PROP(R, C, GM, P) STLSOFT_METHOD_PROPERTY_GET_EXTERNAL_PROP(R, C, GM, P)
00124 # define RECLS_CPP_OPT_METHOD_PROPERTY_GETSET(V, RG, RS, C, GM, SM, P) STLSOFT_METHOD_PROPERTY_GETSET_EXTERNAL(RG, RS, C, GM, SM, P)
00125 # define RECLS_CPP_OPT_METHOD_PROPERTY_DEFINE_OFFSET(C, P) STLSOFT_METHOD_PROPERTY_DEFINE_OFFSET(C, P)
00126 # define RECLS_CPP_OPT_METHOD_PROPERTY_GETSET_PROP(RG, RS, C, GM, SM, P) STLSOFT_METHOD_PROPERTY_GETSET_EXTERNAL_PROP(RG, RS, C, GM, SM, P)
00127 #else
00128 # define RECLS_CPP_OPT_METHOD_PROPERTY_GET(V, R, C, GM, P)
00129 # define RECLS_CPP_OPT_METHOD_PROPERTY_GET_PROP(R, C, GM, P)
00130 # define RECLS_CPP_OPT_METHOD_PROPERTY_GETSET(V, RG, RS, C, GM, SM, P)
00131 # define RECLS_CPP_OPT_METHOD_PROPERTY_DEFINE_OFFSET(C, P)
00132 # define RECLS_CPP_OPT_METHOD_PROPERTY_GETSET_PROP(RG, RS, C, GM, SM, P)
00133 #endif
00134
00135
00136
00137
00138
00139 #if !defined(RECLS_NO_NAMESPACE)
00140 namespace recls
00141 {
00142
00143 namespace cpp
00144 {
00145 #endif
00146
00147
00148
00149
00150
00151 #ifdef RECLS_DOCUMENTATION_SKIP_SECTION
00152
00161 typedef std::string string_t;
00162
00163 #else
00164
00165 # ifdef RECLS_CPP_STRING_HEADER
00166 # ifndef RECLS_CPP_STRING_T
00167 # error RECLS_CPP_STRING_T must be defined when RECLS_CPP_STRING_HEADER is defined
00168 # endif
00169 typedef RECLS_CPP_STRING_T string_t;
00170 # else
00171 # if defined(RECLS_COMPILER_IS_DMC) && \
00172 !defined(STLSOFT_CF_STD_LIBRARY_IS_STLPORT)
00173 typedef string string_t;
00174 # else
00175 typedef std::string string_t;
00176 # endif
00177 # endif
00178 #endif
00179
00180
00181
00182
00183
00185 class ReclsException
00186 : public std::exception
00187 {
00190 public:
00191 typedef std::exception parent_class_type;
00192 typedef ReclsException class_type;
00194
00197 public:
00199 explicit ReclsException(recls_rc_t rc)
00200 : m_rc(rc)
00201 , m_message(create_message_(rc))
00202 {}
00203 #ifdef STLSOFT_COMPILER_IS_GCC
00204 virtual ~ReclsException() throw()
00205 {}
00206 #endif
00207
00208
00211 public:
00213 recls_rc_t rc() const
00214 {
00215 return m_rc;
00216 }
00217
00219 virtual char const *what() const throw()
00220 {
00221 return m_message.c_str();
00222 }
00224
00227 private:
00228 static string_t create_message_(recls_rc_t rc)
00229 {
00230 string_t msg(recls::Recls_GetErrorString(rc, NULL, 0), '~');
00231
00232 recls::Recls_GetErrorString(rc, &msg[0], msg.size());
00233
00234 return msg;
00235 }
00237
00240 private:
00241 const recls_rc_t m_rc;
00242 const string_t m_message;
00244
00245
00246 private:
00247 class_type &operator =(class_type const &);
00248 };
00249
00250
00251
00252
00253
00254 #if !defined(RECLS_NO_NAMESPACE)
00255 }
00256 }
00257 namespace reclspp = ::recls::cpp;
00258 #endif
00259
00260
00261
00262
00263
00264