foobar2000 SDK  2015-01-14
Functions
wildcard_helper Namespace Reference

Functions

const char * get_wildcard_list ()
 
bool has_wildcards (const char *str)
 
bool is_wildcard (char c)
 
bool test (const char *str, const char *pattern, bool b_separate_by_semicolon=false)
 
bool test_path (const char *path, const char *pattern, bool b_separate_by_semicolon=false)
 

Function Documentation

const char * wildcard_helper::get_wildcard_list ( )

Definition at line 46 of file wildcard.cpp.

46 {return "*?";}
bool wildcard_helper::has_wildcards ( const char *  str)

Definition at line 44 of file wildcard.cpp.

44 {return strchr(str,'*') || strchr(str,'?');}
bool wildcard_helper::is_wildcard ( char  c)

Definition at line 48 of file wildcard.cpp.

48  {
49  return c == '*' || c == '?';
50 }
bool wildcard_helper::test ( const char *  str,
const char *  pattern,
bool  b_separate_by_semicolon = false 
)

Definition at line 26 of file wildcard.cpp.

27 {
28  if (!b_sep) return test_recur(fn,pattern,false);
29  const char * rm=pattern;
30  while(*rm)
31  {
32  if (test_recur(fn,rm,true)) return true;
33  while(*rm && *rm!=';') rm++;
34  if (*rm==';')
35  {
36  while(*rm==';') rm++;
37  while(*rm==' ') rm++;
38  }
39  };
40 
41  return false;
42 }
static bool test_recur(const char *fn, const char *rm, bool b_sep)
Definition: wildcard.cpp:3
bool wildcard_helper::test_path ( const char *  path,
const char *  pattern,
bool  b_separate_by_semicolon = false 
)

Definition at line 24 of file wildcard.cpp.

24 {return test(path + pfc::scan_filename(path),pattern,b_sep);}
bool test(const char *str, const char *pattern, bool b_separate_by_semicolon=false)
Definition: wildcard.cpp:26
t_size scan_filename(const char *ptr)