ReactOS 0.4.15-dev-8100-g1887773
Pattern.cpp File Reference
#include "ph.h"
Include dependency graph for Pattern.cpp:

Go to the source code of this file.

Functions

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

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}
BOOL PatternMatch(const TCHAR *pszPattern, const TCHAR *pszTry)
Definition: Pattern.cpp:28
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define _totlower
Definition: tchar.h:1511
#define _T(x)
Definition: vfdio.h:22

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