MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / join_if

Function join_if

include/win/boost/algorithm/string/regex.hpp:506–549  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

504 typename CharT,
505 typename RegexTraitsT >
506 inline typename range_value<SequenceSequenceT>::type
507 join_if(
508 const SequenceSequenceT& Input,
509 const Range1T& Separator,
510 const basic_regex<CharT, RegexTraitsT>& Rx,
511 match_flag_type Flags=match_default )
512 {
513 // Define working types
514 typedef typename range_value<SequenceSequenceT>::type ResultT;
515 typedef typename range_const_iterator<SequenceSequenceT>::type InputIteratorT;
516
517 // Parse input
518 InputIteratorT itBegin=::boost::begin(Input);
519 InputIteratorT itEnd=::boost::end(Input);
520
521 // Construct container to hold the result
522 ResultT Result;
523
524
525 // Roll to the first element that will be added
526 while(
527 itBegin!=itEnd &&
528 !::boost::regex_match(::boost::begin(*itBegin), ::boost::end(*itBegin), Rx, Flags)) ++itBegin;
529
530 // Add this element
531 if(itBegin!=itEnd)
532 {
533 detail::insert(Result, ::boost::end(Result), *itBegin);
534 ++itBegin;
535 }
536
537 for(;itBegin!=itEnd; ++itBegin)
538 {
539 if(::boost::regex_match(::boost::begin(*itBegin), ::boost::end(*itBegin), Rx, Flags))
540 {
541 // Add separator
542 detail::insert(Result, ::boost::end(Result), ::boost::as_literal(Separator));
543 // Add element
544 detail::insert(Result, ::boost::end(Result), *itBegin);
545 }
546 }
547
548 return Result;
549 }
550
551#else // BOOST_NO_FUNCTION_TEMPLATE_ORDERING
552

Callers

nothing calls this directly

Calls 5

beginFunction · 0.50
endFunction · 0.50
regex_matchFunction · 0.50
insertFunction · 0.50
as_literalFunction · 0.50

Tested by

no test coverage detected