MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / rfind

Method rfind

extern/boost/boost/test/utils/basic_cstring/basic_cstring.hpp:569–586  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

567
568template<typename CharT>
569inline typename basic_cstring<CharT>::size_type
570basic_cstring<CharT>::rfind( basic_cstring<CharT> str ) const
571{
572 if( str.is_empty() || str.size() > size() )
573 return static_cast<size_type>(npos);
574
575 const_iterator it = end() - str.size();
576 const_iterator last = begin()-1;
577
578 while( it != last ) {
579 if( traits_type::compare( it, str.begin(), str.size() ) == 0 )
580 break;
581
582 --it;
583 }
584
585 return it == last ? static_cast<size_type>(npos) : static_cast<size_type>(it - begin());
586}
587
588//____________________________________________________________________________//
589

Callers

nothing calls this directly

Calls 7

sizeFunction · 0.50
endFunction · 0.50
beginFunction · 0.50
compareFunction · 0.50
is_emptyMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected