x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
iter_find.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\algorithm\string\iter_find.hpp
旋转
特效
属性
历史版本
// Boost string_algo library iter_find.hpp header file ---------------------------// // Copyright Pavol Droba 2002-2003. // // 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/ for updates, documentation, and revision history. #ifndef BOOST_STRING_ITER_FIND_HPP #define BOOST_STRING_ITER_FIND_HPP #include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
/*! \file Defines generic split algorithms. Split algorithms can be used to divide a sequence into several part according to a given criteria. Result is given as a 'container of containers' where elements are copies or references to extracted parts. There are two algorithms provided. One iterates over matching substrings, the other one over the gaps between these matches. */ namespace boost { namespace algorithm { // iterate find ---------------------------------------------------// //! Iter find algorithm /*! This algorithm executes a given finder in iteration on the input, until the end of input is reached, or no match is found. Iteration is done using built-in find_iterator, so the real searching is performed only when needed. In each iteration new match is found and added to the result. \param Result A 'container container' to contain the result of search. Both outer and inner container must have constructor taking a pair of iterators as an argument. Typical type of the result is \c std::vector
> (each element of such a vector will container a range delimiting a match). \param Input A container which will be searched. \param Finder A Finder object used for searching \return A reference the result \note Prior content of the result will be overwritten. */ template< typename SequenceSequenceT, typename RangeT, typename FinderT > inline SequenceSequenceT& iter_find( SequenceSequenceT& Result, RangeT& Input, FinderT Finder ) { function_requires< FinderConcept
::type> >(); iterator_range
::type> lit_input(as_literal(Input)); typedef BOOST_STRING_TYPENAME range_iterator
::type input_iterator_type; typedef find_iterator
find_iterator_type; typedef detail::copy_iterator_rangeF< BOOST_STRING_TYPENAME range_value
::type, input_iterator_type> copy_range_type; input_iterator_type InputEnd=end(lit_input); typedef transform_iterator
transform_iter_type; transform_iter_type itBegin= make_transform_iterator( find_iterator_type( begin(lit_input), InputEnd, Finder ), copy_range_type()); transform_iter_type itEnd= make_transform_iterator( find_iterator_type(), copy_range_type()); SequenceSequenceT Tmp(itBegin, itEnd); Result.swap(Tmp); return Result; } // iterate split ---------------------------------------------------// //! Split find algorithm /*! This algorithm executes a given finder in iteration on the input, until the end of input is reached, or no match is found. Iteration is done using built-in find_iterator, so the real searching is performed only when needed. Each match is used as a separator of segments. These segments are then returned in the result. \param Result A 'container container' to container the result of search. Both outer and inner container must have constructor taking a pair of iterators as an argument. Typical type of the result is \c std::vector
> (each element of such a vector will container a range delimiting a match). \param Input A container which will be searched. \param Finder A finder object used for searching \return A reference the result \note Prior content of the result will be overwritten. */ template< typename SequenceSequenceT, typename RangeT, typename FinderT > inline SequenceSequenceT& iter_split( SequenceSequenceT& Result, RangeT& Input, FinderT Finder ) { function_requires< FinderConcept
::type> >(); iterator_range
::type> lit_input(as_literal(Input)); typedef BOOST_STRING_TYPENAME range_iterator
::type input_iterator_type; typedef split_iterator
find_iterator_type; typedef detail::copy_iterator_rangeF< BOOST_STRING_TYPENAME range_value
::type, input_iterator_type> copy_range_type; input_iterator_type InputEnd=end(lit_input); typedef transform_iterator
transform_iter_type; transform_iter_type itBegin= make_transform_iterator( find_iterator_type( begin(lit_input), InputEnd, Finder ), copy_range_type() ); transform_iter_type itEnd= make_transform_iterator( find_iterator_type(), copy_range_type() ); SequenceSequenceT Tmp(itBegin, itEnd); Result.swap(Tmp); return Result; } } // namespace algorithm // pull names to the boost namespace using algorithm::iter_find; using algorithm::iter_split; } // namespace boost #endif // BOOST_STRING_ITER_FIND_HPP
iter_find.hpp
网页地址
文件地址
上一页
13/24
下一页
下载
( 7 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.