Beispiel #1
0
int shwild_match_pattern(shwild_handle_t hCompiledPattern, char const *string)
{
    SHWILD_ASSERT(NULL != hCompiledPattern);
    SHWILD_ASSERT(NULL != string);

    shwild_slice_t  string_slice(::strlen(string), string);

    return shwild_match_pattern_s(hCompiledPattern, &string_slice);
}
Beispiel #2
0
inline bool Pattern::match(slice_t const& string) const
{
    int r = shwild_match_pattern_s(m_hCompiledPattern, &string);

    if(r < 0)
    {
        throw PatternException("Match failed", r);
    }

    return 0 == r;
}