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

ZipArchiveLib::CWildcard Class Reference

#include <Wildcard.h>

List of all members.


Public Types

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

Public Member Functions

 CWildcard (LPCTSTR lpszPattern, bool bCaseSensitive)
 CWildcard ()
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 an Archive

Member Enumeration Documentation

Enumerator:
matchNone  For internal use.
matchValid  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  Bad pattern.

Enumerator:
patternEmpty  The [..] construct is empty.
patternClose  There is no end bracket in the [..] construct.
patternRange  Malformed range in the [..] construct.
patternEsc  Literal escape at the end of the pattern.
patternValid  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:
lpszPattern The pattern to use in matching.
bCaseSensitive The case-sensitivity of matching.
See also:
Searching in an 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 up in matching. Set the pattern with the SetPattern method or in the constructor.

Parameters:
lpszText The string to match against the pattern.
iRetCode If not NULL, receives one of Match values indicating a return code.
Returns:
true, if lpszText matches the pattern.
See also:
SetPattern

static bool ZipArchiveLib::CWildcard::IsPattern ( LPCTSTR  lpszPattern  )  [static]

Gets a value indicating if lpszPattern has any special wildcard characters.

Parameters:
lpszPattern The 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:
lpszPattern The pattern to test.
iErrorType If 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:
lpszPattern The pattern to match.
lpszText The string to match against the pattern.
Returns:
One of Match values.
See also:
SetPattern

void ZipArchiveLib::CWildcard::SetPattern ( LPCTSTR  lpszPattern,
bool  bCaseSensitive 
) [inline]

Sets the current pattern

Parameters:
lpszPattern The pattern used in matching.
bCaseSensitive The case-sensitivity of matching.
See also:
Searching in an Archive


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