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
00042
00051 #ifndef STLSOFT_INCL_STLSOFT_ITERATORS_HPP_C_STR_INSERTER
00052 #define STLSOFT_INCL_STLSOFT_ITERATORS_HPP_C_STR_INSERTER
00053
00054 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00055 # define STLSOFT_VER_STLSOFT_ITERATORS_HPP_C_STR_INSERTER_MAJOR 2
00056 # define STLSOFT_VER_STLSOFT_ITERATORS_HPP_C_STR_INSERTER_MINOR 0
00057 # define STLSOFT_VER_STLSOFT_ITERATORS_HPP_C_STR_INSERTER_REVISION 2
00058 # define STLSOFT_VER_STLSOFT_ITERATORS_HPP_C_STR_INSERTER_EDIT 29
00059 #endif
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075 #ifndef STLSOFT_INCL_STLSOFT_H_STLSOFT
00076 # include <stlsoft/stlsoft.h>
00077 #endif
00078 #ifndef STLSOFT_INCL_STLSOFT_SHIMS_ACCESS_HPP_STRING
00079 # include <stlsoft/shims/access/string.hpp>
00080 #endif
00081 #ifndef STLSOFT_INCL_STLSOFT_UTIL_STD_HPP_ITERATOR_HELPER
00082 # include <stlsoft/util/std/iterator_helper.hpp>
00083 #endif
00084
00085
00086
00087
00088
00089 #ifndef _STLSOFT_NO_NAMESPACE
00090 namespace stlsoft
00091 {
00092 #endif
00093
00094
00095
00096
00097
00118 template <ss_typename_param_k F>
00119 struct c_str_ptr_extract_iterator
00120 : public stlsoft_ns_qual(iterator_base)<stlsoft_ns_qual_std(output_iterator_tag), void, void, void, void>
00121 {
00122 public:
00123 typedef F function_type;
00124 typedef c_str_ptr_extract_iterator<F> class_type;
00125 private:
00126 class deref_proxy;
00127 friend class deref_proxy;
00128
00129 public:
00130 ss_explicit_k c_str_ptr_extract_iterator(F &f)
00131 : m_f(f)
00132 {}
00133
00134 deref_proxy operator *()
00135 {
00136 return deref_proxy(this);
00137 }
00138 class_type& operator ++()
00139 {
00140 return *this;
00141 }
00142 class_type operator ++(int)
00143 {
00144 return class_type(m_f);
00145 }
00146
00149 private:
00150 class deref_proxy
00151 {
00152 public:
00153 deref_proxy(c_str_ptr_extract_iterator *it)
00154 : m_it(it)
00155 {}
00156
00157 public:
00158 template <ss_typename_param_k S>
00159 void operator =(S const& s)
00160 {
00161 m_it->invoke_(s);
00162 }
00163
00164 private:
00165 c_str_ptr_extract_iterator *const m_it;
00166
00167
00168 private:
00169 void operator =(deref_proxy const&);
00170 };
00172
00175 private:
00176 template <ss_typename_param_k S>
00177 void invoke_(S const& s)
00178 {
00179
00180
00181 m_f = stlsoft_ns_qual(c_str_ptr)(stlsoft_ns_qual(c_str_ptr)(s));
00182 }
00184
00185 private:
00186 F m_f;
00187 };
00188
00193 template <ss_typename_param_k F>
00194 inline c_str_ptr_extract_iterator<F> c_str_inserter(F &f)
00195 {
00196 return c_str_ptr_extract_iterator<F>(f);
00197 }
00198
00205 template <ss_typename_param_k F>
00206 inline c_str_ptr_extract_iterator<F> c_str_ptr_inserter(F &f)
00207 {
00208 return c_str_ptr_extract_iterator<F>(f);
00209 }
00210
00211
00212
00213 #ifndef _STLSOFT_NO_NAMESPACE
00214 }
00215 #endif
00216
00217
00218
00219 #endif
00220
00221