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
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060 #ifndef INETSTL_INCL_H_INETSTL
00061 # include "inetstl.h"
00062 #endif
00063 #ifndef INETSTL_INCL_H_INETSTL_FILESYSTEM_TRAITS
00064 # include "inetstl_filesystem_traits.h"
00065 #endif
00066 #ifndef STLSOFT_INCL_H_STLSOFT_SIMPLE_STRING
00067
00068 #endif
00069 #ifndef __STLSOFT_COMPILER_IS_WATCOM
00070 # ifndef STLSOFT_INCL_H_STLSOFT_ITERATOR
00071 # include "stlsoft_iterator.h"
00072 # endif
00073 #endif
00074
00075
00076
00077
00078
00079 #ifndef _INETSTL_NO_NAMESPACE
00080 # if defined(_STLSOFT_NO_NAMESPACE) || \
00081 defined(__STLSOFT_DOCUMENTATION_SKIP_SECTION)
00082
00083 namespace inetstl
00084 {
00085 # else
00086
00087
00088 namespace stlsoft
00089 {
00090
00091 namespace inetstl_project
00092 {
00093
00094 # endif
00095 #endif
00096
00097
00098
00101
00105
00110
00111
00112
00113
00114
00115 #ifndef __STLSOFT_DOCUMENTATION_SKIP_SECTION
00116
00117 template <ss_typename_param_k C, ss_typename_param_k T>
00118 class basic_findfile_sequence_value_type;
00119
00120 template <ss_typename_param_k C, ss_typename_param_k T, ss_typename_param_k V>
00121 class basic_findfile_sequence_const_input_iterator;
00122
00123 #endif
00124
00125
00126
00127
00128
00129
00139
00140 #ifdef __STLSOFT_CF_TEMPLATE_CLASS_DEFAULT_CLASS_ARGUMENT_SUPPORT
00141 , ss_typename_param_k T = filesystem_traits<C>
00142 #else
00143 , ss_typename_param_k T
00144 #endif
00145 >
00146 class basic_findfile_sequence
00147 {
00148 public:
00150 typedef C char_type;
00152 typedef T traits_type;
00154 typedef basic_findfile_sequence<C, T> class_type;
00156 typedef basic_findfile_sequence_value_type<C, T> value_type;
00158 typedef basic_findfile_sequence_const_input_iterator<C, T, value_type> const_input_iterator;
00160 typedef const_input_iterator const_iterator;
00162 typedef value_type &reference;
00164 typedef value_type const &const_reference;
00166 typedef ss_typename_type_k traits_type::find_data_type find_data_type;
00168 typedef is_ptrdiff_t difference_type;
00170 typedef is_size_t size_type;
00171
00172 enum
00173 {
00174 includeDots = 0x0008
00175 , directories = 0x0010
00176 , files = 0x0020
00177 #ifndef __STLSOFT_DOCUMENTATION_SKIP_SECTION
00178 , noSort = 0
00179 #endif
00180 ,
00181 };
00182
00183
00184 public:
00186 basic_findfile_sequence(HINTERNET hconn, char_type const *searchSpec, is_int_t flags = directories | files);
00188 basic_findfile_sequence(HINTERNET hconn, char_type const *directory, char_type const *searchSpec, is_int_t flags = directories | files);
00190 ~basic_findfile_sequence() inetstl_throw_0();
00191
00192
00193 public:
00197 const_iterator begin() const;
00201 const_iterator end() const;
00202
00203
00204 public:
00208 char_type const *get_directory() const;
00209
00210
00211 public:
00212 #ifdef STLSOFT_OBSOLETE
00217 size_type size() const;
00218 #endif
00219
00220 is_bool_t empty() const;
00222 static size_type max_size();
00223
00224
00225 private:
00226 friend class basic_findfile_sequence_value_type<C, T>;
00227 friend class basic_findfile_sequence_const_input_iterator<C, T, value_type>;
00228
00229 HINTERNET const m_hconn;
00230 char_type m_directory[_MAX_DIR + 1];
00231 char_type m_subpath[_MAX_PATH + 1];
00232 char_type m_search[_MAX_PATH + 1];
00233 is_int_t m_flags;
00234
00235
00236 private:
00237 static is_int_t validate_flags_(is_int_t flags);
00238 static void extract_subpath_(HINTERNET hconn, char_type *dest, char_type const *searchSpec);
00239
00240 static HINTERNET find_first_file_(HINTERNET hconn, char_type const *spec, is_int_t flags, find_data_type *findData);
00241 HINTERNET begin_(HINTERNET hconn, find_data_type &findData) const;
00242
00243
00244 private:
00245 basic_findfile_sequence(class_type const &);
00246 basic_findfile_sequence const &operator =(class_type const &);
00247 };
00248
00249
00250
00251
00252
00254 typedef basic_findfile_sequence<is_char_a_t, filesystem_traits<is_char_a_t> > findfile_sequence_a;
00256 typedef basic_findfile_sequence<is_char_w_t, filesystem_traits<is_char_w_t> > findfile_sequence_w;
00258 typedef basic_findfile_sequence<TCHAR, filesystem_traits<TCHAR> > findfile_sequence;
00259
00260
00261
00262
00264
00265
00266
00267
00268
00269
00271
00273
00275
00277
00278
00279
00280
00282
00283
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00303
00304
00306
00307
00308
00310
00311
00313
00317
00318
00320
00322
00324
00325
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00340
00341
00342
00343
00344
00345 {
00346 public:
00348 typedef C char_type;
00350 typedef T traits_type;
00352 typedef V value_type;
00354 typedef basic_findfile_sequence_const_input_iterator<C, T, V> class_type;
00356 typedef ss_typename_type_k traits_type::find_data_type find_data_type;
00357 private:
00358 typedef basic_findfile_sequence<C, T> sequence_type;
00359
00362 private:
00363 #ifndef __STLSOFT_DOCUMENTATION_SKIP_SECTION
00364 struct shared_handle
00365 {
00366 public:
00367 typedef shared_handle class_type;
00368
00369
00370 public:
00371 HINTERNET hSrch;
00372 private:
00373 ss_sint32_t cRefs;
00374
00375
00376 public:
00377 ss_explicit_k shared_handle(HINTERNET h)
00378 : hSrch(h)
00379 , cRefs(1)
00380 {}
00381 # if defined(__STLSOFT_COMPILER_IS_GCC)
00382 protected:
00383 # else
00384 private:
00385 # endif
00386 ~shared_handle()
00387 {
00388 inetstl_message_assert("Shared search handle being destroyed with outstanding references!", 0 == cRefs);
00389
00390 if(NULL != hSrch)
00391 {
00392 traits_type::find_close(hSrch);
00393 }
00394 }
00395
00396
00397 public:
00398 void AddRef()
00399 {
00400 ++cRefs;
00401 }
00402 void Release()
00403 {
00404 if(0 == --cRefs)
00405 {
00406 delete this;
00407 }
00408 }
00409
00410
00411 private:
00412 shared_handle(class_type const &);
00413 class_type &operator =(class_type const &);
00414 };
00415 #endif
00416
00417
00420 private:
00421 basic_findfile_sequence_const_input_iterator(sequence_type const &l, HINTERNET hSrch, find_data_type const &data)
00422 : m_list(&l)
00423 , m_handle(new shared_handle(hSrch))
00424 , m_data(data)
00425 {
00426 inetstl_assert(NULL != hSrch);
00427 }
00428 basic_findfile_sequence_const_input_iterator(sequence_type const &l);
00429 public:
00431 basic_findfile_sequence_const_input_iterator();
00433 basic_findfile_sequence_const_input_iterator(class_type const &rhs);
00435 ~basic_findfile_sequence_const_input_iterator() inetstl_throw_0();
00436
00437
00438 basic_findfile_sequence_const_input_iterator &operator =(class_type const &rhs);
00440
00441 public:
00443 class_type &operator ++();
00445 class_type operator ++(int);
00447 const value_type operator *() const;
00449 is_bool_t operator ==(class_type const &rhs) const;
00451 is_bool_t operator !=(class_type const &rhs) const;
00452
00453
00454 private:
00455 friend class basic_findfile_sequence<C, T>;
00456
00457 sequence_type const * const m_list;
00458 shared_handle *m_handle;
00459 ss_typename_type_k traits_type::find_data_type m_data;
00460 };
00461
00463
00464
00465 template <ss_typename_param_k C, ss_typename_param_k T>
00466 inline is_bool_t is_empty(basic_findfile_sequence<C, T> const &s)
00467 {
00468 return s.empty();
00469 }
00470
00472
00473
00474 #ifdef STLSOFT_UNITTEST
00475
00476 namespace unittest
00477 {
00478 ss_bool_t test_inetstl_findfile_sequence(unittest_reporter *r)
00479 {
00480 using stlsoft::unittest::unittest_initialiser;
00481
00482 ss_bool_t bSuccess = true;
00483
00484 unittest_initialiser init(r, "InetSTL", "findfile_sequence", __FILE__);
00485
00486 #if 0
00487 if(<<TODO>>)
00488 {
00489 r->report("<<TODO>> failed ", __LINE__);
00490 bSuccess = false;
00491 }
00492 #endif
00493
00494 return bSuccess;
00495 }
00496
00497 unittest_registrar unittest_inetstl_findfile_sequence(test_inetstl_findfile_sequence);
00498
00499 }
00500
00501 #endif
00502
00504
00505
00506 #ifndef __STLSOFT_DOCUMENTATION_SKIP_SECTION
00507
00508
00509
00510 template <ss_typename_param_k C, ss_typename_param_k T>
00511 inline HINTERNET basic_findfile_sequence<C, T>::find_first_file_(HINTERNET hconn, ss_typename_type_k basic_findfile_sequence<C, T>::char_type const *spec, is_int_t , ss_typename_type_k basic_findfile_sequence<C, T>::find_data_type *findData)
00512 {
00513 HINTERNET hSrch = traits_type::find_first_file(hconn, spec, findData);
00514
00515 #ifdef _DEBUG
00516 if(NULL == hSrch)
00517 {
00518 ::GetLastError();
00519 }
00520 #endif
00521
00522 return hSrch;
00523 }
00524
00525 template <ss_typename_param_k C, ss_typename_param_k T>
00526 inline HINTERNET basic_findfile_sequence<C, T>::begin_(HINTERNET hconn, ss_typename_type_k basic_findfile_sequence<C, T>::find_data_type &findData) const
00527 {
00528 HINTERNET hSrch = find_first_file_(hconn, m_search, m_flags, &findData);
00529
00530 if(hSrch != NULL)
00531 {
00532
00533
00534 for(; hSrch != NULL; )
00535 {
00536 if((findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
00537 {
00538
00539 if(m_flags & files)
00540 {
00541 break;
00542 }
00543 }
00544 else
00545 {
00546 if(traits_type::is_dots(findData.cFileName))
00547 {
00548 if(m_flags & includeDots)
00549 {
00550
00551 break;
00552 }
00553 }
00554 else if(m_flags & directories)
00555 {
00556
00557 break;
00558 }
00559 }
00560
00561 if(!traits_type::find_next_file(hSrch, &findData))
00562 {
00563 traits_type::find_close(hSrch);
00564
00565 hSrch = NULL;
00566
00567 break;
00568 }
00569 }
00570 }
00571
00572 return hSrch;
00573 }
00574
00575 template <ss_typename_param_k C, ss_typename_param_k T>
00576 inline is_int_t basic_findfile_sequence<C, T>::validate_flags_(is_int_t flags)
00577 {
00578 return (flags & (directories | files)) == 0 ? (flags | (directories | files)) : flags;
00579 }
00580
00581 template <ss_typename_param_k C, ss_typename_param_k T>
00582 inline void basic_findfile_sequence<C, T>::extract_subpath_(HINTERNET hconn, char_type *dest, char_type const *searchSpec)
00583 {
00584 char_type *pFile;
00585
00586 traits_type::get_full_path_name(hconn, searchSpec, _MAX_PATH, dest, &pFile);
00587
00588 if(pFile != 0)
00589 {
00590 *pFile = '\0';
00591 }
00592 }
00593
00594
00595 template <ss_typename_param_k C, ss_typename_param_k T>
00596 inline basic_findfile_sequence<C, T>::basic_findfile_sequence(HINTERNET hconn, char_type const *searchSpec, is_int_t flags )
00597 : m_hconn(hconn)
00598 , m_flags(validate_flags_(flags))
00599 {
00600 is_size_t cchBuffer = stlsoft_num_elements(m_directory);
00601
00602 traits_type::get_current_directory(m_hconn, cchBuffer, m_directory);
00603
00604 traits_type::str_copy(m_search, m_directory);
00605 traits_type::ensure_dir_end(m_search);
00606 traits_type::str_cat(m_search, searchSpec);
00607
00608 extract_subpath_(m_hconn, m_subpath, searchSpec);
00609 }
00610
00611 template <ss_typename_param_k C, ss_typename_param_k T>
00612 inline basic_findfile_sequence<C, T>::basic_findfile_sequence(HINTERNET hconn, char_type const *directory, char_type const * searchSpec, is_int_t flags )
00613 : m_hconn(hconn)
00614 , m_flags(validate_flags_(flags))
00615 {
00616 traits_type::str_copy(m_directory, directory);
00617
00618 traits_type::str_copy(m_search, directory);
00619 if( searchSpec[0] == '.' &&
00620 searchSpec[1] == '\0')
00621 {
00622 char_type slashdot[3] = { '/', '.', '\0' };
00623
00624
00625 traits_type::remove_dir_end(m_search);
00626 traits_type::str_cat(m_search, slashdot);
00627 }
00628 else
00629 {
00630 traits_type::ensure_dir_end(m_search);
00631 traits_type::str_cat(m_search, searchSpec);
00632 }
00633
00634 extract_subpath_(m_hconn, m_subpath, m_search);
00635 }
00636
00637 template <ss_typename_param_k C, ss_typename_param_k T>
00638 inline basic_findfile_sequence<C, T>::~basic_findfile_sequence() inetstl_throw_0()
00639 {}
00640
00641
00642 template <ss_typename_param_k C, ss_typename_param_k T>
00643 inline ss_typename_type_k basic_findfile_sequence<C, T>::const_iterator basic_findfile_sequence<C, T>::begin() const
00644 {
00645 ss_typename_type_k traits_type::find_data_type findData;
00646 HINTERNET hSrch = begin_(m_hconn, findData);
00647
00648 if(hSrch == NULL)
00649 {
00650 return const_input_iterator(*this);
00651 }
00652 else
00653 {
00654 return const_input_iterator(*this, hSrch, findData);
00655 }
00656 }
00657
00658 template <ss_typename_param_k C, ss_typename_param_k T>
00659 inline ss_typename_type_k basic_findfile_sequence<C, T>::const_iterator basic_findfile_sequence<C, T>::end() const
00660 {
00661 return const_input_iterator(*this);
00662 }
00663
00664
00665 template <ss_typename_param_k C, ss_typename_param_k T>
00666 ss_typename_type_k basic_findfile_sequence<C, T>::char_type const *basic_findfile_sequence<C, T>::get_directory() const
00667 {
00668 return m_directory;
00669 }
00670
00671
00672 #ifdef STLSOFT_OBSOLETE
00673 template <ss_typename_param_k C, ss_typename_param_k T>
00674 inline ss_typename_type_k basic_findfile_sequence<C, T>::size_type basic_findfile_sequence<C, T>::size() const
00675 {
00676 return stlsoft_ns_qual_std(distance)(begin(), end());
00677 }
00678 #endif
00679
00680 template <ss_typename_param_k C, ss_typename_param_k T>
00681 inline is_bool_t basic_findfile_sequence<C, T>::empty() const
00682 {
00683 return begin() == end();
00684 }
00685
00686 template <ss_typename_param_k C, ss_typename_param_k T>
00687 inline ss_typename_type_k basic_findfile_sequence<C, T>::size_type basic_findfile_sequence<C, T>::max_size()
00688 {
00689 return static_cast<size_type>(-1);
00690 }
00691
00692
00693
00694 template <ss_typename_param_k C, ss_typename_param_k T>
00695 inline basic_findfile_sequence_value_type<C, T>::basic_findfile_sequence_value_type()
00696 {
00697 m_data.dwFileAttributes = 0xFFFFFFFF;
00698 m_data.cFileName[0] = '\0';
00699 m_data.cAlternateFileName[0] = '\0';
00700 m_path[0] = '\0';
00701 }
00702
00703
00704 template <ss_typename_param_k C, ss_typename_param_k T>
00705 inline basic_findfile_sequence_value_type<C, T>::~basic_findfile_sequence_value_type() inetstl_throw_0()
00706 {}
00707
00708 template <ss_typename_param_k C, ss_typename_param_k T>
00709 inline ss_typename_type_k basic_findfile_sequence_value_type<C, T>::find_data_type const &basic_findfile_sequence_value_type<C, T>::get_find_data() const
00710 {
00711 return m_data;
00712 }
00713
00714 template <ss_typename_param_k C, ss_typename_param_k T>
00715 inline ss_typename_type_k basic_findfile_sequence_value_type<C, T>::find_data_type const &basic_findfile_sequence_value_type<C, T>::GetFindData() const
00716 {
00717 return get_find_data();
00718 }
00719
00720 template <ss_typename_param_k C, ss_typename_param_k T>
00721 inline ss_typename_type_k basic_findfile_sequence_value_type<C, T>::char_type const *basic_findfile_sequence_value_type<C, T>::get_filename() const
00722 {
00723 return m_data.cFileName;
00724 }
00725
00726 template <ss_typename_param_k C, ss_typename_param_k T>
00727 inline ss_typename_type_k basic_findfile_sequence_value_type<C, T>::char_type const *basic_findfile_sequence_value_type<C, T>::get_short_filename() const
00728 {
00729 return m_data.cAlternateFileName[0] != '\0' ? m_data.cAlternateFileName : m_data.cFileName;
00730 }
00731
00732 template <ss_typename_param_k C, ss_typename_param_k T>
00733 inline ss_typename_type_k basic_findfile_sequence_value_type<C, T>::char_type const *basic_findfile_sequence_value_type<C, T>::get_path() const
00734 {
00735 return m_path;
00736 }
00737
00738 template <ss_typename_param_k C, ss_typename_param_k T>
00739 #if defined(__STLSOFT_COMPILER_IS_GCC) || \
00740 ( defined(__STLSOFT_COMPILER_IS_MSVC) && \
00741 _MSC_VER < 1100)
00742 inline basic_findfile_sequence_value_type<C, T>::operator C const * () const
00743 #else
00744 inline basic_findfile_sequence_value_type<C, T>::operator ss_typename_type_k basic_findfile_sequence_value_type<C, T>::char_type const * () const
00745 #endif
00746 {
00747 return get_path();
00748 }
00749
00750
00751 template <ss_typename_param_k C, ss_typename_param_k T>
00752 inline is_bool_t operator == (basic_findfile_sequence_value_type<C, T> const &lhs, basic_findfile_sequence_value_type<C, T> const &rhs)
00753 {
00754 return 0 == basic_findfile_sequence_value_type<C, T>::traits_type::str_compare(lhs.get_path(), rhs.get_path());
00755 }
00756
00757 template <ss_typename_param_k C, ss_typename_param_k T>
00758 inline is_bool_t operator == (basic_findfile_sequence_value_type<C, T> const &lhs, C const *rhs)
00759 {
00760 return 0 == basic_findfile_sequence_value_type<C, T>::traits_type::str_compare(lhs.get_path(), rhs);
00761 }
00762
00763 template <ss_typename_param_k C, ss_typename_param_k T>
00764 inline is_bool_t operator == (C const *lhs, basic_findfile_sequence_value_type<C, T> const &rhs)
00765 {
00766 return 0 == basic_findfile_sequence_value_type<C, T>::traits_type::str_compare(lhs, rhs.get_path());
00767 }
00768
00769
00770
00771 template <ss_typename_param_k C, ss_typename_param_k T, ss_typename_param_k V>
00772 inline basic_findfile_sequence_const_input_iterator<C, T, V>::basic_findfile_sequence_const_input_iterator()
00773 : m_list(NULL)
00774 , m_handle(NULL)
00775 {}
00776
00777 template <ss_typename_param_k C, ss_typename_param_k T, ss_typename_param_k V>
00778 inline basic_findfile_sequence_const_input_iterator<C, T, V>::basic_findfile_sequence_const_input_iterator(sequence_type const &l)
00779 : m_list(&l)
00780 , m_handle(NULL)
00781 {}
00782
00783 template <ss_typename_param_k C, ss_typename_param_k T, ss_typename_param_k V>
00784 inline basic_findfile_sequence_const_input_iterator<C, T, V>::basic_findfile_sequence_const_input_iterator(class_type const &rhs)
00785 : m_list(rhs.m_list)
00786 , m_handle(rhs.m_handle)
00787 , m_data(rhs.m_data)
00788 {
00789 if(NULL != m_handle)
00790 {
00791 m_handle->AddRef();
00792 }
00793 }
00794
00795 template <ss_typename_param_k C, ss_typename_param_k T, ss_typename_param_k V>
00796 #ifndef __STLSOFT_COMPILER_IS_WATCOM
00797 inline ss_typename_type_k basic_findfile_sequence_const_input_iterator<C, T, V>::class_type &basic_findfile_sequence_const_input_iterator<C, T, V>::operator =(ss_typename_param_k basic_findfile_sequence_const_input_iterator<C, T, V>::class_type const &rhs)
00798 #else
00799 inline basic_findfile_sequence_const_input_iterator<C, T, V> &basic_findfile_sequence_const_input_iterator<C, T, V>::operator =(basic_findfile_sequence_const_input_iterator<C, T, V> const &rhs)
00800 #endif
00801 {
00802 inetstl_message_assert("Assigning iterators from separate sequences", m_list == rhs.m_list);
00803
00804 m_handle = rhs.m_handle;
00805 m_data = rhs.m_data;
00806
00807 if(NULL != m_handle)
00808 {
00809 m_handle->AddRef();
00810 }
00811
00812 return *this;
00813 }
00814
00815 template <ss_typename_param_k C, ss_typename_param_k T, ss_typename_param_k V>
00816 inline basic_findfile_sequence_const_input_iterator<C, T, V>::~basic_findfile_sequence_const_input_iterator() inetstl_throw_0()
00817 {
00818 if(NULL != m_handle)
00819 {
00820 m_handle->Release();
00821 }
00822 }
00823
00824 template <ss_typename_param_k C, ss_typename_param_k T, ss_typename_param_k V>
00825 inline ss_typename_type_k basic_findfile_sequence_const_input_iterator<C, T, V>::class_type &basic_findfile_sequence_const_input_iterator<C, T, V>::operator ++()
00826 {
00827 is_int_t flags = m_list->m_flags;
00828
00829 inetstl_message_assert("Attempting to increment an invalid iterator!", NULL != m_handle);
00830
00831 for(; m_handle->hSrch != NULL; )
00832 {
00833 if(!traits_type::find_next_file(m_handle->hSrch, &m_data))
00834 {
00835 m_handle->Release();
00836
00837 m_handle = NULL;
00838
00839 break;
00840 }
00841 else
00842 {
00843 if((m_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
00844 {
00845
00846 if(flags & sequence_type::files)
00847 {
00848 break;
00849 }
00850 }
00851 else
00852 {
00853 if(traits_type::is_dots(m_data.cFileName))
00854 {
00855 if(flags & sequence_type::includeDots)
00856 {
00857
00858 break;
00859 }
00860 }
00861 else if(flags & sequence_type::directories)
00862 {
00863
00864 break;
00865 }
00866 }
00867 }
00868 }
00869
00870 return *this;
00871 }
00872
00873 template <ss_typename_param_k C, ss_typename_param_k T, ss_typename_param_k V>
00874 inline ss_typename_type_k basic_findfile_sequence_const_input_iterator<C, T, V>::class_type basic_findfile_sequence_const_input_iterator<C, T, V>::operator ++(int)
00875 {
00876 class_type ret(*this);
00877
00878 operator ++();
00879
00880 return ret;
00881 }
00882
00883 template <ss_typename_param_k C, ss_typename_param_k T, ss_typename_param_k V>
00884 inline const ss_typename_type_k basic_findfile_sequence_const_input_iterator<C, T, V>::value_type basic_findfile_sequence_const_input_iterator<C, T, V>::operator *() const
00885 {
00886 if(NULL != m_handle)
00887 {
00888 return value_type(m_data, m_list->m_subpath);
00889 }
00890 else
00891 {
00892 inetstl_message_assert("Dereferencing end()-valued iterator", 0);
00893
00894 return value_type();
00895 }
00896 }
00897
00898 template <ss_typename_param_k C, ss_typename_param_k T, ss_typename_param_k V>
00899 inline is_bool_t basic_findfile_sequence_const_input_iterator<C, T, V>::operator ==(class_type const &rhs) const
00900 {
00901 is_bool_t eq;
00902
00903
00904 inetstl_message_assert("Comparing iterators from separate sequences", m_list == rhs.m_list);
00905
00906
00907
00908 if( (NULL == m_handle) != (NULL == rhs.m_handle) ||
00909 ( NULL != m_handle &&
00910 traits_type::str_compare(m_data.cFileName, rhs.m_data.cFileName) != 0))
00911 {
00912 eq = is_false_v;
00913 }
00914 else
00915 {
00916 eq = is_true_v;
00917 }
00918
00919 return eq;
00920 }
00921
00922 template <ss_typename_param_k C, ss_typename_param_k T, ss_typename_param_k V>
00923 inline is_bool_t basic_findfile_sequence_const_input_iterator<C, T, V>::operator !=(class_type const &rhs) const
00924 {
00925 return ! operator ==(rhs);
00926 }
00927
00928 #endif
00929
00930
00931
00933
00934
00935
00936
00937
00938
00939
00940
00941
00942
00943
00944 #endif
00945
00946
00947
00948
00949
00950