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 Archive

Definition at line 47 of file Wildcard.h.


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.

Definition at line 51 of file Wildcard.h.

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.

Definition at line 62 of file Wildcard.h.


Constructor & Destructor Documentation

ZipArchiveLib::CWildcard::CWildcard (  )  [inline]

Initializes a new instance of the CWildcard class.

Definition at line 140 of file Wildcard.h.

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 Archive

Definition at line 154 of file Wildcard.h.


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:
lpszText The string to match against the pattern.
iRetCode If 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:
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 the 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 Archive

Definition at line 173 of file Wildcard.h.


The documentation for this class was generated from the following file:

The ZipArchive Library Copyright © 2000 - 2009 Artpol Software - Tadeusz Dracz. Generated at Fri Apr 24 16:46:41 2009.