本文整理汇总了C++中match_results类的典型用法代码示例。如果您正苦于以下问题:C++ match_results类的具体用法?C++ match_results怎么用?C++ match_results使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了match_results类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1:
bool split_pred<OutputIterator, charT, Traits1, Alloc1>::operator()
(const match_results<iterator_type>& what)
{
*p_last = what[0].second;
if(what.size() > 1)
{
// output sub-expressions only:
for(unsigned i = 1; i < what.size(); ++i)
{
*(*p_out) = what.str(i);
++(*p_out);
if(0 == --*p_max) return false;
}
return *p_max != 0;
}
else
{
// output $` only if it's not-null or not at the start of the input:
const sub_match<iterator_type>& sub = what[-1];
if((sub.first != sub.second) || (*p_max != initial_max))
{
*(*p_out) = sub.str();
++(*p_out);
return --*p_max;
}
}
//
// initial null, do nothing:
return true;
}
开发者ID:13W,项目名称:icq-desktop,代码行数:30,代码来源:regex_split.hpp
示例2:
static void init_match_results
(
match_results<BidiIter> &what
, regex_id_type regex_id
, intrusive_ptr<traits<char_type> const> const &traits
, sub_match_impl<BidiIter> *sub_matches
, std::size_t size
, std::vector<named_mark<char_type> > const &named_marks
)
{
what.init_(regex_id, traits, sub_matches, size, named_marks);
}
开发者ID:TheForum,项目名称:Earth-and-Beyond-server,代码行数:12,代码来源:access.hpp
示例3: operator
bool operator ()(match_results<BidiIter> const &res) const
{
return this->regex_id_ == res.regex_id();
}
开发者ID:AlexS2172,项目名称:IVRM,代码行数:4,代码来源:match_results.hpp
示例4: set_base
static void set_base(match_results<BidiIter> &what, BidiIter base)
{
what.set_base_(base);
}
开发者ID:TheForum,项目名称:Earth-and-Beyond-server,代码行数:4,代码来源:access.hpp
示例5: reset
static void reset(match_results<BidiIter> &what)
{
what.reset_();
}
开发者ID:TheForum,项目名称:Earth-and-Beyond-server,代码行数:4,代码来源:access.hpp
示例6: set_prefix_suffix
static void set_prefix_suffix(match_results<BidiIter> &what, BidiIter begin, BidiIter end)
{
what.set_prefix_suffix_(begin, end);
}
开发者ID:TheForum,项目名称:Earth-and-Beyond-server,代码行数:4,代码来源:access.hpp
示例7: next
bool next()
{
if(N == -1)
return false;
if(N+1 < (int)subs.size())
{
++N;
result =((subs[N] == -1) ? what.prefix() : what[subs[N]]);
return true;
}
//if(what.prefix().first != what[0].second)
// flags |= /*match_prev_avail |*/ regex_constants::match_not_bob;
BidirectionalIterator last_end(what[0].second);
if(regex_search(last_end, end, what, re, ((what[0].first == what[0].second) ? flags | regex_constants::match_not_initial_null : flags), base))
{
N =0;
result =((subs[N] == -1) ? what.prefix() : what[subs[N]]);
return true;
}
else if((last_end != end) && (subs[0] == -1))
{
N =-1;
result.first = last_end;
result.second = end;
result.matched = (last_end != end);
return true;
}
return false;
}
开发者ID:111304037,项目名称:FreeJudger,代码行数:29,代码来源:regex_token_iterator.hpp
示例8: next
bool next()
{
if(what.prefix().first != what[0].second)
flags |= match_prev_avail;
BidirectionalIterator next_start = what[0].second;
match_flag_type f(flags);
if(!what.length())
f |= regex_constants::match_not_initial_null;
bool result = regex_search(next_start, end, what, *pre, f);
if(result)
what.set_base(base);
return result;
}
开发者ID:Redirion,项目名称:Dawn-of-Civilization,代码行数:13,代码来源:regex_iterator.hpp
示例9: init
bool init(BidirectionalIterator first)
{
N = 0;
if(regex_search(first, end, what, re, flags) == true)
{
N = 0;
result = ((subs[N] == -1) ? what.prefix() : what[(int)subs[N]]);
return true;
}
else if((subs[N] == -1) && (first != end))
{
result.first = first;
result.second = end;
result.matched = (first != end);
return true;
}
return false;
}
开发者ID:rzymek,项目名称:cxxsp,代码行数:18,代码来源:regex_token_iterator.hpp
注:本文中的match_results类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论