/
usr
/
include
/
boost
/
/usr/include/boost
mkdir
upload
Name
Size
Mode
Actions
accumulators/
-
0755
rm
algorithm/
-
0755
rm
align/
-
0755
rm
archive/
-
0755
rm
asio/
-
0755
rm
assert/
-
0755
rm
assign/
-
0755
rm
atomic/
-
0755
rm
beast/
-
0755
rm
bimap/
-
0755
rm
bind/
-
0755
rm
callable_traits/
-
0755
rm
chrono/
-
0755
rm
circular_buffer/
-
0755
rm
compatibility/
-
0755
rm
compute/
-
0755
rm
concept/
-
0755
rm
concept_check/
-
0755
rm
config/
-
0755
rm
container/
-
0755
rm
container_hash/
-
0755
rm
context/
-
0755
rm
contract/
-
0755
rm
convert/
-
0755
rm
core/
-
0755
rm
coroutine/
-
0755
rm
coroutine2/
-
0755
rm
date_time/
-
0755
rm
detail/
-
0755
rm
dll/
-
0755
rm
dynamic_bitset/
-
0755
rm
endian/
-
0755
rm
exception/
-
0755
rm
fiber/
-
0755
rm
filesystem/
-
0755
rm
flyweight/
-
0755
rm
format/
-
0755
rm
function/
-
0755
rm
functional/
-
0755
rm
function_types/
-
0755
rm
fusion/
-
0755
rm
geometry/
-
0755
rm
gil/
-
0755
rm
graph/
-
0755
rm
hana/
-
0755
rm
heap/
-
0755
rm
histogram/
-
0755
rm
hof/
-
0755
rm
icl/
-
0755
rm
integer/
-
0755
rm
interprocess/
-
0755
rm
intrusive/
-
0755
rm
io/
-
0755
rm
iostreams/
-
0755
rm
iterator/
-
0755
rm
lambda/
-
0755
rm
lexical_cast/
-
0755
rm
locale/
-
0755
rm
local_function/
-
0755
rm
lockfree/
-
0755
rm
log/
-
0755
rm
logic/
-
0755
rm
math/
-
0755
rm
metaparse/
-
0755
rm
move/
-
0755
rm
mp11/
-
0755
rm
mpi/
-
0755
rm
mpl/
-
0755
rm
msm/
-
0755
rm
multiprecision/
-
0755
rm
multi_array/
-
0755
rm
multi_index/
-
0755
rm
nowide/
-
0755
rm
numeric/
-
0755
rm
optional/
-
0755
rm
outcome/
-
0755
rm
parameter/
-
0755
rm
pending/
-
0755
rm
phoenix/
-
0755
rm
polygon/
-
0755
rm
poly_collection/
-
0755
rm
pool/
-
0755
rm
predef/
-
0755
rm
preprocessor/
-
0755
rm
process/
-
0755
rm
program_options/
-
0755
rm
property_map/
-
0755
rm
property_tree/
-
0755
rm
proto/
-
0755
rm
ptr_container/
-
0755
rm
python/
-
0755
rm
qvm/
-
0755
rm
random/
-
0755
rm
range/
-
0755
rm
ratio/
-
0755
rm
regex/
-
0755
rm
safe_numerics/
-
0755
rm
serialization/
-
0755
rm
signals2/
-
0755
rm
smart_ptr/
-
0755
rm
sort/
-
0755
rm
spirit/
-
0755
rm
stacktrace/
-
0755
rm
statechart/
-
0755
rm
static_string/
-
0755
rm
stl_interfaces/
-
0755
rm
system/
-
0755
rm
test/
-
0755
rm
thread/
-
0755
rm
timer/
-
0755
rm
tti/
-
0755
rm
tuple/
-
0755
rm
typeof/
-
0755
rm
type_erasure/
-
0755
rm
type_index/
-
0755
rm
type_traits/
-
0755
rm
units/
-
0755
rm
unordered/
-
0755
rm
utility/
-
0755
rm
uuid/
-
0755
rm
variant/
-
0755
rm
variant2/
-
0755
rm
vmd/
-
0755
rm
wave/
-
0755
rm
winapi/
-
0755
rm
xpressive/
-
0755
rm
yap/
-
0755
rm
align.hpp
633
0644
edit
dl
rm
aligned_storage.hpp
653
0644
edit
dl
rm
any.hpp
9472
0644
edit
dl
rm
array.hpp
15827
0644
edit
dl
rm
asio.hpp
7472
0644
edit
dl
rm
assert.hpp
2625
0644
edit
dl
rm
assign.hpp
592
0644
edit
dl
rm
atomic.hpp
754
0644
edit
dl
rm
beast.hpp
591
0644
edit
dl
rm
bimap.hpp
387
0644
edit
dl
rm
bind.hpp
1809
0644
edit
dl
rm
blank.hpp
1985
0644
edit
dl
rm
blank_fwd.hpp
618
0644
edit
dl
rm
callable_traits.hpp
2138
0644
edit
dl
rm
call_traits.hpp
633
0644
edit
dl
rm
cast.hpp
584
0644
edit
dl
rm
cerrno.hpp
4187
0644
edit
dl
rm
checked_delete.hpp
414
0644
edit
dl
rm
chrono.hpp
706
0644
edit
dl
rm
circular_buffer.hpp
1946
0644
edit
dl
rm
circular_buffer_fwd.hpp
1137
0644
edit
dl
rm
compressed_pair.hpp
653
0644
edit
dl
rm
compute.hpp
1523
0644
edit
dl
rm
concept_archetype.hpp
23725
0644
edit
dl
rm
concept_check.hpp
31977
0644
edit
dl
rm
config.hpp
2216
0644
edit
dl
rm
contract.hpp
1842
0644
edit
dl
rm
contract_macro.hpp
56497
0644
edit
dl
rm
convert.hpp
7402
0644
edit
dl
rm
crc.hpp
94883
0644
edit
dl
rm
cregex.hpp
721
0644
edit
dl
rm
cstdfloat.hpp
2611
0644
edit
dl
rm
cstdint.hpp
18497
0644
edit
dl
rm
cstdlib.hpp
1739
0644
edit
dl
rm
current_function.hpp
1681
0644
edit
dl
rm
cxx11_char_types.hpp
4160
0644
edit
dl
rm
date_time.hpp
540
0644
edit
dl
rm
dll.hpp
712
0644
edit
dl
rm
dynamic_bitset.hpp
560
0644
edit
dl
rm
dynamic_bitset_fwd.hpp
675
0644
edit
dl
rm
enable_shared_from_this.hpp
525
0644
edit
dl
rm
endian.hpp
364
0644
edit
dl
rm
exception_ptr.hpp
396
0644
edit
dl
rm
filesystem.hpp
862
0644
edit
dl
rm
flyweight.hpp
604
0644
edit
dl
rm
foreach.hpp
45551
0644
edit
dl
rm
foreach_fwd.hpp
1702
0644
edit
dl
rm
format.hpp
2179
0644
edit
dl
rm
function.hpp
2524
0644
edit
dl
rm
functional.hpp
20124
0644
edit
dl
rm
function_equal.hpp
791
0644
edit
dl
rm
function_output_iterator.hpp
630
0644
edit
dl
rm
generator_iterator.hpp
2028
0644
edit
dl
rm
geometry.hpp
704
0644
edit
dl
rm
get_pointer.hpp
2288
0644
edit
dl
rm
gil.hpp
1697
0644
edit
dl
rm
hana.hpp
6807
0644
edit
dl
rm
histogram.hpp
1312
0644
edit
dl
rm
hof.hpp
2009
0644
edit
dl
rm
implicit_cast.hpp
810
0644
edit
dl
rm
indirect_reference.hpp
1036
0644
edit
dl
rm
integer.hpp
11593
0644
edit
dl
rm
integer_fwd.hpp
5181
0644
edit
dl
rm
integer_traits.hpp
8319
0644
edit
dl
rm
intrusive_ptr.hpp
481
0644
edit
dl
rm
io_fwd.hpp
1879
0644
edit
dl
rm
is_placeholder.hpp
634
0644
edit
dl
rm
iterator.hpp
459
0644
edit
dl
rm
iterator_adaptors.hpp
466
0644
edit
dl
rm
lexical_cast.hpp
3275
0644
edit
dl
rm
limits.hpp
6156
0644
edit
dl
rm
locale.hpp
887
0644
edit
dl
rm
local_function.hpp
18858
0644
edit
dl
rm
make_default.hpp
1510
0644
edit
dl
rm
make_shared.hpp
464
0644
edit
dl
rm
make_unique.hpp
293
0644
edit
dl
rm
math_fwd.hpp
975
0644
edit
dl
rm
memory_order.hpp
2457
0644
edit
dl
rm
mem_fn.hpp
596
0644
edit
dl
rm
metaparse.hpp
5281
0644
edit
dl
rm
mp11.hpp
641
0644
edit
dl
rm
mpi.hpp
1101
0644
edit
dl
rm
multi_array.hpp
18021
0644
edit
dl
rm
multi_index_container.hpp
44983
0644
edit
dl
rm
multi_index_container_fwd.hpp
3776
0644
edit
dl
rm
next_prior.hpp
5127
0644
edit
dl
rm
noncopyable.hpp
402
0644
edit
dl
rm
nondet_random.hpp
532
0644
edit
dl
rm
none.hpp
1609
0644
edit
dl
rm
none_t.hpp
953
0644
edit
dl
rm
non_type.hpp
619
0644
edit
dl
rm
operators.hpp
36574
0644
edit
dl
rm
operators_v1.hpp
37735
0644
edit
dl
rm
optional.hpp
528
0644
edit
dl
rm
outcome.hpp
1699
0644
edit
dl
rm
parameter.hpp
1082
0644
edit
dl
rm
phoenix.hpp
476
0644
edit
dl
rm
pointee.hpp
1807
0644
edit
dl
rm
pointer_cast.hpp
3688
0644
edit
dl
rm
pointer_to_other.hpp
1197
0644
edit
dl
rm
polymorphic_cast.hpp
5282
0644
edit
dl
rm
polymorphic_pointer_cast.hpp
2829
0644
edit
dl
rm
predef.h
635
0644
edit
dl
rm
preprocessor.hpp
487
0644
edit
dl
rm
process.hpp
1366
0644
edit
dl
rm
program_options.hpp
820
0644
edit
dl
rm
progress.hpp
5734
0644
edit
dl
rm
python.hpp
2950
0644
edit
dl
rm
random.hpp
3854
0644
edit
dl
rm
range.hpp
603
0644
edit
dl
rm
ratio.hpp
349
0644
edit
dl
rm
rational.hpp
39720
0644
edit
dl
rm
ref.hpp
370
0644
edit
dl
rm
regex.h
2174
0644
edit
dl
rm
regex.hpp
823
0644
edit
dl
rm
regex_fwd.hpp
693
0644
edit
dl
rm
scoped_array.hpp
506
0644
edit
dl
rm
scoped_ptr.hpp
497
0644
edit
dl
rm
scope_exit.hpp
54745
0644
edit
dl
rm
shared_array.hpp
536
0644
edit
dl
rm
shared_container_iterator.hpp
2154
0644
edit
dl
rm
shared_ptr.hpp
525
0644
edit
dl
rm
signals2.hpp
752
0644
edit
dl
rm
smart_ptr.hpp
780
0644
edit
dl
rm
spirit.hpp
1133
0644
edit
dl
rm
stacktrace.hpp
499
0644
edit
dl
rm
static_assert.hpp
7213
0644
edit
dl
rm
static_string.hpp
423
0644
edit
dl
rm
swap.hpp
374
0644
edit
dl
rm
thread.hpp
839
0644
edit
dl
rm
throw_exception.hpp
4328
0644
edit
dl
rm
timer.hpp
2781
0644
edit
dl
rm
tokenizer.hpp
2783
0644
edit
dl
rm
token_functions.hpp
19349
0644
edit
dl
rm
token_iterator.hpp
3810
0644
edit
dl
rm
type.hpp
481
0644
edit
dl
rm
type_index.hpp
10757
0644
edit
dl
rm
type_traits.hpp
7431
0644
edit
dl
rm
unordered_map.hpp
568
0644
edit
dl
rm
unordered_set.hpp
568
0644
edit
dl
rm
utility.hpp
880
0644
edit
dl
rm
variant.hpp
883
0644
edit
dl
rm
version.hpp
1117
0644
edit
dl
rm
visit_each.hpp
690
0644
edit
dl
rm
wave.hpp
944
0644
edit
dl
rm
weak_ptr.hpp
462
0644
edit
dl
rm
Edit:
/usr/include/boost/token_functions.hpp
(19349B)
// Boost token_functions.hpp ------------------------------------------------// // Copyright John R. Bandela 2001. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org/libs/tokenizer/ for documentation. // Revision History: // 01 Oct 2004 Joaquin M Lopez Munoz // Workaround for a problem with string::assign in msvc-stlport // 06 Apr 2004 John Bandela // Fixed a bug involving using char_delimiter with a true input iterator // 28 Nov 2003 Robert Zeh and John Bandela // Converted into "fast" functions that avoid using += when // the supplied iterator isn't an input_iterator; based on // some work done at Archelon and a version that was checked into // the boost CVS for a short period of time. // 20 Feb 2002 John Maddock // Removed using namespace std declarations and added // workaround for BOOST_NO_STDC_NAMESPACE (the library // can be safely mixed with regex). // 06 Feb 2002 Jeremy Siek // Added char_separator. // 02 Feb 2002 Jeremy Siek // Removed tabs and a little cleanup. #ifndef BOOST_TOKEN_FUNCTIONS_JRB120303_HPP_ #define BOOST_TOKEN_FUNCTIONS_JRB120303_HPP_ #include <vector> #include <stdexcept> #include <string> #include <cctype> #include <algorithm> // for find_if #include <boost/config.hpp> #include <boost/assert.hpp> #include <boost/type_traits/is_pointer.hpp> #include <boost/detail/workaround.hpp> #include <boost/mpl/if.hpp> #include <boost/throw_exception.hpp> #if !defined(BOOST_NO_CWCTYPE) #include <cwctype> #endif // // the following must not be macros if we are to prefix them // with std:: (they shouldn't be macros anyway...) // #ifdef ispunct # undef ispunct #endif #ifdef iswpunct # undef iswpunct #endif #ifdef isspace # undef isspace #endif #ifdef iswspace # undef iswspace #endif // // fix namespace problems: // #ifdef BOOST_NO_STDC_NAMESPACE namespace std{ using ::ispunct; using ::isspace; #if !defined(BOOST_NO_CWCTYPE) using ::iswpunct; using ::iswspace; #endif } #endif namespace boost{ //=========================================================================== // The escaped_list_separator class. Which is a model of TokenizerFunction // An escaped list is a super-set of what is commonly known as a comma // separated value (csv) list.It is separated into fields by a comma or // other character. If the delimiting character is inside quotes, then it is // counted as a regular character.To allow for embedded quotes in a field, // there can be escape sequences using the \ much like C. // The role of the comma, the quotation mark, and the escape // character (backslash \), can be assigned to other characters. struct escaped_list_error : public std::runtime_error{ escaped_list_error(const std::string& what_arg):std::runtime_error(what_arg) { } }; // The out of the box GCC 2.95 on cygwin does not have a char_traits class. // MSVC does not like the following typename template <class Char, class Traits = BOOST_DEDUCED_TYPENAME std::basic_string<Char>::traits_type > class escaped_list_separator { private: typedef std::basic_string<Char,Traits> string_type; struct char_eq { Char e_; char_eq(Char e):e_(e) { } bool operator()(Char c) { return Traits::eq(e_,c); } }; string_type escape_; string_type c_; string_type quote_; bool last_; bool is_escape(Char e) { char_eq f(e); return std::find_if(escape_.begin(),escape_.end(),f)!=escape_.end(); } bool is_c(Char e) { char_eq f(e); return std::find_if(c_.begin(),c_.end(),f)!=c_.end(); } bool is_quote(Char e) { char_eq f(e); return std::find_if(quote_.begin(),quote_.end(),f)!=quote_.end(); } template <typename iterator, typename Token> void do_escape(iterator& next,iterator end,Token& tok) { if (++next == end) BOOST_THROW_EXCEPTION(escaped_list_error(std::string("cannot end with escape"))); if (Traits::eq(*next,'n')) { tok+='\n'; return; } else if (is_quote(*next)) { tok+=*next; return; } else if (is_c(*next)) { tok+=*next; return; } else if (is_escape(*next)) { tok+=*next; return; } else BOOST_THROW_EXCEPTION(escaped_list_error(std::string("unknown escape sequence"))); } public: explicit escaped_list_separator(Char e = '\\', Char c = ',',Char q = '\"') : escape_(1,e), c_(1,c), quote_(1,q), last_(false) { } escaped_list_separator(string_type e, string_type c, string_type q) : escape_(e), c_(c), quote_(q), last_(false) { } void reset() {last_=false;} template <typename InputIterator, typename Token> bool operator()(InputIterator& next,InputIterator end,Token& tok) { bool bInQuote = false; tok = Token(); if (next == end) { if (last_) { last_ = false; return true; } else return false; } last_ = false; for (;next != end;++next) { if (is_escape(*next)) { do_escape(next,end,tok); } else if (is_c(*next)) { if (!bInQuote) { // If we are not in quote, then we are done ++next; // The last character was a c, that means there is // 1 more blank field last_ = true; return true; } else tok+=*next; } else if (is_quote(*next)) { bInQuote=!bInQuote; } else { tok += *next; } } return true; } }; //=========================================================================== // The classes here are used by offset_separator and char_separator to implement // faster assigning of tokens using assign instead of += namespace tokenizer_detail { //=========================================================================== // Tokenizer was broken for wide character separators, at least on Windows, since // CRT functions isspace etc only expect values in [0, 0xFF]. Debug build asserts // if higher values are passed in. The traits extension class should take care of this. // Assuming that the conditional will always get optimized out in the function // implementations, argument types are not a problem since both forms of character classifiers // expect an int. #if !defined(BOOST_NO_CWCTYPE) template<typename traits, int N> struct traits_extension_details : public traits { typedef typename traits::char_type char_type; static bool isspace(char_type c) { return std::iswspace(c) != 0; } static bool ispunct(char_type c) { return std::iswpunct(c) != 0; } }; template<typename traits> struct traits_extension_details<traits, 1> : public traits { typedef typename traits::char_type char_type; static bool isspace(char_type c) { return std::isspace(c) != 0; } static bool ispunct(char_type c) { return std::ispunct(c) != 0; } }; #endif // In case there is no cwctype header, we implement the checks manually. // We make use of the fact that the tested categories should fit in ASCII. template<typename traits> struct traits_extension : public traits { typedef typename traits::char_type char_type; static bool isspace(char_type c) { #if !defined(BOOST_NO_CWCTYPE) return traits_extension_details<traits, sizeof(char_type)>::isspace(c); #else return static_cast< unsigned >(c) <= 255 && std::isspace(c) != 0; #endif } static bool ispunct(char_type c) { #if !defined(BOOST_NO_CWCTYPE) return traits_extension_details<traits, sizeof(char_type)>::ispunct(c); #else return static_cast< unsigned >(c) <= 255 && std::ispunct(c) != 0; #endif } }; // The assign_or_plus_equal struct contains functions that implement // assign, +=, and clearing based on the iterator type. The // generic case does nothing for plus_equal and clearing, while // passing through the call for assign. // // When an input iterator is being used, the situation is reversed. // The assign method does nothing, plus_equal invokes operator +=, // and the clearing method sets the supplied token to the default // token constructor's result. // template<class IteratorTag> struct assign_or_plus_equal { template<class Iterator, class Token> static void assign(Iterator b, Iterator e, Token &t) { t.assign(b, e); } template<class Token, class Value> static void plus_equal(Token &, const Value &) { } // If we are doing an assign, there is no need for the // the clear. // template<class Token> static void clear(Token &) { } }; template <> struct assign_or_plus_equal<std::input_iterator_tag> { template<class Iterator, class Token> static void assign(Iterator , Iterator , Token &) { } template<class Token, class Value> static void plus_equal(Token &t, const Value &v) { t += v; } template<class Token> static void clear(Token &t) { t = Token(); } }; template<class Iterator> struct pointer_iterator_category{ typedef std::random_access_iterator_tag type; }; template<class Iterator> struct class_iterator_category{ typedef typename Iterator::iterator_category type; }; // This portably gets the iterator_tag without partial template specialization template<class Iterator> struct get_iterator_category{ typedef typename mpl::if_<is_pointer<Iterator>, pointer_iterator_category<Iterator>, class_iterator_category<Iterator> >::type cat; typedef typename cat::type iterator_category; }; } // namespace tokenizer_detail //=========================================================================== // The offset_separator class, which is a model of TokenizerFunction. // Offset breaks a string into tokens based on a range of offsets class offset_separator { private: std::vector<int> offsets_; unsigned int current_offset_; bool wrap_offsets_; bool return_partial_last_; public: template <typename Iter> offset_separator(Iter begin, Iter end, bool wrap_offsets = true, bool return_partial_last = true) : offsets_(begin,end), current_offset_(0), wrap_offsets_(wrap_offsets), return_partial_last_(return_partial_last) { } offset_separator() : offsets_(1,1), current_offset_(), wrap_offsets_(true), return_partial_last_(true) { } void reset() { current_offset_ = 0; } template <typename InputIterator, typename Token> bool operator()(InputIterator& next, InputIterator end, Token& tok) { typedef tokenizer_detail::assign_or_plus_equal< BOOST_DEDUCED_TYPENAME tokenizer_detail::get_iterator_category< InputIterator >::iterator_category > assigner; BOOST_ASSERT(!offsets_.empty()); assigner::clear(tok); InputIterator start(next); if (next == end) return false; if (current_offset_ == offsets_.size()) { if (wrap_offsets_) current_offset_=0; else return false; } int c = offsets_[current_offset_]; int i = 0; for (; i < c; ++i) { if (next == end)break; assigner::plus_equal(tok,*next++); } assigner::assign(start,next,tok); if (!return_partial_last_) if (i < (c-1) ) return false; ++current_offset_; return true; } }; //=========================================================================== // The char_separator class breaks a sequence of characters into // tokens based on the character delimiters (very much like bad old // strtok). A delimiter character can either be kept or dropped. A // kept delimiter shows up as an output token, whereas a dropped // delimiter does not. // This class replaces the char_delimiters_separator class. The // constructor for the char_delimiters_separator class was too // confusing and needed to be deprecated. However, because of the // default arguments to the constructor, adding the new constructor // would cause ambiguity, so instead I deprecated the whole class. // The implementation of the class was also simplified considerably. enum empty_token_policy { drop_empty_tokens, keep_empty_tokens }; // The out of the box GCC 2.95 on cygwin does not have a char_traits class. template <typename Char, typename Tr = BOOST_DEDUCED_TYPENAME std::basic_string<Char>::traits_type > class char_separator { typedef tokenizer_detail::traits_extension<Tr> Traits; typedef std::basic_string<Char,Tr> string_type; public: explicit char_separator(const Char* dropped_delims, const Char* kept_delims = 0, empty_token_policy empty_tokens = drop_empty_tokens) : m_dropped_delims(dropped_delims), m_use_ispunct(false), m_use_isspace(false), m_empty_tokens(empty_tokens), m_output_done(false) { // Borland workaround if (kept_delims) m_kept_delims = kept_delims; } // use ispunct() for kept delimiters and isspace for dropped. explicit char_separator() : m_use_ispunct(true), m_use_isspace(true), m_empty_tokens(drop_empty_tokens), m_output_done(false) { } void reset() { } template <typename InputIterator, typename Token> bool operator()(InputIterator& next, InputIterator end, Token& tok) { typedef tokenizer_detail::assign_or_plus_equal< BOOST_DEDUCED_TYPENAME tokenizer_detail::get_iterator_category< InputIterator >::iterator_category > assigner; assigner::clear(tok); // skip past all dropped_delims if (m_empty_tokens == drop_empty_tokens) for (; next != end && is_dropped(*next); ++next) { } InputIterator start(next); if (m_empty_tokens == drop_empty_tokens) { if (next == end) return false; // if we are on a kept_delims move past it and stop if (is_kept(*next)) { assigner::plus_equal(tok,*next); ++next; } else // append all the non delim characters for (; next != end && !is_dropped(*next) && !is_kept(*next); ++next) assigner::plus_equal(tok,*next); } else { // m_empty_tokens == keep_empty_tokens // Handle empty token at the end if (next == end) { if (m_output_done == false) { m_output_done = true; assigner::assign(start,next,tok); return true; } else return false; } if (is_kept(*next)) { if (m_output_done == false) m_output_done = true; else { assigner::plus_equal(tok,*next); ++next; m_output_done = false; } } else if (m_output_done == false && is_dropped(*next)) { m_output_done = true; } else { if (is_dropped(*next)) start=++next; for (; next != end && !is_dropped(*next) && !is_kept(*next); ++next) assigner::plus_equal(tok,*next); m_output_done = true; } } assigner::assign(start,next,tok); return true; } private: string_type m_kept_delims; string_type m_dropped_delims; bool m_use_ispunct; bool m_use_isspace; empty_token_policy m_empty_tokens; bool m_output_done; bool is_kept(Char E) const { if (m_kept_delims.length()) return m_kept_delims.find(E) != string_type::npos; else if (m_use_ispunct) { return Traits::ispunct(E) != 0; } else return false; } bool is_dropped(Char E) const { if (m_dropped_delims.length()) return m_dropped_delims.find(E) != string_type::npos; else if (m_use_isspace) { return Traits::isspace(E) != 0; } else return false; } }; //=========================================================================== // The following class is DEPRECATED, use class char_separators instead. // // The char_delimiters_separator class, which is a model of // TokenizerFunction. char_delimiters_separator breaks a string // into tokens based on character delimiters. There are 2 types of // delimiters. returnable delimiters can be returned as // tokens. These are often punctuation. nonreturnable delimiters // cannot be returned as tokens. These are often whitespace // The out of the box GCC 2.95 on cygwin does not have a char_traits class. template <class Char, class Tr = BOOST_DEDUCED_TYPENAME std::basic_string<Char>::traits_type > class char_delimiters_separator { private: typedef tokenizer_detail::traits_extension<Tr> Traits; typedef std::basic_string<Char,Tr> string_type; string_type returnable_; string_type nonreturnable_; bool return_delims_; bool no_ispunct_; bool no_isspace_; bool is_ret(Char E)const { if (returnable_.length()) return returnable_.find(E) != string_type::npos; else{ if (no_ispunct_) {return false;} else{ int r = Traits::ispunct(E); return r != 0; } } } bool is_nonret(Char E)const { if (nonreturnable_.length()) return nonreturnable_.find(E) != string_type::npos; else{ if (no_isspace_) {return false;} else{ int r = Traits::isspace(E); return r != 0; } } } public: explicit char_delimiters_separator(bool return_delims = false, const Char* returnable = 0, const Char* nonreturnable = 0) : returnable_(returnable ? returnable : string_type().c_str()), nonreturnable_(nonreturnable ? nonreturnable:string_type().c_str()), return_delims_(return_delims), no_ispunct_(returnable!=0), no_isspace_(nonreturnable!=0) { } void reset() { } public: template <typename InputIterator, typename Token> bool operator()(InputIterator& next, InputIterator end,Token& tok) { tok = Token(); // skip past all nonreturnable delims // skip past the returnable only if we are not returning delims for (;next!=end && ( is_nonret(*next) || (is_ret(*next) && !return_delims_ ) );++next) { } if (next == end) { return false; } // if we are to return delims and we are one a returnable one // move past it and stop if (is_ret(*next) && return_delims_) { tok+=*next; ++next; } else // append all the non delim characters for (;next!=end && !is_nonret(*next) && !is_ret(*next);++next) tok+=*next; return true; } }; } //namespace boost #endif
Save
cmd:
run