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 UNIXSTL_INCL_UNIXSTL_FILESYSTEM_HPP_PATH
00048 #define UNIXSTL_INCL_UNIXSTL_FILESYSTEM_HPP_PATH
00049
00050 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00051 # define UNIXSTL_VER_UNIXSTL_FILESYSTEM_HPP_PATH_MAJOR 6
00052 # define UNIXSTL_VER_UNIXSTL_FILESYSTEM_HPP_PATH_MINOR 6
00053 # define UNIXSTL_VER_UNIXSTL_FILESYSTEM_HPP_PATH_REVISION 2
00054 # define UNIXSTL_VER_UNIXSTL_FILESYSTEM_HPP_PATH_EDIT 234
00055 #endif
00056
00057
00058
00059
00060
00061 #ifndef UNIXSTL_INCL_UNIXSTL_H_UNIXSTL
00062 # include <unixstl/unixstl.h>
00063 #endif
00064 #ifndef UNIXSTL_INCL_UNIXSTL_FILESYSTEM_HPP_FILESYSTEM_TRAITS
00065 # include <unixstl/filesystem/filesystem_traits.hpp>
00066 #endif
00067 #ifndef UNIXSTL_INCL_UNIXSTL_FILESYSTEM_HPP_FILE_PATH_BUFFER
00068 # include <unixstl/filesystem/file_path_buffer.hpp>
00069 #endif
00070 #ifdef STLSOFT_CF_EXCEPTION_SUPPORT
00071 # ifndef UNIXSTL_INCL_UNIXSTL_ERROR_HPP_WINDOWS_EXCEPTIONS
00072 # include <unixstl/error/exceptions.hpp>
00073 # endif
00074 #endif
00075 #ifndef STLSOFT_INCL_STLSOFT_MEMORY_HPP_ALLOCATOR_BASE
00076 # include <stlsoft/memory/allocator_base.hpp>
00077 #endif
00078 #ifndef STLSOFT_INCL_STLSOFT_MEMORY_HPP_ALLOCATOR_SELECTOR
00079 # include <stlsoft/memory/allocator_selector.hpp>
00080 #endif
00081 #ifndef STLSOFT_INCL_STLSOFT_SHIMS_ACCESS_HPP_STRING
00082 # include <stlsoft/shims/access/string.hpp>
00083 #endif
00084 #ifndef UNIXSTL_INCL_UNIXSTL_SHIMS_ACCESS_HPP_STRING
00085 # include <unixstl/shims/access/string.hpp>
00086 #endif
00087 #ifndef STLSOFT_INCL_STLSOFT_MEMORY_HPP_AUTO_BUFFER
00088 # include <stlsoft/memory/auto_buffer.hpp>
00089 #endif
00090 #ifndef STLSOFT_INCL_STLSOFT_STRING_HPP_COPY_FUNCTIONS
00091 # include <stlsoft/string/copy_functions.hpp>
00092 #endif
00093 #ifndef STLSOFT_INCL_STLSOFT_UTIL_HPP_STD_SWAP
00094 # include <stlsoft/util/std_swap.hpp>
00095 #endif
00096
00097 #ifndef STLSOFT_INCL_STDEXCEPT
00098 # define STLSOFT_INCL_STDEXCEPT
00099 # include <stdexcept>
00100 #endif
00101 #ifdef _WIN32
00102 # include <ctype.h>
00103 #endif
00104
00105
00106
00107
00108
00109 #ifndef _UNIXSTL_NO_NAMESPACE
00110 # if defined(_STLSOFT_NO_NAMESPACE) || \
00111 defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
00112
00113 namespace unixstl
00114 {
00115 # else
00116
00117
00118 namespace stlsoft
00119 {
00120
00121 namespace unixstl_project
00122 {
00123
00124 # endif
00125 #endif
00126
00127
00128
00129
00130
00131
00132
00148 template< ss_typename_param_k C
00149 #ifdef STLSOFT_CF_TEMPLATE_CLASS_DEFAULT_CLASS_ARGUMENT_SUPPORT
00150 , ss_typename_param_k T = filesystem_traits<C>
00151 , ss_typename_param_k A = ss_typename_type_def_k stlsoft_ns_qual(allocator_selector)<C>::allocator_type
00152 #else
00153 , ss_typename_param_k T
00154 , ss_typename_param_k A
00155 #endif
00156 >
00157 class basic_path
00158 {
00161 public:
00163 typedef C char_type;
00165 typedef T traits_type;
00167 typedef A allocator_type;
00169 typedef basic_path<C, T, A> class_type;
00171 typedef us_size_t size_type;
00173 typedef us_bool_t bool_type;
00174
00175
00176
00178
00181 public:
00183 basic_path();
00185 ss_explicit_k basic_path(char_type const* path);
00186 #ifdef STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT
00188 template<ss_typename_param_k S>
00189 ss_explicit_k basic_path(S const& s)
00190 {
00191 m_len = stlsoft_ns_qual(c_str_len)(s);
00192
00193 traits_type::str_n_copy(&m_buffer[0], stlsoft_ns_qual(c_str_data)(s), m_len);
00194 m_buffer[m_len] = '\0';
00195 }
00196 #endif
00198 basic_path(char_type const* path, size_type cch);
00199
00200 #ifndef STLSOFT_CF_NO_COPY_CTOR_AND_COPY_CTOR_TEMPLATE_OVERLOAD
00202 basic_path(class_type const& rhs);
00203 #endif
00204
00205 #ifndef STLSOFT_CF_NO_COPY_CTOR_AND_COPY_CTOR_TEMPLATE_OVERLOAD
00207 class_type& operator =(class_type const& rhs);
00208 #endif
00210 class_type& operator =(char_type const* rhs);
00211 #ifdef STLSOFT_CF_MEMBER_TEMPLATE_FUNCTION_SUPPORT
00213 template<ss_typename_param_k S>
00214 class_type& operator =(S const& s)
00215 {
00216 return operator_equal_(stlsoft_ns_qual(c_str_ptr)(s));
00217 }
00218 #endif
00219
00220
00221 static class_type root(char_type const* s);
00222 #ifdef STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT
00223
00224 template<ss_typename_param_k S>
00225 static class_type root(S const& s)
00226 {
00227 return root(stlsoft_ns_qual(c_str_ptr)(s));
00228 }
00229 #endif
00231
00234 public:
00236 class_type& push(class_type const& rhs, bool_type bAddPathNameSeparator = false);
00238 class_type& push(char_type const* rhs, bool_type bAddPathNameSeparator = false);
00240 class_type& push_ext(class_type const& rhs, bool_type bAddPathNameSeparator = false);
00242 class_type& push_ext(char_type const* rhs, bool_type bAddPathNameSeparator = false);
00244 class_type& push_sep();
00251 class_type& pop(bool_type bRemoveTrailingPathNameSeparator = true);
00255 class_type& pop_sep();
00257 class_type& pop_ext();
00258
00260 class_type& operator /=(char_type const* rhs);
00261
00262 #if !defined(STLSOFT_CF_MEMBER_TEMPLATE_FUNCTION_SUPPORT) || \
00263 defined(STLSOFT_CF_MEMBER_TEMPLATE_OVERLOAD_DISCRIMINATED)
00265 class_type& operator /=(class_type const& rhs);
00266 #endif
00267
00268 #if defined(STLSOFT_CF_MEMBER_TEMPLATE_FUNCTION_SUPPORT)
00270 template <ss_typename_param_k S>
00271 class_type& operator /=(S const& rhs)
00272 {
00273 return push(stlsoft_ns_qual(c_str_ptr)(rhs));
00274 }
00275 #endif
00276
00278 void clear();
00279
00281 class_type& make_absolute(bool_type bRemoveTrailingPathNameSeparator = true);
00283 class_type& canonicalise(bool_type bRemoveTrailingPathNameSeparator = true);
00285
00288 public:
00295 char_type const* get_file() const;
00297 char_type const* get_ext() const;
00299 size_type length() const;
00303 size_type size() const;
00305 static size_type max_size();
00307 bool_type empty() const;
00309 char_type const* c_str() const;
00314 char_type const& operator [](size_type index) const;
00316 bool_type exists() const;
00318 bool_type is_rooted() const;
00320 bool_type is_absolute() const;
00322 bool_type has_sep() const;
00323
00329 size_type copy(char_type *buffer, size_type cchBuffer) const;
00331
00334 public:
00335 bool_type equivalent(char_type const* rhs) const;
00336 bool_type equivalent(class_type const& rhs) const;
00337
00338 bool_type equal(char_type const* rhs) const;
00339 bool_type equal(class_type const& rhs) const;
00341
00344 public:
00345 #if 0
00346 directory_iterator dir_begin() const;
00347 directory_iterator dir_end() const;
00348 #endif
00350
00351
00352 private:
00353 class_type& operator_equal_(char_type const* path);
00354
00355 void swap(class_type& rhs);
00356 class_type& concat_(char_type const* rhs);
00357 class_type& concat_(class_type const& rhs);
00358
00359 static char_type const *next_slash_or_end(char_type const* p);
00360 static char_type path_name_separator_alt();
00361
00362
00363 private:
00364 typedef basic_file_path_buffer<
00365 char_type
00366 , allocator_type
00367 > buffer_type_;
00368
00369 struct part
00370 {
00371 enum Type
00372 {
00373 normal
00374 , dot
00375 , dotdot
00376 };
00377
00378 size_type len;
00379 char_type const* p;
00380 Type type;
00381 };
00382
00383 buffer_type_ m_buffer;
00384 size_type m_len;
00385 };
00386
00387
00388
00389
00390
00395 typedef basic_path<us_char_a_t, filesystem_traits<us_char_a_t> > path_a;
00400 typedef basic_path<us_char_w_t, filesystem_traits<us_char_w_t> > path_w;
00405 typedef basic_path<us_char_a_t, filesystem_traits<us_char_a_t> > path;
00406
00407
00408
00409
00410
00411
00412 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00413
00414 template< ss_typename_param_k C
00415 # ifdef STLSOFT_CF_TEMPLATE_CLASS_DEFAULT_CLASS_ARGUMENT_SUPPORT
00416 , ss_typename_param_k T = filesystem_traits<C>
00417 , ss_typename_param_k A = ss_typename_type_def_k stlsoft_ns_qual(allocator_selector)<C>::allocator_type
00418 # else
00419 , ss_typename_param_k T
00420 , ss_typename_param_k A
00421 # endif
00422 >
00423 class basic_path__
00424 : public unixstl_ns_qual(basic_path)<C, T, A>
00425 {
00426 private:
00427 typedef unixstl_ns_qual(basic_path)<C, T, A> parent_class_type;
00428 typedef unixstl_ns_qual(basic_path__)<C, T, A> class_type;
00429 public:
00430 typedef ss_typename_type_k parent_class_type::char_type char_type;
00431 typedef ss_typename_type_k parent_class_type::traits_type traits_type;
00432 typedef ss_typename_type_k parent_class_type::allocator_type allocator_type;
00433 typedef ss_typename_type_k parent_class_type::size_type size_type;
00434
00435 public:
00436 basic_path__()
00437 : parent_class_type()
00438 {}
00439 ss_explicit_k basic_path__(char_type const* path)
00440 : parent_class_type(path)
00441 {}
00442 # ifdef STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT
00444 template<ss_typename_param_k S>
00445 ss_explicit_k basic_path__(S const& s)
00446 : parent_class_type(s)
00447 {}
00448 # endif
00449 basic_path__(char_type const* path, size_type cch)
00450 : parent_class_type(path, cch)
00451 {}
00452 basic_path__(class_type const& rhs)
00453 : parent_class_type(rhs)
00454 {}
00455
00456 class_type& operator =(class_type const& rhs)
00457 {
00458 parent_class_type::operator =(rhs);
00459
00460 return *this;
00461 }
00462 class_type& operator =(char_type const* rhs)
00463 {
00464 parent_class_type::operator =(rhs);
00465
00466 return *this;
00467 }
00468 # ifdef STLSOFT_CF_MEMBER_TEMPLATE_FUNCTION_SUPPORT
00469 template<ss_typename_param_k S>
00470 class_type& operator =(S const& s)
00471 {
00472 parent_class_type::operator =(s);
00473
00474 return *this;
00475 }
00476 # endif
00477 };
00478
00479 #endif
00480
00481
00482
00483
00484
00485 template< ss_typename_param_k C
00486 , ss_typename_param_k T
00487 , ss_typename_param_k A
00488 >
00489 inline us_bool_t operator ==(basic_path<C, T, A> const& lhs, ss_typename_type_k basic_path<C, T, A>::char_type const* rhs)
00490 {
00491 return lhs.equal(rhs);
00492 }
00493
00494 template< ss_typename_param_k C
00495 , ss_typename_param_k T
00496 , ss_typename_param_k A
00497 >
00498 inline us_bool_t operator !=(basic_path<C, T, A> const& lhs, ss_typename_type_k basic_path<C, T, A>::char_type const* rhs)
00499 {
00500 return !lhs.equal(rhs);
00501 }
00502
00503 template< ss_typename_param_k C
00504 , ss_typename_param_k T
00505 , ss_typename_param_k A
00506 >
00507 inline us_bool_t operator ==(ss_typename_type_k basic_path<C, T, A>::char_type const* lhs, basic_path<C, T, A> const& rhs)
00508 {
00509 return rhs.equal(lhs);
00510 }
00511
00512 template< ss_typename_param_k C
00513 , ss_typename_param_k T
00514 , ss_typename_param_k A
00515 >
00516 inline us_bool_t operator !=(ss_typename_type_k basic_path<C, T, A>::char_type const* lhs, basic_path<C, T, A> const& rhs)
00517 {
00518 return !rhs.equal(lhs);
00519 }
00520
00521 template< ss_typename_param_k C
00522 , ss_typename_param_k T
00523 , ss_typename_param_k A
00524 >
00525 inline us_bool_t operator ==(basic_path<C, T, A> const& lhs, basic_path<C, T, A> const& rhs)
00526 {
00527 return lhs.equal(rhs);
00528 }
00529
00530 template< ss_typename_param_k C
00531 , ss_typename_param_k T
00532 , ss_typename_param_k A
00533 >
00534 inline us_bool_t operator !=(basic_path<C, T, A> const& lhs, basic_path<C, T, A> const& rhs)
00535 {
00536 return !lhs.equal(rhs);
00537 }
00538
00539
00540
00545 template< ss_typename_param_k C
00546 , ss_typename_param_k T
00547 , ss_typename_param_k A
00548 >
00549 inline basic_path<C, T, A> operator /(basic_path<C, T, A> const& lhs, ss_typename_type_k basic_path<C, T, A>::char_type const* rhs)
00550 {
00551 return basic_path<C, T, A>(lhs) /= rhs;
00552 }
00553
00558 template< ss_typename_param_k C
00559 , ss_typename_param_k T
00560 , ss_typename_param_k A
00561 >
00562 inline basic_path<C, T, A> operator /(ss_typename_type_k basic_path<C, T, A>::char_type const* lhs, basic_path<C, T, A> const& rhs)
00563 {
00564 return basic_path<C, T, A>(lhs) /= rhs;
00565 }
00566
00571 template< ss_typename_param_k C
00572 , ss_typename_param_k T
00573 , ss_typename_param_k A
00574 >
00575 inline basic_path<C, T, A> operator /(basic_path<C, T, A> const& lhs, basic_path<C, T, A> const& rhs)
00576 {
00577 return basic_path<C, T, A>(lhs) /= rhs;
00578 }
00579
00580
00581
00582
00583
00584 #if !defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
00585 # if !defined(STLSOFT_COMPILER_IS_MSVC) || \
00586 _MSC_VER >= 1100
00587
00593 template<ss_typename_param_k C>
00594 inline basic_path<C> make_path(C const* path)
00595 {
00596 return basic_path<C>(path);
00597 }
00598
00599 # endif
00600 #endif
00601
00602
00603
00604
00605
00606 template< ss_typename_param_k C
00607 , ss_typename_param_k T
00608 , ss_typename_param_k A
00609 >
00610 inline void swap(basic_path<C, T, A>& lhs, basic_path<C, T, A>& rhs)
00611 {
00612 lhs.swap(rhs);
00613 }
00614
00615
00616
00617
00618
00623 template< ss_typename_param_k C
00624 , ss_typename_param_k T
00625 , ss_typename_param_k A
00626 >
00627 inline C const* c_str_data(unixstl_ns_qual(basic_path)<C, T, A> const& b)
00628 {
00629 return b.c_str();
00630 }
00631
00632 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00633
00634 template <ss_typename_param_k T, ss_typename_param_k A>
00635 inline us_char_a_t const* c_str_data_a(unixstl_ns_qual(basic_path)<us_char_a_t, T, A> const& b)
00636 {
00637 return b.c_str();
00638 }
00639 template <ss_typename_param_k T, ss_typename_param_k A>
00640 inline us_char_w_t const* c_str_data_w(unixstl_ns_qual(basic_path)<us_char_w_t, T, A> const& b)
00641 {
00642 return b.c_str();
00643 }
00644
00645 #endif
00646
00651 template< ss_typename_param_k C
00652 , ss_typename_param_k T
00653 , ss_typename_param_k A
00654 >
00655 inline us_size_t c_str_len(unixstl_ns_qual(basic_path)<C, T, A> const& b)
00656 {
00657 return stlsoft_ns_qual(c_str_len)(b.c_str());
00658 }
00659
00660 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00661
00662 template <ss_typename_param_k T, ss_typename_param_k A>
00663 inline us_size_t c_str_len_a(unixstl_ns_qual(basic_path)<us_char_a_t, T, A> const& b)
00664 {
00665 return stlsoft_ns_qual(c_str_len_a)(b.c_str());
00666 }
00667 template <ss_typename_param_k T, ss_typename_param_k A>
00668 inline us_size_t c_str_len_w(unixstl_ns_qual(basic_path)<us_char_w_t, T, A> const& b)
00669 {
00670 return stlsoft_ns_qual(c_str_len_w)(b.c_str());
00671 }
00672
00673 #endif
00674
00675
00676
00681 template< ss_typename_param_k C
00682 , ss_typename_param_k T
00683 , ss_typename_param_k A
00684 >
00685 inline C const* c_str_ptr(unixstl_ns_qual(basic_path)<C, T, A> const& b)
00686 {
00687 return b.c_str();
00688 }
00689
00690 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00691
00692 template <ss_typename_param_k T, ss_typename_param_k A>
00693 inline us_char_a_t const* c_str_ptr_a(unixstl_ns_qual(basic_path)<us_char_a_t, T, A> const& b)
00694 {
00695 return b.c_str();
00696 }
00697 template <ss_typename_param_k T, ss_typename_param_k A>
00698 inline us_char_w_t const* c_str_ptr_w(unixstl_ns_qual(basic_path)<us_char_w_t, T, A> const& b)
00699 {
00700 return b.c_str();
00701 }
00702
00703 #endif
00704
00705
00706
00711 template< ss_typename_param_k C
00712 , ss_typename_param_k T
00713 , ss_typename_param_k A
00714 >
00715 inline C const* c_str_ptr_null(unixstl_ns_qual(basic_path)<C, T, A> const& b)
00716 {
00717 return stlsoft_ns_qual(c_str_ptr_null)(b.c_str());
00718 }
00719
00720 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00721
00722 template <ss_typename_param_k T, ss_typename_param_k A>
00723 inline us_char_a_t const* c_str_ptr_null_a(unixstl_ns_qual(basic_path)<us_char_a_t, T, A> const& b)
00724 {
00725 return stlsoft_ns_qual(c_str_ptr_null_a)(b.c_str());
00726 }
00727 template <ss_typename_param_k T, ss_typename_param_k A>
00728 inline us_char_w_t const* c_str_ptr_null_w(unixstl_ns_qual(basic_path)<us_char_w_t, T, A> const& b)
00729 {
00730 return stlsoft_ns_qual(c_str_ptr_null_w)(b.c_str());
00731 }
00732
00733 #endif
00734
00735
00736
00737
00738
00743 template< ss_typename_param_k S
00744 , ss_typename_param_k C
00745 , ss_typename_param_k T
00746 , ss_typename_param_k A
00747 >
00748 inline S& operator <<(S& s, unixstl_ns_qual(basic_path)<C, T, A> const& b)
00749 {
00750 s << b.c_str();
00751
00752 return s;
00753 }
00754
00756
00757
00758 #ifdef STLSOFT_UNITTEST
00759 # include "./unittest/path_unittest_.h"
00760 #endif
00761
00763
00764
00765 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00766
00767 # if defined(STLSOFT_COMPILER_IS_MSVC) && \
00768 _MSC_VER >= 1300
00769 # pragma warning(push)
00770 # pragma warning(disable : 4702)
00771 # endif
00772
00773 template< ss_typename_param_k C
00774 , ss_typename_param_k T
00775 , ss_typename_param_k A
00776 >
00777 inline ss_typename_param_k basic_path<C, T, A>::char_type const* basic_path<C, T, A>::next_slash_or_end(ss_typename_param_k basic_path<C, T, A>::char_type const* p)
00778 {
00779 for(; ; ++p)
00780 {
00781 switch(*p)
00782 {
00783 case '/':
00784 #ifdef _WIN32
00785 case '\\':
00786 #endif
00787 ++p;
00788 case '\0':
00789 return p;
00790 default:
00791 break;
00792 }
00793 }
00794
00795 return NULL;
00796 }
00797
00798 # if defined(STLSOFT_COMPILER_IS_MSVC) && \
00799 _MSC_VER >= 1300
00800 # pragma warning(pop)
00801 # endif
00802
00803
00804 template< ss_typename_param_k C
00805 , ss_typename_param_k T
00806 , ss_typename_param_k A
00807 >
00808 inline ss_typename_param_k basic_path<C, T, A>::char_type basic_path<C, T, A>::path_name_separator_alt()
00809 {
00810 return '\\';
00811 }
00812
00813 template< ss_typename_param_k C
00814 , ss_typename_param_k T
00815 , ss_typename_param_k A
00816 >
00817 inline void basic_path<C, T, A>::swap(basic_path<C, T, A>& rhs)
00818 {
00819 m_buffer.swap(rhs.m_buffer);
00820 std_swap(m_len, rhs.m_len);
00821 }
00822
00823 template< ss_typename_param_k C
00824 , ss_typename_param_k T
00825 , ss_typename_param_k A
00826 >
00827 inline ss_typename_param_k basic_path<C, T, A>::class_type& basic_path<C, T, A>::concat_(ss_typename_param_k basic_path<C, T, A>::char_type const* rhs)
00828 {
00829 m_len = traits_type::str_len(traits_type::str_cat(&m_buffer[0], rhs));
00830
00831 return *this;
00832 }
00833
00834 template< ss_typename_param_k C
00835 , ss_typename_param_k T
00836 , ss_typename_param_k A
00837 >
00838 inline ss_typename_param_k basic_path<C, T, A>::class_type& basic_path<C, T, A>::concat_(basic_path<C, T, A> const& rhs)
00839 {
00840 m_len = traits_type::str_len(traits_type::str_cat(&m_buffer[0], rhs.c_str()));
00841
00842 return *this;
00843 }
00844
00845 template< ss_typename_param_k C
00846 , ss_typename_param_k T
00847 , ss_typename_param_k A
00848 >
00849 inline basic_path<C, T, A>::basic_path()
00850 : m_len(0)
00851 {
00852 m_buffer[0] = '\0';
00853 }
00854
00855 template< ss_typename_param_k C
00856 , ss_typename_param_k T
00857 , ss_typename_param_k A
00858 >
00859 inline basic_path<C, T, A>::basic_path(ss_typename_type_k basic_path<C, T, A>::char_type const* path)
00860 : m_len(0)
00861 {
00862 if(NULL != path)
00863 {
00864 size_type cch = traits_type::str_len(path);
00865
00866 UNIXSTL_MESSAGE_ASSERT("path too long", cch < m_buffer.size());
00867
00868 traits_type::char_copy(&m_buffer[0], path, cch);
00869
00870 m_len = cch;
00871 }
00872
00873 m_buffer[m_len] = '\0';
00874 }
00875
00876 template< ss_typename_param_k C
00877 , ss_typename_param_k T
00878 , ss_typename_param_k A
00879 >
00880 inline basic_path<C, T, A>::basic_path( ss_typename_type_k basic_path<C, T, A>::char_type const* path
00881 , ss_typename_type_k basic_path<C, T, A>::size_type cch)
00882 : m_len(cch)
00883 {
00884 UNIXSTL_ASSERT((NULL != path) || (0 == cch));
00885
00886 if(0 != cch)
00887 {
00888 UNIXSTL_MESSAGE_ASSERT("path too long", cch < m_buffer.size());
00889
00890 traits_type::char_copy(&m_buffer[0], path, cch);
00891 }
00892 m_buffer[cch] = '\0';
00893 }
00894
00895 #ifndef STLSOFT_CF_NO_COPY_CTOR_AND_COPY_CTOR_TEMPLATE_OVERLOAD
00896 template< ss_typename_param_k C
00897 , ss_typename_param_k T
00898 , ss_typename_param_k A
00899 >
00900 inline basic_path<C, T, A>::basic_path(basic_path<C, T, A> const& rhs)
00901 : m_len(rhs.m_len)
00902 {
00903 traits_type::char_copy(&m_buffer[0], rhs.m_buffer.c_str(), rhs.m_len + 1);
00904 }
00905 #endif
00906
00907 #ifndef STLSOFT_CF_NO_COPY_CTOR_AND_COPY_CTOR_TEMPLATE_OVERLOAD
00908 template< ss_typename_param_k C
00909 , ss_typename_param_k T
00910 , ss_typename_param_k A
00911 >
00912 inline basic_path<C, T, A>& basic_path<C, T, A>::operator =(basic_path<C, T, A> const& path)
00913 {
00914 class_type newPath(path);
00915
00916 swap(newPath);
00917
00918 return *this;
00919 }
00920 #endif
00921
00922 template< ss_typename_param_k C
00923 , ss_typename_param_k T
00924 , ss_typename_param_k A
00925 >
00926 inline basic_path<C, T, A>& basic_path<C, T, A>::operator =(ss_typename_type_k basic_path<C, T, A>::char_type const* path)
00927 {
00928 return operator_equal_(path);
00929 }
00930
00931 template< ss_typename_param_k C
00932 , ss_typename_param_k T
00933 , ss_typename_param_k A
00934 >
00935 inline basic_path<C, T, A>& basic_path<C, T, A>::operator_equal_(ss_typename_type_k basic_path<C, T, A>::char_type const* path)
00936 {
00937 class_type newPath(path);
00938
00939 swap(newPath);
00940
00941 return *this;
00942 }
00943
00944 template< ss_typename_param_k C
00945 , ss_typename_param_k T
00946 , ss_typename_param_k A
00947 >
00948 inline ss_typename_type_ret_k basic_path<C, T, A>::class_type basic_path<C, T, A>::root(ss_typename_type_k basic_path<C, T, A>::char_type const* s)
00949 {
00950 return class_type(s);
00951 }
00952
00953 template< ss_typename_param_k C
00954 , ss_typename_param_k T
00955 , ss_typename_param_k A
00956 >
00957 inline basic_path<C, T, A>& basic_path<C, T, A>::push(class_type const& rhs, us_bool_t bAddPathNameSeparator )
00958 {
00959 return push(rhs.c_str(), bAddPathNameSeparator);
00960 }
00961
00962 template< ss_typename_param_k C
00963 , ss_typename_param_k T
00964 , ss_typename_param_k A
00965 >
00966 inline basic_path<C, T, A>& basic_path<C, T, A>::push(char_type const* rhs, us_bool_t bAddPathNameSeparator )
00967 {
00968 UNIXSTL_ASSERT(NULL != rhs);
00969
00970 if('\0' != *rhs)
00971 {
00972 if(traits_type::is_path_rooted(rhs))
00973 {
00974 class_type newPath(rhs);
00975
00976 swap(newPath);
00977 }
00978 else
00979 {
00980 class_type newPath(*this);
00981
00982 newPath.push_sep();
00983 newPath.concat_(rhs);
00984 if(bAddPathNameSeparator)
00985 {
00986 newPath.push_sep();
00987 }
00988
00989 swap(newPath);
00990 }
00991 }
00992
00993 return *this;
00994 }
00995
00996 #if 0
00997 template< ss_typename_param_k C
00998 , ss_typename_param_k T
00999 , ss_typename_param_k A
01000 >
01001 inline basic_path<C, T, A>& basic_path<C, T, A>::push_ext(class_type const& rhs, us_bool_t bAddPathNameSeparator )
01002 {
01003 }
01004 #endif
01005
01006 template< ss_typename_param_k C
01007 , ss_typename_param_k T
01008 , ss_typename_param_k A
01009 >
01010 inline basic_path<C, T, A>& basic_path<C, T, A>::push_ext(char_type const* rhs, us_bool_t bAddPathNameSeparator )
01011 {
01012 UNIXSTL_ASSERT(NULL != rhs);
01013
01014 class_type newPath(*this);
01015
01016 newPath.pop_sep();
01017 if('.' != *rhs)
01018 {
01019 newPath.concat_(".");
01020 }
01021 newPath.concat_(rhs);
01022 if(bAddPathNameSeparator)
01023 {
01024 newPath.push_sep();
01025 }
01026
01027 swap(newPath);
01028
01029 return *this;
01030 }
01031
01032 template< ss_typename_param_k C
01033 , ss_typename_param_k T
01034 , ss_typename_param_k A
01035 >
01036 inline basic_path<C, T, A>& basic_path<C, T, A>::push_sep()
01037 {
01038 if(0 != m_len)
01039 {
01040 if(traits_type::path_name_separator() != m_buffer[m_len - 1])
01041 {
01042 #ifdef _WIN32
01043 if(path_name_separator_alt() != m_buffer[m_len - 1])
01044 #endif
01045 {
01046 UNIXSTL_ASSERT(m_len + 1 < m_buffer.size());
01047
01048 m_buffer[m_len] = traits_type::path_name_separator();
01049 m_buffer[m_len + 1] = '\0';
01050 ++m_len;
01051 }
01052 }
01053 }
01054
01055 return *this;
01056 }
01057
01058 template< ss_typename_param_k C
01059 , ss_typename_param_k T
01060 , ss_typename_param_k A
01061 >
01062 inline basic_path<C, T, A>& basic_path<C, T, A>::pop(us_bool_t bRemoveTrailingPathNameSeparator )
01063 {
01064 char_type *slash = traits_type::str_rchr(m_buffer.c_str(), traits_type::path_name_separator());
01065 #ifdef _WIN32
01066 char_type *slash_a = traits_type::str_rchr(m_buffer.c_str(), path_name_separator_alt());
01067
01068 if(slash_a > slash)
01069 {
01070 slash = slash_a;
01071 }
01072 #endif
01073
01074 if(NULL != slash)
01075 {
01076 *(slash + 1) = '\0';
01077 m_len = static_cast<size_type>((slash + 1) - m_buffer.c_str());
01078 }
01079 else
01080 {
01081 clear();
01082 }
01083
01084 if(bRemoveTrailingPathNameSeparator)
01085 {
01086 this->pop_sep();
01087 }
01088
01089 return *this;
01090 }
01091
01092 template< ss_typename_param_k C
01093 , ss_typename_param_k T
01094 , ss_typename_param_k A
01095 >
01096 inline basic_path<C, T, A>& basic_path<C, T, A>::pop_sep()
01097 {
01098 if(0 != m_len)
01099 {
01100 if( 1 == m_len &&
01101 traits_type::is_path_name_separator(m_buffer[0]))
01102 {
01103
01104 }
01105 #ifdef _WIN32
01106 else if(3 == m_len &&
01107 ':' == m_buffer[1] &&
01108 traits_type::is_path_name_separator(m_buffer[2]))
01109 {
01110
01111 }
01112 #endif
01113 else
01114 {
01115 char_type* last = &m_buffer[m_len - 1];
01116
01117 if(*last == traits_type::path_name_separator())
01118 {
01119 m_buffer[m_len-- - 1] = '\0';
01120 }
01121 #ifdef _WIN32
01122 else if(*last == path_name_separator_alt())
01123 {
01124 m_buffer[m_len-- - 1] = '\0';
01125 }
01126 #endif
01127 }
01128 }
01129
01130 return *this;
01131 }
01132
01133 template< ss_typename_param_k C
01134 , ss_typename_param_k T
01135 , ss_typename_param_k A
01136 >
01137 inline basic_path<C, T, A>& basic_path<C, T, A>::pop_ext()
01138 {
01139 { for(us_size_t len = m_len; 0 != len; --len)
01140 {
01141 char_type* last = &m_buffer[len - 1];
01142
01143 if(traits_type::is_path_name_separator(*last))
01144 {
01145 break;
01146 }
01147 else if('.' == *last)
01148 {
01149 m_len = len - 1;
01150
01151 m_buffer[m_len] = '\0';
01152
01153 break;
01154 }
01155 }}
01156
01157 return *this;
01158 }
01159
01160
01161 #if !defined(STLSOFT_CF_MEMBER_TEMPLATE_FUNCTION_SUPPORT) || \
01162 defined(STLSOFT_CF_MEMBER_TEMPLATE_OVERLOAD_DISCRIMINATED)
01163
01164 template< ss_typename_param_k C
01165 , ss_typename_param_k T
01166 , ss_typename_param_k A
01167 >
01168 inline basic_path<C, T, A>& basic_path<C, T, A>::operator /=(basic_path<C, T, A> const& path)
01169 {
01170 return push(path);
01171 }
01172
01173 #endif
01174
01175 template< ss_typename_param_k C
01176 , ss_typename_param_k T
01177 , ss_typename_param_k A
01178 >
01179 inline basic_path<C, T, A>& basic_path<C, T, A>::operator /=(ss_typename_type_k basic_path<C, T, A>::char_type const* path)
01180 {
01181 return push(path);
01182 }
01183
01184 template< ss_typename_param_k C
01185 , ss_typename_param_k T
01186 , ss_typename_param_k A
01187 >
01188 inline void basic_path<C, T, A>::clear()
01189 {
01190 m_buffer[0] = '\0';
01191 m_len = 0;
01192 }
01193
01194 template< ss_typename_param_k C
01195 , ss_typename_param_k T
01196 , ss_typename_param_k A
01197 >
01198 inline basic_path<C, T, A>& basic_path<C, T, A>::make_absolute(us_bool_t bRemoveTrailingPathNameSeparator )
01199 {
01200 if(0 != size())
01201 {
01202 buffer_type_ buffer;
01203 size_type cch = traits_type::get_full_path_name(c_str(), buffer.size(), &buffer[0]);
01204
01205 if(0 == cch)
01206 {
01207 #ifdef STLSOFT_CF_EXCEPTION_SUPPORT
01208 STLSOFT_THROW_X(unix_exception("could not determine the absolute path", errno));
01209 #else
01210 return *this;
01211 #endif
01212 }
01213
01214 class_type newPath(buffer.c_str(), cch);
01215
01216 if(bRemoveTrailingPathNameSeparator)
01217 {
01218 newPath.pop_sep();
01219 }
01220
01221 swap(newPath);
01222 }
01223
01224 return *this;
01225 }
01226
01227 template< ss_typename_param_k C
01228 , ss_typename_param_k T
01229 , ss_typename_param_k A
01230 >
01231 inline basic_path<C, T, A>& basic_path<C, T, A>::canonicalise(us_bool_t bRemoveTrailingPathNameSeparator )
01232 {
01233 class_type newPath(*this);
01234
01235 #ifdef _DEBUG
01236 memset(&newPath.m_buffer[0], '~', newPath.m_buffer.size());
01237 #endif
01238
01239
01240
01241 #ifdef STLSOFT_LF_ALLOCATOR_REBIND_SUPPORT
01242 typedef ss_typename_type_k A::ss_template_qual_k rebind<part>::other part_ator_type;
01243 #else
01244 typedef ss_typename_type_k allocator_selector<part>::allocator_type part_ator_type;
01245 #endif
01246
01247 typedef stlsoft_ns_qual(auto_buffer_old)< part
01248 , part_ator_type
01249 > part_buffer_t;
01250
01251 part_buffer_t parts(this->length() / 2);
01252 char_type* dest = &newPath.m_buffer[0];
01253 char_type const* p1 = this->c_str();
01254 char_type const* p2;
01255
01256 if(this->is_absolute())
01257 {
01258 #ifdef _WIN32
01259 if(traits_type::is_path_UNC(this->c_str()))
01260 {
01261 UNIXSTL_ASSERT('\\' == m_buffer[0]);
01262 UNIXSTL_ASSERT('\\' == m_buffer[1]);
01263 UNIXSTL_ASSERT('\\' != m_buffer[2]);
01264
01265 char_type const* slash0 = next_slash_or_end(&m_buffer[3]);
01266 char_type const* slash1 = next_slash_or_end(slash0);
01267
01268 for(us_size_t i = 0, n = slash1 - &m_buffer[0]; i < n; ++i)
01269 {
01270 *dest++ = *p1++;
01271 }
01272 }
01273 else if( isalpha(m_buffer[0]) &&
01274 ':' == m_buffer[1])
01275 {
01276
01277 *dest++ = *p1++;
01278 *dest++ = *p1++;
01279 *dest++ = *p1++;
01280 }
01281 else
01282 #endif
01283 {
01284 *dest++ = traits_type::path_name_separator();
01285 ++p1;
01286 }
01287 }
01288
01289
01290 {
01291 size_type i = 0;
01292
01293 for(; '\0' != *p1; ++i)
01294 {
01295 p2 = next_slash_or_end(p1);
01296
01297 parts[i].len = static_cast<size_type>(p2 - p1);
01298 parts[i].p = p1;
01299 parts[i].type = part::normal;
01300 switch(parts[i].len)
01301 {
01302 case 1:
01303 if('.' == p1[0])
01304 {
01305 parts[i].type = part::dot;
01306 }
01307 break;
01308 case 2:
01309 if('.' == p1[0])
01310 {
01311 if('.' == p1[1])
01312 {
01313 parts[i].type = part::dotdot;
01314 }
01315 else if(traits_type::path_name_separator() == p1[1])
01316 {
01317 parts[i].type = part::dot;
01318 }
01319 #ifdef _WIN32
01320 else if(path_name_separator_alt() == p1[1])
01321 {
01322 parts[i].type = part::dot;
01323 }
01324 #endif
01325 }
01326 break;
01327 case 3:
01328 if( '.' == p1[0] &&
01329 '.' == p1[1])
01330 {
01331 if(traits_type::path_name_separator() == p1[2])
01332 {
01333 parts[i].type = part::dotdot;
01334 }
01335 #ifdef _WIN32
01336 else if(path_name_separator_alt() == p1[2])
01337 {
01338 parts[i].type = part::dotdot;
01339 }
01340 #endif
01341 }
01342 break;
01343 default:
01344 break;
01345 }
01346
01347 p1 = p2;
01348 }
01349
01350 parts.resize(i);
01351 }
01352
01353
01354 {
01355 size_type i = 0;
01356
01357 for(i = 0; i < parts.size(); ++i)
01358 {
01359 switch(parts[i].type)
01360 {
01361 case part::dot:
01362 parts[i].len = 0;
01363 break;
01364 case part::dotdot:
01365
01366 {
01367 size_type prior;
01368
01369 for(prior = i; ; )
01370 {
01371 if(0 == prior)
01372 {
01373 STLSOFT_THROW_X(unixstl_ns_qual_std(invalid_argument)("No prior part to \"..\" for path canonicalisation"));
01374 }
01375 else
01376 {
01377 --prior;
01378
01379 if( part::normal == parts[prior].type &&
01380 0 != parts[prior].len)
01381 {
01382 parts[i].len = 0;
01383 parts[prior].len = 0;
01384 break;
01385 }
01386 }
01387 }
01388 }
01389 break;
01390 case part::normal:
01391 default:
01392 break;
01393 }
01394 }
01395 }
01396
01397
01398 {
01399 size_type i = 0;
01400
01401 #ifdef _DEBUG
01402 memset(dest, '~', newPath.m_buffer.size() - (dest - &newPath.m_buffer[0]));
01403 #endif
01404
01405 for(i = 0; i < parts.size(); ++i)
01406 {
01407 traits_type::str_n_copy(dest, parts[i].p, parts[i].len);
01408
01409 dest += parts[i].len;
01410 }
01411
01412 *dest = '\0';
01413 newPath.m_len = dest - newPath.c_str();
01414 }
01415
01416 if(bRemoveTrailingPathNameSeparator)
01417 {
01418 newPath.pop_sep();
01419 }
01420
01421 swap(newPath);
01422
01423 return *this;
01424 }
01425
01426 template< ss_typename_param_k C
01427 , ss_typename_param_k T
01428 , ss_typename_param_k A
01429 >
01430 inline ss_typename_type_ret_k basic_path<C, T, A>::char_type const* basic_path<C, T, A>::get_file() const
01431 {
01432 char_type const* slash = traits_type::str_rchr(m_buffer.c_str(), traits_type::path_name_separator());
01433 char_type const* slash_a = traits_type::str_rchr(m_buffer.c_str(), path_name_separator_alt());
01434
01435 if(slash_a > slash)
01436 {
01437 slash = slash_a;
01438 }
01439
01440 if(NULL == slash)
01441 {
01442 slash = m_buffer.c_str();
01443 }
01444 else
01445 {
01446 ++slash;
01447 }
01448
01449 return slash;
01450 }
01451
01452 template< ss_typename_param_k C
01453 , ss_typename_param_k T
01454 , ss_typename_param_k A
01455 >
01456 inline ss_typename_type_ret_k basic_path<C, T, A>::char_type const* basic_path<C, T, A>::get_ext() const
01457 {
01458 char_type const *dot = traits_type::str_rchr(this->c_str(), '.');
01459 char_type const *file = get_file();
01460 static const char_type s_empty[1] = { '\0' };
01461
01462 if(NULL == dot)
01463 {
01464 return s_empty;
01465 }
01466 else if(dot < file)
01467 {
01468 return s_empty;
01469 }
01470 else
01471 {
01472 return dot + 1;
01473 }
01474 }
01475
01476 template< ss_typename_param_k C
01477 , ss_typename_param_k T
01478 , ss_typename_param_k A
01479 >
01480 inline ss_typename_type_ret_k basic_path<C, T, A>::size_type basic_path<C, T, A>::length() const
01481 {
01482 return m_len;
01483 }
01484
01485 template< ss_typename_param_k C
01486 , ss_typename_param_k T
01487 , ss_typename_param_k A
01488 >
01489 inline ss_typename_type_ret_k basic_path<C, T, A>::size_type basic_path<C, T, A>::size() const
01490 {
01491 return length();
01492 }
01493
01494 template< ss_typename_param_k C
01495 , ss_typename_param_k T
01496 , ss_typename_param_k A
01497 >
01498 inline ss_typename_type_ret_k basic_path<C, T, A>::size_type
01499 basic_path<C, T, A>::max_size()
01500 {
01501 return buffer_type_::max_size() - 1u;
01502 }
01503
01504 template< ss_typename_param_k C
01505 , ss_typename_param_k T
01506 , ss_typename_param_k A
01507 >
01508 inline ss_typename_type_ret_k basic_path<C, T, A>::bool_type basic_path<C, T, A>::empty() const
01509 {
01510 return 0 == size();
01511 }
01512
01513 template< ss_typename_param_k C
01514 , ss_typename_param_k T
01515 , ss_typename_param_k A
01516 >
01517 inline ss_typename_type_ret_k basic_path<C, T, A>::char_type const* basic_path<C, T, A>::c_str() const
01518 {
01519 return m_buffer.c_str();
01520 }
01521
01522 template< ss_typename_param_k C
01523 , ss_typename_param_k T
01524 , ss_typename_param_k A
01525 >
01526 inline ss_typename_type_ret_k basic_path<C, T, A>::char_type const& basic_path<C, T, A>::operator [](ss_typename_type_k basic_path<C, T, A>::size_type index) const
01527 {
01528 UNIXSTL_MESSAGE_ASSERT("Index out of range", !(size() < index));
01529
01530 return c_str()[index];
01531 }
01532
01533 template< ss_typename_param_k C
01534 , ss_typename_param_k T
01535 , ss_typename_param_k A
01536 >
01537 inline us_bool_t basic_path<C, T, A>::exists() const
01538 {
01539 return traits_type::file_exists(this->c_str());
01540 }
01541
01542 template< ss_typename_param_k C
01543 , ss_typename_param_k T
01544 , ss_typename_param_k A
01545 >
01546 inline us_bool_t basic_path<C, T, A>::is_rooted() const
01547 {
01548 return traits_type::is_path_rooted(this->c_str());
01549 }
01550
01551 template< ss_typename_param_k C
01552 , ss_typename_param_k T
01553 , ss_typename_param_k A
01554 >
01555 inline us_bool_t basic_path<C, T, A>::is_absolute() const
01556 {
01557 return traits_type::is_path_absolute(this->c_str());
01558 }
01559
01560 template< ss_typename_param_k C
01561 , ss_typename_param_k T
01562 , ss_typename_param_k A
01563 >
01564 inline us_bool_t basic_path<C, T, A>::has_sep() const
01565 {
01566 return this->empty() ? false : traits_type::has_dir_end(this->c_str() + (this->size() - 1));
01567 }
01568
01569 template< ss_typename_param_k C
01570 , ss_typename_param_k T
01571 , ss_typename_param_k A
01572 >
01573 inline ss_typename_type_ret_k basic_path<C, T, A>::size_type basic_path<C, T, A>::copy(ss_typename_type_k basic_path<C, T, A>::char_type *buffer, ss_typename_type_k basic_path<C, T, A>::size_type cchBuffer) const
01574 {
01575 return stlsoft_ns_qual(copy_contents)(buffer, cchBuffer, m_buffer.data(), m_len);
01576 }
01577
01578 template< ss_typename_param_k C
01579 , ss_typename_param_k T
01580 , ss_typename_param_k A
01581 >
01582 inline us_bool_t basic_path<C, T, A>::equivalent(basic_path<C, T, A> const& rhs) const
01583 {
01584 return equivalent(rhs.c_str());
01585 }
01586
01587 template< ss_typename_param_k C
01588 , ss_typename_param_k T
01589 , ss_typename_param_k A
01590 >
01591 inline us_bool_t basic_path<C, T, A>::equivalent(ss_typename_type_k basic_path<C, T, A>::char_type const* rhs) const
01592 {
01593 class_type lhs_(*this);
01594 class_type rhs_(rhs);
01595
01596 return lhs_.make_absolute(false).canonicalise(true) == rhs_.make_absolute(false).canonicalise(true);
01597 }
01598
01599 template< ss_typename_param_k C
01600 , ss_typename_param_k T
01601 , ss_typename_param_k A
01602 >
01603 inline us_bool_t basic_path<C, T, A>::equal(basic_path<C, T, A> const& rhs) const
01604 {
01605 return equal(rhs.c_str());
01606 }
01607
01608 template< ss_typename_param_k C
01609 , ss_typename_param_k T
01610 , ss_typename_param_k A
01611 >
01612 inline us_bool_t basic_path<C, T, A>::equal(ss_typename_type_k basic_path<C, T, A>::char_type const* rhs) const
01613 {
01614 return 0 == traits_type::str_compare(m_buffer.c_str(), stlsoft_ns_qual(c_str_ptr)(rhs));
01615 }
01616
01617 #endif
01618
01619
01620
01621 #ifndef _UNIXSTL_NO_NAMESPACE
01622 # if defined(_STLSOFT_NO_NAMESPACE) || \
01623 defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
01624 }
01625 # else
01626 }
01627 }
01628 # endif
01629 #endif
01630
01631
01632
01633
01634 #if defined(STLSOFT_CF_std_NAMESPACE)
01635 # if ( ( defined(STLSOFT_COMPILER_IS_INTEL) && \
01636 defined(_MSC_VER))) && \
01637 _MSC_VER < 1310
01638 namespace std
01639 {
01640 template< ss_typename_param_k C
01641 , ss_typename_param_k T
01642 , ss_typename_param_k A
01643 >
01644 inline void swap(unixstl_ns_qual(basic_path)<C, T, A>& lhs, unixstl_ns_qual(basic_path)<C, T, A>& rhs)
01645 {
01646 lhs.swap(rhs);
01647 }
01648 }
01649 # endif
01650 #endif
01651
01652
01653
01654
01655
01656
01657
01658
01659
01660 #ifndef _UNIXSTL_NO_NAMESPACE
01661 # if !defined(_STLSOFT_NO_NAMESPACE) && \
01662 !defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
01663 namespace stlsoft
01664 {
01665 # else
01666
01667 # endif
01668
01669 using ::unixstl::c_str_data;
01670 using ::unixstl::c_str_data_a;
01671 using ::unixstl::c_str_data_w;
01672
01673 using ::unixstl::c_str_len;
01674 using ::unixstl::c_str_len_a;
01675 using ::unixstl::c_str_len_w;
01676
01677 using ::unixstl::c_str_ptr;
01678 using ::unixstl::c_str_ptr_a;
01679 using ::unixstl::c_str_ptr_w;
01680
01681 using ::unixstl::c_str_ptr_null;
01682 using ::unixstl::c_str_ptr_null_a;
01683 using ::unixstl::c_str_ptr_null_w;
01684
01685 # if !defined(_STLSOFT_NO_NAMESPACE) && \
01686 !defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
01687 }
01688 # else
01689
01690 # endif
01691 #endif
01692
01693
01694
01695 #endif
01696
01697