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 WINSTL_INCL_WINSTL_FILESYSTEM_HPP_ABSOLUTE_PATH
00048 #define WINSTL_INCL_WINSTL_FILESYSTEM_HPP_ABSOLUTE_PATH
00049
00050 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00051 # define WINSTL_VER_WINSTL_FILESYSTEM_HPP_ABSOLUTE_PATH_MAJOR 4
00052 # define WINSTL_VER_WINSTL_FILESYSTEM_HPP_ABSOLUTE_PATH_MINOR 2
00053 # define WINSTL_VER_WINSTL_FILESYSTEM_HPP_ABSOLUTE_PATH_REVISION 2
00054 # define WINSTL_VER_WINSTL_FILESYSTEM_HPP_ABSOLUTE_PATH_EDIT 67
00055 #endif
00056
00057
00058
00059
00060
00061 #ifndef WINSTL_INCL_WINSTL_H_WINSTL
00062 # include <winstl/winstl.h>
00063 #endif
00064 #ifndef STLSOFT_INCL_STLSOFT_STRING_HPP_SPECIAL_STRING_INSTANCE
00065 # include <stlsoft/string/special_string_instance.hpp>
00066 #endif
00067 #ifndef WINSTL_INCL_WINSTL_FILESYSTEM_HPP_FILESYSTEM_TRAITS
00068 # include <winstl/filesystem/filesystem_traits.hpp>
00069 #endif
00070 #ifndef WINSTL_INCL_WINSTL_MEMORY_HPP_PROCESSHEAP_ALLOCATOR
00071 # include <winstl/memory/processheap_allocator.hpp>
00072 #endif
00073 #ifndef STLSOFT_INCL_STLSOFT_SHIMS_ACCESS_HPP_STRING
00074 # include <stlsoft/shims/access/string.hpp>
00075 #endif
00076 #ifndef WINSTL_INCL_WINSTL_SHIMS_ACCESS_HPP_STRING
00077 # include <winstl/shims/access/string.hpp>
00078 #endif
00079
00080 #if defined(STLSOFT_COMPILER_IS_BORLAND)
00081
00082 # include <winstl/synch/spin_mutex.hpp>
00083 #endif
00084
00085
00086
00087
00088
00089 #ifndef _WINSTL_NO_NAMESPACE
00090 # if defined(_STLSOFT_NO_NAMESPACE) || \
00091 defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
00092
00093 namespace winstl
00094 {
00095 # else
00096
00097
00098 namespace stlsoft
00099 {
00100
00101 namespace winstl_project
00102 {
00103
00104 # endif
00105 #endif
00106
00107
00108
00109
00110
00116 template <ss_typename_param_k C>
00117 struct abspath_policy
00118 {
00121 public:
00122 typedef C char_type;
00123 typedef char_type const* argument_0_type;
00124 typedef processheap_allocator<C> allocator_type;
00125 typedef ws_size_t size_type;
00126 typedef size_type (*pfn_type)(argument_0_type, char_type *, size_type);
00127 #if defined(STLSOFT_COMPILER_IS_BORLAND)
00128
00129 typedef winstl::spin_mutex spin_mutex_type;
00130 #endif
00132
00135 public:
00136 enum { internalBufferSize = 128 };
00137
00138 enum { allowImplicitConversion = 1 };
00139
00140 enum { sharedState = 0 };
00142
00145 public:
00146 static pfn_type get_fn()
00147 {
00148 return winstl::filesystem_traits<char_type>::get_full_path_name;
00149 }
00151 };
00152
00153
00154
00155
00156
00157
00158
00159
00168 template <ss_typename_param_k C>
00169 class basic_absolute_path
00170 : public stlsoft_ns_qual(special_string_instance_1)<abspath_policy<C> >
00171 {
00174 private:
00175 typedef stlsoft_ns_qual(special_string_instance_1)<abspath_policy<C> > parent_class_type;
00176 public:
00178 typedef ss_typename_type_k parent_class_type::char_type char_type;
00180 typedef basic_absolute_path<C> class_type;
00182 typedef ss_typename_type_k parent_class_type::size_type size_type;
00184
00187 public:
00189 ss_explicit_k basic_absolute_path(char_type const* path)
00190 : parent_class_type(path)
00191 {}
00192 #ifdef STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT
00194 template<ss_typename_param_k S>
00195 ss_explicit_k basic_absolute_path(S const& path)
00196 : parent_class_type(stlsoft_ns_qual(c_str_ptr)(path))
00197 {}
00198 #endif
00200
00201
00205 private:
00206 basic_absolute_path(class_type const&);
00207 class_type& operator =(class_type const&);
00209 };
00210
00211
00212
00213
00214
00219 typedef basic_absolute_path<ws_char_a_t> absolute_path_a;
00224 typedef basic_absolute_path<ws_char_w_t> absolute_path_w;
00229 typedef basic_absolute_path<TCHAR> absolute_path;
00230
00231
00232
00233
00234
00235 #if !defined(STLSOFT_COMPILER_IS_MSVC) || \
00236 _MSC_VER >= 1100
00237
00242 template<ss_typename_param_k C>
00243 inline basic_absolute_path<C> make_absolute_path(C const* path)
00244 {
00245 return basic_absolute_path<C>(path);
00246 }
00247
00248 #endif
00249
00251
00252
00253 #ifdef STLSOFT_UNITTEST
00254 # include "./unittest/absolute_path_unittest_.h"
00255 #endif
00256
00257
00258
00259 #ifndef _WINSTL_NO_NAMESPACE
00260 # if defined(_STLSOFT_NO_NAMESPACE) || \
00261 defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
00262 }
00263 # else
00264 }
00265 }
00266 # endif
00267 #endif
00268
00269
00270
00271 #endif
00272
00273