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
00049 #ifndef INETSTL_INCL_INETSTL_FILESYSTEM_HPP_FTPDIR_SEQUENCE
00050 #define INETSTL_INCL_INETSTL_FILESYSTEM_HPP_FTPDIR_SEQUENCE
00051
00052 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00053 # define INETSTL_VER_INETSTL_FILESYSTEM_HPP_FTPDIR_SEQUENCE_MAJOR 2
00054 # define INETSTL_VER_INETSTL_FILESYSTEM_HPP_FTPDIR_SEQUENCE_MINOR 1
00055 # define INETSTL_VER_INETSTL_FILESYSTEM_HPP_FTPDIR_SEQUENCE_REVISION 3
00056 # define INETSTL_VER_INETSTL_FILESYSTEM_HPP_FTPDIR_SEQUENCE_EDIT 27
00057 #endif
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073 #ifndef INETSTL_INCL_INETSTL_H_INETSTL
00074 # include <inetstl/inetstl.h>
00075 #endif
00076 #ifndef INETSTL_OS_IS_WINDOWS
00077 # error This file is currently compatible only with the Win32/Win64 API
00078 #endif
00079 #ifndef INETSTL_INCL_INETSTL_FILESYSTEM_HPP_FILESYSTEM_TRAITS
00080 # include <inetstl/filesystem/filesystem_traits.hpp>
00081 #endif
00082 #ifdef STLSOFT_CF_EXCEPTION_SUPPORT
00083 # ifndef INETSTL_INCL_INETSTL_ERROR_HPP_EXCEPTIONS
00084 # include <inetstl/error/exceptions.hpp>
00085 # endif
00086 #else
00087 # ifndef STLSOFT_INCL_STLSOFT_ERROR_HPP_EXCEPTIONS
00088 # include <stlsoft/error/exceptions.hpp>
00089 # endif
00090 #endif
00091 #ifndef INETSTL_INCL_INETSTL_FILESYSTEM_HPP_FINDFILE_SEQUENCE
00092 # include <inetstl/filesystem/findfile_sequence.hpp>
00093 #endif
00094 #ifndef STLSOFT_INCL_STLSOFT_COLLECTIONS_UTIL_HPP_COLLECTIONS
00095 # include <stlsoft/collections/util/collections.hpp>
00096 #endif
00097
00098 #ifndef STLSOFT_INCL_ALGORITHM
00099 # define STLSOFT_INCL_ALGORITHM
00100 # include <algorithm>
00101 #endif
00102 #ifndef STLSOFT_INCL_ITERATOR
00103 # define STLSOFT_INCL_ITERATOR
00104 # include <iterator>
00105 #endif
00106 #ifndef STLSOFT_INCL_VECTOR
00107 # define STLSOFT_INCL_VECTOR
00108 # include <vector>
00109 #endif
00110
00111
00112
00113
00114
00115 #ifndef _INETSTL_NO_NAMESPACE
00116 # if defined(_STLSOFT_NO_NAMESPACE) || \
00117 defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
00118
00119 namespace inetstl
00120 {
00121 # else
00122
00123
00124 namespace stlsoft
00125 {
00126
00127 namespace inetstl_project
00128 {
00129
00130 # endif
00131 #endif
00132
00133
00134
00135
00136
00142 template< ss_typename_param_k C
00143 #ifdef STLSOFT_CF_TEMPLATE_CLASS_DEFAULT_CLASS_ARGUMENT_SUPPORT
00144 # ifdef STLSOFT_CF_EXCEPTION_SUPPORT
00145 , ss_typename_param_k X = throw_internet_exception_policy
00146 # else
00147 , ss_typename_param_k X = stlsoft_ns_qual(null_exception_policy)
00148 # endif
00149 , ss_typename_param_k T = filesystem_traits<C>
00150 #else
00151 , ss_typename_param_k X
00152 , ss_typename_param_k T
00153 #endif
00154 >
00155 class basic_ftpdir_sequence
00156 : public stlsoft_ns_qual(stl_collection_tag)
00157 {
00160 private:
00161 typedef basic_findfile_sequence<C, T, X> sequence_type_;
00162 public:
00163 typedef ss_typename_type_k sequence_type_::char_type char_type;
00164 typedef ss_typename_type_k sequence_type_::value_type value_type;
00165 typedef ss_typename_type_k sequence_type_::size_type size_type;
00166 typedef ss_typename_type_k sequence_type_::bool_type bool_type;
00167 typedef is_sint_t flags_type;
00168 private:
00169 typedef stlsoft_ns_qual_std(vector)<value_type> values_type_;
00170 public:
00171 typedef ss_typename_type_k values_type_::const_reference const_reference;
00172 typedef ss_typename_type_k values_type_::const_iterator const_iterator;
00173 typedef ss_typename_type_k values_type_::const_reverse_iterator const_reverse_iterator;
00174 typedef basic_ftpdir_sequence<C, X, T> class_type;
00176
00179 public:
00180 enum search_flags
00181 {
00182 includeDots = sequence_type_::includeDots
00183 , directories = sequence_type_::directories
00184 , files = sequence_type_::files
00185 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00186 , noSort = sequence_type_::noSort
00187 #endif
00188 };
00190
00193 public:
00194 basic_ftpdir_sequence( HINTERNET hconn
00195 , char_type const* pattern
00196 , flags_type flags = directories | files)
00197 {
00198 sequence_type_ ffs(hconn, pattern, flags);
00199
00200 stlsoft_ns_qual_std(copy)(ffs.begin(), ffs.end(), stlsoft_ns_qual_std(back_inserter)(m_values));
00201 }
00203 basic_ftpdir_sequence( HINTERNET hconn
00204 , char_type const* directory
00205 , char_type const* pattern
00206 , flags_type flags = directories | files)
00207 {
00208 sequence_type_ ffs(hconn, directory, pattern, flags);
00209
00210 stlsoft_ns_qual_std(copy)(ffs.begin(), ffs.end(), stlsoft_ns_qual_std(back_inserter)(m_values));
00211 }
00213 basic_ftpdir_sequence( HINTERNET hconn
00214 , char_type const* directory
00215 , char_type const* patterns
00216 , char_type delim
00217 , flags_type flags = directories | files)
00218 {
00219 sequence_type_ ffs(hconn, directory, patterns, delim, flags);
00220
00221 stlsoft_ns_qual_std(copy)(ffs.begin(), ffs.end(), stlsoft_ns_qual_std(back_inserter)(m_values));
00222 }
00223
00224 #ifdef STLSOFT_DOCUMENTATION_SKIP_SECTION
00226 basic_ftpdir_sequence(class_type const& rhs);
00228 class_type& operator =(class_type const& rhs);
00229 #endif
00231
00234 public:
00235 const_reference operator [](size_type index) const
00236 {
00237 INETSTL_MESSAGE_ASSERT("Invalid index", index < size());
00238
00239 return m_values[index];
00240 }
00242
00245 public:
00246 const_iterator begin() const
00247 {
00248 return m_values.begin();
00249 }
00250 const_iterator end() const
00251 {
00252 return m_values.end();
00253 }
00254 const_reverse_iterator rbegin() const
00255 {
00256 return m_values.rbegin();
00257 }
00258 const_reverse_iterator rend() const
00259 {
00260 return m_values.rend();
00261 }
00263
00266 public:
00267 size_type size() const
00268 {
00269 return m_values.size();
00270 }
00271 bool_type empty() const
00272 {
00273 return m_values.empty();
00274 }
00276
00279 private:
00280 values_type_ m_values;
00282 };
00283
00284
00285
00286
00287
00292 typedef basic_ftpdir_sequence<is_char_a_t
00293 #ifdef STLSOFT_CF_EXCEPTION_SUPPORT
00294 , throw_internet_exception_policy
00295 #else
00296 , stlsoft_ns_qual(null_exception_policy)
00297 #endif
00298 , filesystem_traits<is_char_a_t>
00299 > ftpdir_sequence_a;
00304 typedef basic_ftpdir_sequence<is_char_w_t
00305 #ifdef STLSOFT_CF_EXCEPTION_SUPPORT
00306 , throw_internet_exception_policy
00307 #else
00308 , stlsoft_ns_qual(null_exception_policy)
00309 #endif
00310 , filesystem_traits<is_char_w_t>
00311 > ftpdir_sequence_w;
00316 typedef basic_ftpdir_sequence<TCHAR
00317 #ifdef STLSOFT_CF_EXCEPTION_SUPPORT
00318 , throw_internet_exception_policy
00319 #else
00320 , stlsoft_ns_qual(null_exception_policy)
00321 #endif
00322 , filesystem_traits<TCHAR>
00323 > ftpdir_sequence;
00324
00326
00327
00328 #ifdef STLSOFT_UNITTEST
00329 # include "./unittest/ftpdir_sequence_unittest_.h"
00330 #endif
00331
00333
00334
00335 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00336
00337
00338
00339 #endif
00340
00341
00342
00343 #ifndef _INETSTL_NO_NAMESPACE
00344 # if defined(_STLSOFT_NO_NAMESPACE) || \
00345 defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
00346 }
00347 # else
00348 }
00349 }
00350 # endif
00351 #endif
00352
00353
00354
00355 #endif
00356
00357