ReactOS  0.4.14-dev-49-gfb4591c
Pattern.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PATTERN_MATCH_ALL   _T("*")
 

Functions

BOOL PatternMatch (const TCHAR *pszPattern, const TCHAR *pszTry)
 

Macro Definition Documentation

◆ PATTERN_MATCH_ALL

#define PATTERN_MATCH_ALL   _T("*")

Definition at line 7 of file Pattern.h.

Function Documentation

◆ PatternMatch()

BOOL PatternMatch ( const TCHAR pszPattern,
const TCHAR pszTry 
)

Definition at line 28 of file Pattern.cpp.

29 {
30  while ((*pszPattern == _T('?'))||((_totlower(*pszTry)) == (_totlower(*pszPattern))))
31  {
32  if (((*pszTry) == 0) && ((*pszPattern) == 0))
33  return TRUE;
34 
35  if (((*pszTry) == 0) || ((*pszPattern) == 0))
36  return FALSE;
37 
38  pszTry++;
39  pszPattern++;
40  }
41 
42  if (*pszPattern == _T('*'))
43  {
44  pszPattern++;
45  while (*pszTry)
46  {
47  if (PatternMatch(pszPattern,pszTry))
48  return TRUE;
49  else
50  pszTry++;
51  }
52  }
53 
54  if (((*pszTry) == 0) && ((*pszPattern) == 0))
55  return TRUE;
56 
57  return FALSE;
58 }
#define TRUE
Definition: types.h:120
#define _T(x)
Definition: vfdio.h:22
#define _totlower
Definition: tchar.h:1511
BOOL PatternMatch(const TCHAR *pszPattern, const TCHAR *pszTry)
Definition: Pattern.cpp:28

Referenced by CRegistryTree::DeleteSubkeys(), CShellCommandDir::Execute(), CShellCommandDeleteValue::Execute(), and PatternMatch().