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
00047 #ifndef RECLS_INCL_RECLS_STL_HPP_RECLS
00048 #define RECLS_INCL_RECLS_STL_HPP_RECLS
00049
00050
00051 #ifndef RECLS_DOCUMENTATION_SKIP_SECTION
00052 # define RECLS_VER_RECLS_STL_HPP_RECLS_MAJOR 4
00053 # define RECLS_VER_RECLS_STL_HPP_RECLS_MINOR 1
00054 # define RECLS_VER_RECLS_STL_HPP_RECLS_REVISION 3
00055 # define RECLS_VER_RECLS_STL_HPP_RECLS_EDIT 23
00056 #endif
00057
00058
00059
00060
00061
00062 #include <recls/recls.h>
00063
00064 #if !defined(RECLS_VER_1_8_1) || \
00065 RECLS_VER < RECLS_VER_1_8_1
00066 # error The recls C++ mapping now requires version 1.8.1 or later of the recls core API
00067 #endif
00068
00069
00070 #if defined(RECLS_PLATFORM_IS_WIN32)
00071 # if !defined(RECLS_INCL_H_RECLS_FTP)
00072 # include <recls/ftp.h>
00073 # endif
00074 #endif
00075
00076 #include <stlsoft/stlsoft.h>
00077 #if !defined(_STLSOFT_VER_1_9_1_B22)
00078 # error STLSoft version 1.9.1 (beta 22) or greater required. (www.stlsoft.org/downloads.html)
00079 #endif
00080
00081 #ifdef RECLS_STL_STRING_HEADER
00082 # include RECLS_STL_STRING_HEADER
00083 #else
00084 # include <string>
00085 #endif
00086
00087 #if defined(RECLS_COMPILER_IS_DMC)
00088 # include <stlsoft/util/std/library_discriminator.hpp>
00089 #endif
00090 #include <stlsoft/memory/auto_buffer.hpp>
00091 #include <stlsoft/shims/access/string.hpp>
00092
00093 #ifdef RECLS_STL_METHOD_PROPERTY_SUPPORT
00094 # undef RECLS_STL_METHOD_PROPERTY_SUPPORT
00095 #endif
00096
00097 #if defined(RECLS_STL_FORCE_METHOD_PROPERTY_SUPPORT)
00098 # define RECLS_STL_METHOD_PROPERTY_SUPPORT
00099 #elif defined(RECLS_STL_NO_METHOD_PROPERTY_SUPPORT)
00100
00101 #else
00102 # if defined(STLSOFT_COMPILER_IS_BORLAND)
00103
00104 # elif defined(STLSOFT_COMPILER_IS_DMC)
00105 # if __DMC__ >= 0x0846
00106 # define RECLS_STL_METHOD_PROPERTY_SUPPORT */
00107 # endif
00108
00109 # elif defined(STLSOFT_COMPILER_IS_GCC) && \
00110 ( __GNUC__ >= 4 || \
00111 ( __GNUC__ == 3 && \
00112 __GNUC_MINOR__ >= 3))
00113 # define RECLS_STL_METHOD_PROPERTY_SUPPORT
00114 # elif defined(STLSOFT_COMPILER_IS_INTEL)
00115 # define RECLS_STL_METHOD_PROPERTY_SUPPORT
00116 # elif defined(STLSOFT_COMPILER_IS_MSVC)
00117 # if _MSC_VER >= 1310
00118 # define RECLS_STL_METHOD_PROPERTY_SUPPORT
00119 # endif
00120 # elif defined(STLSOFT_COMPILER_IS_MWERKS)
00121 # define RECLS_STL_METHOD_PROPERTY_SUPPORT
00122 # endif
00123 #endif
00124
00125 #ifdef RECLS_STL_METHOD_PROPERTY_SUPPORT
00126 # include <stlsoft/method_properties.hpp>
00127 #endif
00128
00129
00130
00131
00132
00133 #ifdef RECLS_STL_METHOD_PROPERTY_SUPPORT
00134 # define RECLS_STL_OPT_METHOD_PROPERTY_GET(V, R, C, GM, P) STLSOFT_METHOD_PROPERTY_GET(V, R, C, GM, P)
00135 # define RECLS_STL_OPT_METHOD_PROPERTY_GET_PROP(R, C, GM, P) STLSOFT_METHOD_PROPERTY_GET_EXTERNAL_PROP(R, C, GM, P)
00136 # define RECLS_STL_OPT_METHOD_PROPERTY_GETSET(V, RG, RS, C, GM, SM, P) STLSOFT_METHOD_PROPERTY_GETSET_EXTERNAL(RG, RS, C, GM, SM, P)
00137 # define RECLS_STL_OPT_METHOD_PROPERTY_DEFINE_OFFSET(C, P) STLSOFT_METHOD_PROPERTY_DEFINE_OFFSET(C, P)
00138 # define RECLS_STL_OPT_METHOD_PROPERTY_GETSET_PROP(RG, RS, C, GM, SM, P) STLSOFT_METHOD_PROPERTY_GETSET_EXTERNAL_PROP(RG, RS, C, GM, SM, P)
00139 #else
00140 # define RECLS_STL_OPT_METHOD_PROPERTY_GET(V, R, C, GM, P)
00141 # define RECLS_STL_OPT_METHOD_PROPERTY_GET_PROP(R, C, GM, P)
00142 # define RECLS_STL_OPT_METHOD_PROPERTY_GETSET(V, RG, RS, C, GM, SM, P)
00143 # define RECLS_STL_OPT_METHOD_PROPERTY_DEFINE_OFFSET(C, P)
00144 # define RECLS_STL_OPT_METHOD_PROPERTY_GETSET_PROP(RG, RS, C, GM, SM, P)
00145 #endif
00146
00147
00148
00149
00150
00151 #if !defined(RECLS_NO_NAMESPACE)
00152 namespace recls
00153 {
00154
00155 namespace stl
00156 {
00157 #endif
00158
00159
00160
00161
00162
00163 #ifdef RECLS_DOCUMENTATION_SKIP_SECTION
00164
00173 typedef std::string string_t;
00174
00175 #else
00176
00177 # ifdef RECLS_STL_STRING_HEADER
00178 # ifndef RECLS_STL_STRING_T
00179 # error RECLS_STL_STRING_T must be defined when RECLS_STL_STRING_HEADER is defined
00180 # endif
00181 typedef RECLS_STL_STRING_T string_t;
00182 # else
00183 typedef stlsoft_ns_qual_std(string) string_t;
00184 # endif
00185 #endif
00186
00187
00188
00189
00190
00192 class recls_exception
00193 : public std::exception
00194 {
00197 public:
00198 typedef std::exception parent_class_type;
00199 typedef recls_exception class_type;
00201
00204 public:
00206 explicit recls_exception(recls_rc_t rc)
00207 : m_rc(rc)
00208 , m_message(create_message_(rc))
00209 {}
00210 #ifdef STLSOFT_COMPILER_IS_GCC
00211 virtual ~recls_exception() throw()
00212 {}
00213 #endif
00215
00218 public:
00220 recls_rc_t rc() const
00221 {
00222 return m_rc;
00223 }
00224
00226 virtual char const *what() const throw()
00227 {
00228 return m_message.c_str();
00229 }
00231
00234 private:
00235 static string_t create_message_(recls_rc_t rc)
00236 {
00237 string_t msg(recls::Recls_GetErrorString(rc, NULL, 0), '~');
00238
00239 recls::Recls_GetErrorString(rc, &msg[0], msg.size());
00240
00241 return msg;
00242 }
00244
00247 private:
00248 const recls_rc_t m_rc;
00249 const string_t m_message;
00251
00254 private:
00255 class_type &operator =(class_type const &);
00257 };
00258
00259
00260
00261
00262
00263 #ifndef RECLS_DOCUMENTATION_SKIP_SECTION
00264 struct functions_impl
00265 {
00266 static string_t combine_paths(recls_char_t const *path1, recls_char_t const *path2)
00267 {
00268 stlsoft_ns_qual(auto_buffer)<recls_char_t> result(Recls_CombinePaths(path1, path2, NULL, 0));
00269
00270 Recls_CombinePaths(path1, path2, &result[0], result.size());
00271
00272 return string_t(result.data(), result.size());
00273 }
00274 static string_t derive_relative_path(recls_char_t const *origin, recls_char_t const *target)
00275 {
00276 stlsoft_ns_qual(auto_buffer)<recls_char_t> result(Recls_DeriveRelativePath(origin, target, NULL, 0));
00277
00278 Recls_DeriveRelativePath(origin, target, &result[0], result.size());
00279
00280 return string_t(result.data(), result.size());
00281 }
00282 static string_t squeeze_path(recls_char_t const *path, size_t width)
00283 {
00284 stlsoft_ns_qual(auto_buffer)<recls_char_t> result(width);
00285 size_t cch = Recls_SqueezePath(path, &result[0], result.size());
00286
00287
00288
00289 return string_t(result.data(), cch);
00290 }
00291 };
00292 #endif
00293
00294
00295 inline string_t combine_paths(string_t const &path1, string_t const &path2)
00296 {
00297 return functions_impl::combine_paths(stlsoft_ns_qual(c_str_ptr)(path1), stlsoft_ns_qual(c_str_ptr)(path2));
00298 }
00299
00300 inline string_t derive_relative_path(string_t const &origin, string_t const &target)
00301 {
00302 return functions_impl::derive_relative_path(stlsoft_ns_qual(c_str_ptr)(origin), stlsoft_ns_qual(c_str_ptr)(target));
00303 }
00304
00305 inline string_t squeeze_path(string_t const &path, size_t width)
00306 {
00307 return functions_impl::squeeze_path(stlsoft_ns_qual(c_str_ptr)(path), width);
00308 }
00309
00310
00311
00312
00313
00314 #if !defined(RECLS_NO_NAMESPACE)
00315 }
00316 }
00317 namespace reclstl = ::recls::stl;
00318 #endif
00319
00320
00321
00322 #endif
00323
00324