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 DOTNETSTL_INCL_DOTNETSTL_SHIMS_ACCESS_STRING_HPP_STRING
00049 #define DOTNETSTL_INCL_DOTNETSTL_SHIMS_ACCESS_STRING_HPP_STRING
00050
00051 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00052 # define DOTNETSTL_VER_DOTNETSTL_SHIMS_ACCESS_STRING_HPP_STRING_MAJOR 2
00053 # define DOTNETSTL_VER_DOTNETSTL_SHIMS_ACCESS_STRING_HPP_STRING_MINOR 0
00054 # define DOTNETSTL_VER_DOTNETSTL_SHIMS_ACCESS_STRING_HPP_STRING_REVISION 4
00055 # define DOTNETSTL_VER_DOTNETSTL_SHIMS_ACCESS_STRING_HPP_STRING_EDIT 20
00056 #endif
00057
00058
00059
00060
00061
00062 #ifndef DOTNETSTL_INCL_DOTNETSTL_HPP_DOTNETSTL
00063 # include <dotnetstl/dotnetstl.hpp>
00064 #endif
00065 #ifndef DOTNETSTL_INCL_DOTNETSTL_STRING_HPP_STRING_ACCESSOR
00066 # include <dotnetstl/string/string_accessor.hpp>
00067 #endif
00068
00069 #ifndef STLSOFT_INCL_H_STRING
00070 # define STLSOFT_INCL_H_STRING
00071 # include <string.h>
00072 #endif
00073
00074
00075
00076 #ifdef _STLSOFT_NO_NAMESPACE
00077
00078 namespace dotnetstl
00079 {
00080 #else
00081
00082
00083 namespace stlsoft
00084 {
00085
00086 namespace dotnetstl_project
00087 {
00088
00089 #endif
00090
00091
00092
00093
00094
00095 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00096
00097 namespace impl
00098 {
00099 typedef c_string_accessor<char> accessor_a_t;
00100 typedef c_string_accessor<wchar_t> accessor_w_t;
00101 #ifdef UNICODE
00102 typedef accessor_w_t accessor_t_t;
00103 #else
00104 typedef accessor_a_t accessor_t_t;
00105 #endif
00106
00107 #if defined(DOTNETSTL_HAT_SYNTAX_SUPPORT)
00108 typedef System::String const ^string_pointer_const_type;
00109 typedef System::String ^string_pointer_type;
00110 #else
00111 typedef System::String const* string_pointer_const_type;
00112 typedef System::String* string_pointer_type;
00113 #endif
00114
00115 }
00116
00117 #endif
00118
00119
00120
00121 inline impl::accessor_a_t c_str_data_a(impl::string_pointer_const_type s)
00122 {
00123 return impl::accessor_a_t(s);
00124 }
00125
00126 inline impl::accessor_w_t c_str_data_w(impl::string_pointer_const_type s)
00127 {
00128 return impl::accessor_w_t(s);
00129 }
00130
00131 inline impl::accessor_t_t c_str_data(impl::string_pointer_const_type s)
00132 {
00133 return impl::accessor_t_t(s);
00134 }
00135
00136
00137
00138 inline ds_size_t c_str_len_a(impl::string_pointer_const_type s)
00139 {
00140 return ::strlen(c_str_data_a(s));
00141 }
00142
00143 inline ds_size_t c_str_len_w(impl::string_pointer_const_type s)
00144 {
00145 #if defined(DOTNETSTL_HAT_SYNTAX_SUPPORT)
00146 if(nullptr == s)
00147 #else
00148 if(NULL == s)
00149 #endif
00150 {
00151 return 0;
00152 }
00153 else
00154 {
00155 impl::string_pointer_type s_ = const_cast<impl::string_pointer_type>(s);
00156
00157 #if defined(DOTNETSTL_HAT_SYNTAX_SUPPORT)
00158 return static_cast<ds_size_t>(s_->Length);
00159 #else
00160 return static_cast<ds_size_t>(s_->get_Length());
00161 #endif
00162 }
00163 }
00164
00165 inline ds_size_t c_str_len(impl::string_pointer_const_type s)
00166 {
00167 return c_str_len_w(s);
00168 }
00169
00170
00171 inline impl::accessor_a_t c_str_ptr_a(impl::string_pointer_const_type s)
00172 {
00173 return impl::accessor_a_t(s);
00174 }
00175
00176 inline impl::accessor_w_t c_str_ptr_w(impl::string_pointer_const_type s)
00177 {
00178 return impl::accessor_w_t(s);
00179 }
00180
00181 inline impl::accessor_t_t c_str_ptr(impl::string_pointer_const_type s)
00182 {
00183 return impl::accessor_t_t(s);
00184 }
00185
00187
00188
00189 #ifdef STLSOFT_UNITTEST
00190 # include "./unittest/string_unittest_.h"
00191 #endif
00192
00193
00194
00195 #ifdef _STLSOFT_NO_NAMESPACE
00196 }
00197 #else
00198 }
00199 }
00200 #endif
00201
00202
00203
00204
00205
00206
00207
00208
00209 #ifndef _DOTNETSTL_NO_NAMESPACE
00210 # if !defined(_STLSOFT_NO_NAMESPACE) && \
00211 !defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
00212 namespace stlsoft
00213 {
00214 # else
00215
00216 # endif
00217
00218 using ::dotnetstl::c_str_data;
00219 using ::dotnetstl::c_str_data_a;
00220 using ::dotnetstl::c_str_data_w;
00221
00222 using ::dotnetstl::c_str_len;
00223 using ::dotnetstl::c_str_len_a;
00224 using ::dotnetstl::c_str_len_w;
00225
00226 using ::dotnetstl::c_str_ptr;
00227 using ::dotnetstl::c_str_ptr_a;
00228 using ::dotnetstl::c_str_ptr_w;
00229
00230 #if 0
00231 using ::dotnetstl::c_str_ptr_null;
00232 using ::dotnetstl::c_str_ptr_null_a;
00233 using ::dotnetstl::c_str_ptr_null_w;
00234 #endif
00235
00236 # if !defined(_STLSOFT_NO_NAMESPACE) && \
00237 !defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
00238 }
00239 # else
00240
00241 # endif
00242 #endif
00243
00244
00245
00246 #endif
00247
00248