NCBI C++ ToolKit
Public Member Functions | Protected Attributes | List of all members
CMask Class Referenceabstract

Search Toolkit Book for CMask

CMask –. More...

#include <corelib/ncbi_mask.hpp>

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

Public Member Functions

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

Protected Attributes

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

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  )
inlinevirtual

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 Mon May 02 17:44:09 2016 by modify_doxy.py rev. 426318