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

Function join_if_regex

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

Source from the content-addressed store, hash-verified

572 typename CharT,
573 typename RegexTraitsT >
574 inline typename range_value<SequenceSequenceT>::type
575 join_if_regex(
576 const SequenceSequenceT& Input,
577 const Range1T& Separator,
578 const basic_regex<CharT, RegexTraitsT>& Rx,
579 match_flag_type Flags=match_default )
580 {
581 // Define working types
582 typedef typename range_value<SequenceSequenceT>::type ResultT;
583 typedef typename range_const_iterator<SequenceSequenceT>::type InputIteratorT;
584
585 // Parse input
586 InputIteratorT itBegin=::boost::begin(Input);
587 InputIteratorT itEnd=::boost::end(Input);
588
589 // Construct container to hold the result
590 ResultT Result;
591
592
593 // Roll to the first element that will be added
594 while(
595 itBegin!=itEnd &&
596 !::boost::regex_match(::boost::begin(*itBegin), ::boost::end(*itBegin), Rx, Flags)) ++itBegin;
597
598 // Add this element
599 if(itBegin!=itEnd)
600 {
601 detail::insert(Result, ::boost::end(Result), *itBegin);
602 ++itBegin;
603 }
604
605 for(;itBegin!=itEnd; ++itBegin)
606 {
607 if(::boost::regex_match(::boost::begin(*itBegin), ::boost::end(*itBegin), Rx, Flags))
608 {
609 // Add separator
610 detail::insert(Result, ::boost::end(Result), ::boost::as_literal(Separator));
611 // Add element
612 detail::insert(Result, ::boost::end(Result), *itBegin);
613 }
614 }
615
616 return Result;
617 }
618
619
620#endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING

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