Skip Navigation Links
Skip Navigation LinksHome > ZipArchive > How to Use > API Documentation

#include <Wildcard.h>

Public Types

enum  Match {
  matchNone, matchValid, matchEnd, matchAbort,
  matchRange, matchLiteral, matchPattern
}
 
enum  Pattern {
  patternEmpty = -4, patternClose, patternRange, patternEsc,
  patternValid
}
 

Public Member Functions

 CWildcard ()
 
 CWildcard (LPCTSTR lpszPattern, bool bCaseSensitive)
 
bool IsMatch (LPCTSTR lpszText, int *iRetCode=NULL)
 
 operator LPCTSTR ()
 
void SetPattern (LPCTSTR lpszPattern, bool bCaseSensitive)
 

Static Public Member Functions

static bool IsPattern (LPCTSTR lpszPattern)
 
static bool IsPatternValid (LPCTSTR lpszPattern, int *iErrorType=NULL)
 
static int Match (LPCTSTR lpszPattern, LPCTSTR lpszText)
 

Detailed Description

A class used in the wildcard pattern matching.

See Also
Searching in Archive

Member Enumeration Documentation

Enumerator:
matchNone 

For internal use.

matchValid 

A valid match.

matchEnd 

Premature end of the pattern string.

matchAbort 

Premature end of the text string.

matchRange 

Match failure on the [..] construct.

matchLiteral 

Match failure on a literal match.

matchPattern 

A bad pattern.

Enumerator:
patternEmpty 

The [..] construct is empty.

patternClose 

There is no end bracket in the [..] construct.

patternRange 

Malformed range in the [..] construct.

patternEsc 

There is a literal escape at the end of the pattern.

patternValid 

A valid pattern.

Constructor & Destructor Documentation

ZipArchiveLib::CWildcard::CWildcard ( )
inline

Initializes a new instance of the CWildcard class.

ZipArchiveLib::CWildcard::CWildcard ( LPCTSTR  lpszPattern,
bool  bCaseSensitive 
)
inline

Initializes a new instance of the CWildcard class.

Parameters
lpszPatternThe pattern to use in matching.
bCaseSensitiveThe case-sensitivity of matching.
See Also
Searching in Archive

Member Function Documentation

bool ZipArchiveLib::CWildcard::IsMatch ( LPCTSTR  lpszText,
int *  iRetCode = NULL 
)

Matches lpszText against the pattern. A match means the entire lpszText is used in matching. Set the pattern with the SetPattern method or in the constructor.

Parameters
lpszTextThe string to match against the pattern.
iRetCodeIf not NULL, receives one of the Match values indicating a return code.
Returns
true, if lpszText matches the pattern.
See Also
SetPattern
static bool ZipArchiveLib::CWildcard::IsPattern ( LPCTSTR  lpszPattern)
static

Returns the value indicating whether lpszPattern has any special wildcard characters.

Parameters
lpszPatternThe pattern to test.
Returns
true, if the pattern has wildcard characters; false otherwise.
static bool ZipArchiveLib::CWildcard::IsPatternValid ( LPCTSTR  lpszPattern,
int *  iErrorType = NULL 
)
static

Tests lpszPattern for validity.

Parameters
lpszPatternThe pattern to test.
iErrorTypeIf not NULL, receives one of the Pattern values indicating a return code.
Returns
true, if lpszPattern is a well formed regular expression according to the CWildcard class syntax (see SetPattern); false otherwise.
static int ZipArchiveLib::CWildcard::Match ( LPCTSTR  lpszPattern,
LPCTSTR  lpszText 
)
static

Matches lpszText against lpszPattern.

A match means the entire lpszText is used in matching.

Parameters
lpszPatternThe pattern to match.
lpszTextThe string to match against the pattern.
Returns
One of the Match values.
See Also
SetPattern
void ZipArchiveLib::CWildcard::SetPattern ( LPCTSTR  lpszPattern,
bool  bCaseSensitive 
)
inline

Sets the current pattern

Parameters
lpszPatternThe pattern used in matching.
bCaseSensitiveThe case-sensitivity of matching.
See Also
Searching in Archive

The documentation for this class was generated from the following file:
Back To Top Up