foobar2000 SDK  2015-01-14
Functions
wildcard.cpp File Reference

Go to the source code of this file.

Functions

static bool test_recur (const char *fn, const char *rm, bool b_sep)
 

Function Documentation

static bool test_recur ( const char *  fn,
const char *  rm,
bool  b_sep 
)
static

Definition at line 3 of file wildcard.cpp.

4 {
5  for(;;)
6  {
7  if ((b_sep && *rm==';') || *rm==0) return *fn==0;
8  else if (*rm=='*')
9  {
10  rm++;
11  do
12  {
13  if (test_recur(fn,rm,b_sep)) return true;
14  } while(pfc::utf8_advance(fn));
15  return false;
16  }
17  else if (*fn==0) return false;
18  else if (*rm!='?' && pfc::charLower(pfc::utf8_get_char(fn))!=pfc::charLower(pfc::utf8_get_char(rm))) return false;
19 
20  fn = pfc::utf8_char_next(fn); rm = pfc::utf8_char_next(rm);
21  }
22 }
static bool test_recur(const char *fn, const char *rm, bool b_sep)
Definition: wildcard.cpp:3
const char * utf8_char_next(const char *src)
Definition: string_base.h:190
unsigned utf8_get_char(const char *src)
Definition: utf8.cpp:238
bool utf8_advance(const char *&var)
Definition: string_base.h:178
uint32_t charLower(uint32_t param)