NCBI C++ ToolKit
Public Member Functions | Protected Attributes

Search Toolkit Book for CMask

CMask --. More...

#include <corelib/ncbi_mask.hpp>

+ Inheritance diagram for CMask:
+ Collaboration diagram for CMask:

List of all members.

Public Member Functions

 CMask (void)
 Constructor.
virtual ~CMask (void)
 Destructor.
void Add (const string &mask)
 Add an inclusion mask.
void AddExclusion (const string &mask)
 Add an exclusion mask.
void Remove (const string &mask)
 Remove an inclusion mask.
void RemoveExclusion (const string &mask)
 Remove an exclusion mask.
virtual bool Match (CTempString str, NStr::ECase use_case=NStr::eCase) const =0
 Match a string.

Protected Attributes

list< stringm_Inclusions
 List of inclusion masks.
list< stringm_Exclusions
 List of exclusion masks.

Detailed Description

CMask --.

Abstract class. Base class for CMaskFileName, CMaskRegexp.

An empty mask object always corresponds to "all is included" case. Throws exceptions on errors.

Definition at line 58 of file ncbi_mask.hpp.


Constructor & Destructor Documentation

CMask::CMask ( void  ) [inline]

Constructor.

Definition at line 62 of file ncbi_mask.hpp.

virtual CMask::~CMask ( void  ) [inline, virtual]

Destructor.

Definition at line 64 of file ncbi_mask.hpp.


Member Function Documentation

void CMask::Add ( const string mask) [inline]
void CMask::AddExclusion ( const string mask) [inline]

Add an exclusion mask.

Definition at line 69 of file ncbi_mask.hpp.

References m_Exclusions.

virtual bool CMask::Match ( CTempString  str,
NStr::ECase  use_case = NStr::eCase 
) const [pure virtual]

Match a string.

Parameters:
strString to match.
use_caseWhether to do case-sensitive comparison (eCase, default), or case-insensitive comparison (eNocase).
Returns:
Return TRUE if the string 'str' matches one of the inclusion masks and does not match any of the exclusion masks, or no masks at all have been specified. Otherwise, return FALSE.

Implemented in CMaskFileName, and CMaskRegexp.

Referenced by FindFilesInDir(), CDir::GetEntriesPtr(), CDirEntry::MatchesMask(), CTAbleValApp::ProcessOneDirectory(), CTbl2AsnApp::ProcessOneDirectory(), s_MatchPattern(), CArchive::x_Append(), and CArchive::x_ReadAndProcess().

void CMask::Remove ( const string mask) [inline]

Remove an inclusion mask.

Definition at line 72 of file ncbi_mask.hpp.

References m_Inclusions.

void CMask::RemoveExclusion ( const string mask) [inline]

Remove an exclusion mask.

Definition at line 74 of file ncbi_mask.hpp.

References m_Exclusions.


Member Data Documentation

list<string> CMask::m_Exclusions [protected]

List of exclusion masks.

Definition at line 92 of file ncbi_mask.hpp.

Referenced by AddExclusion(), CMaskRegexp::Match(), CMaskFileName::Match(), and RemoveExclusion().

list<string> CMask::m_Inclusions [protected]

List of inclusion masks.

Definition at line 91 of file ncbi_mask.hpp.

Referenced by Add(), CMaskRegexp::Match(), CMaskFileName::Match(), and Remove().


The documentation for this class was generated from the following file:
Modified on Sun May 03 11:52:54 2015 by modify_doxy.py rev. 426318