/
usr
/
include
/
boost
/
regex
/
v4
/
/usr/include/boost/regex/v4
mkdir
upload
Name
Size
Mode
Actions
basic_regex.hpp
24089
0644
edit
dl
rm
basic_regex_creator.hpp
54206
0644
edit
dl
rm
basic_regex_parser.hpp
112851
0644
edit
dl
rm
char_regex_traits.hpp
1726
0644
edit
dl
rm
cpp_regex_traits.hpp
39425
0644
edit
dl
rm
cregex.hpp
10987
0644
edit
dl
rm
c_regex_traits.hpp
5497
0644
edit
dl
rm
error_type.hpp
1258
0644
edit
dl
rm
fileiter.hpp
14377
0644
edit
dl
rm
indexed_bit_flag.hpp
1316
0644
edit
dl
rm
instances.hpp
9080
0644
edit
dl
rm
iterator_category.hpp
1960
0644
edit
dl
rm
iterator_traits.hpp
3802
0644
edit
dl
rm
match_flags.hpp
6934
0644
edit
dl
rm
match_results.hpp
22773
0644
edit
dl
rm
mem_block_cache.hpp
3132
0644
edit
dl
rm
perl_matcher.hpp
18847
0644
edit
dl
rm
perl_matcher_common.hpp
30476
0644
edit
dl
rm
perl_matcher_non_recursive.hpp
63238
0644
edit
dl
rm
perl_matcher_recursive.hpp
34540
0644
edit
dl
rm
primary_transform.hpp
3347
0644
edit
dl
rm
protected_call.hpp
1688
0644
edit
dl
rm
regbase.hpp
5972
0644
edit
dl
rm
regex.hpp
4590
0644
edit
dl
rm
regex_format.hpp
34231
0644
edit
dl
rm
regex_fwd.hpp
1646
0644
edit
dl
rm
regex_grep.hpp
4879
0644
edit
dl
rm
regex_iterator.hpp
6474
0644
edit
dl
rm
regex_match.hpp
14475
0644
edit
dl
rm
regex_merge.hpp
2765
0644
edit
dl
rm
regex_raw_buffer.hpp
3686
0644
edit
dl
rm
regex_replace.hpp
2925
0644
edit
dl
rm
regex_search.hpp
7097
0644
edit
dl
rm
regex_split.hpp
4956
0644
edit
dl
rm
regex_token_iterator.hpp
12613
0644
edit
dl
rm
regex_traits.hpp
4965
0644
edit
dl
rm
regex_traits_defaults.hpp
11555
0644
edit
dl
rm
regex_workaround.hpp
6171
0644
edit
dl
rm
states.hpp
11915
0644
edit
dl
rm
sub_match.hpp
23155
0644
edit
dl
rm
syntax_type.hpp
4374
0644
edit
dl
rm
u32regex_iterator.hpp
6475
0644
edit
dl
rm
u32regex_token_iterator.hpp
15068
0644
edit
dl
rm
w32_regex_traits.hpp
24455
0644
edit
dl
rm
Edit:
/usr/include/boost/regex/v4/regex_grep.hpp
(4879B)
/* * * Copyright (c) 1998-2002 * John Maddock * * Use, modification and distribution are subject to 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) * */ /* * LOCATION: see http://www.boost.org for most recent version. * FILE regex_grep.hpp * VERSION see <boost/version.hpp> * DESCRIPTION: Provides regex_grep implementation. */ #ifndef BOOST_REGEX_V4_REGEX_GREP_HPP #define BOOST_REGEX_V4_REGEX_GREP_HPP namespace boost{ #ifdef BOOST_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif #ifdef BOOST_MSVC #pragma warning(pop) #endif // // regex_grep: // find all non-overlapping matches within the sequence first last: // template <class Predicate, class BidiIterator, class charT, class traits> inline unsigned int regex_grep(Predicate foo, BidiIterator first, BidiIterator last, const basic_regex<charT, traits>& e, match_flag_type flags = match_default) { if(e.flags() & regex_constants::failbit) return false; typedef typename match_results<BidiIterator>::allocator_type match_allocator_type; match_results<BidiIterator> m; BOOST_REGEX_DETAIL_NS::perl_matcher<BidiIterator, match_allocator_type, traits> matcher(first, last, m, e, flags, first); unsigned int count = 0; while(matcher.find()) { ++count; if(0 == foo(m)) return count; // caller doesn't want to go on if(m[0].second == last) return count; // we've reached the end, don't try and find an extra null match. if(m.length() == 0) { if(m[0].second == last) return count; // we found a NULL-match, now try to find // a non-NULL one at the same position: match_results<BidiIterator, match_allocator_type> m2(m); matcher.setf(match_not_null | match_continuous); if(matcher.find()) { ++count; if(0 == foo(m)) return count; } else { // reset match back to where it was: m = m2; } matcher.unsetf((match_not_null | match_continuous) & ~flags); } } return count; } // // regex_grep convenience interfaces: #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING // // this isn't really a partial specialisation, but template function // overloading - if the compiler doesn't support partial specialisation // then it really won't support this either: template <class Predicate, class charT, class traits> inline unsigned int regex_grep(Predicate foo, const charT* str, const basic_regex<charT, traits>& e, match_flag_type flags = match_default) { return regex_grep(foo, str, str + traits::length(str), e, flags); } template <class Predicate, class ST, class SA, class charT, class traits> inline unsigned int regex_grep(Predicate foo, const std::basic_string<charT, ST, SA>& s, const basic_regex<charT, traits>& e, match_flag_type flags = match_default) { return regex_grep(foo, s.begin(), s.end(), e, flags); } #else // partial specialisation inline unsigned int regex_grep(bool (*foo)(const cmatch&), const char* str, const regex& e, match_flag_type flags = match_default) { return regex_grep(foo, str, str + regex::traits_type::length(str), e, flags); } #ifndef BOOST_NO_WREGEX inline unsigned int regex_grep(bool (*foo)(const wcmatch&), const wchar_t* str, const wregex& e, match_flag_type flags = match_default) { return regex_grep(foo, str, str + wregex::traits_type::length(str), e, flags); } #endif inline unsigned int regex_grep(bool (*foo)(const match_results<std::string::const_iterator>&), const std::string& s, const regex& e, match_flag_type flags = match_default) { return regex_grep(foo, s.begin(), s.end(), e, flags); } #if !defined(BOOST_NO_WREGEX) inline unsigned int regex_grep(bool (*foo)(const match_results<std::basic_string<wchar_t>::const_iterator>&), const std::basic_string<wchar_t>& s, const wregex& e, match_flag_type flags = match_default) { return regex_grep(foo, s.begin(), s.end(), e, flags); } #endif #endif #ifdef BOOST_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif #ifdef BOOST_MSVC #pragma warning(pop) #endif } // namespace boost #endif // BOOST_REGEX_V4_REGEX_GREP_HPP
Save
cmd:
run