Function CharTypeStringRFindFirstOf

Synopsis

#include <include/EASTL/string.h>

static const value_type * CharTypeStringRFindFirstOf(const value_type *p1RBegin, const value_type *p1REnd, const value_type *p2Begin, const value_type *p2End)

Description

CharTypeStringRFindFirstOf Specialized value_type version of STL find_first_of() function in reverse. This function is much like the C runtime strtok function, except the strings aren't null-terminated.

Source

Lines 3540-3554 in include/EASTL/string.h. Line 786 in include/EASTL/string.h.

template <typename T, typename Allocator>
const typename basic_string<T, Allocator>::value_type*
basic_string<T, Allocator>::CharTypeStringRFindFirstOf(const value_type* p1RBegin, const value_type* p1REnd,
                                                       const value_type* p2Begin,  const value_type* p2End)
{
    for( ; p1RBegin != p1REnd; --p1RBegin)
    {
        for(const value_type* pTemp = p2Begin; pTemp != p2End; ++pTemp)
        {
            if(*(p1RBegin - 1) == *pTemp)
                return p1RBegin;
        }
    }
    return p1REnd;
}





Add Discussion as Guest

Log in