Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

dlgAddMatchFiles::ArrayMatchPattern Class Reference

Array of matching patterns. More...

#include <dlgAddMatchFiles.hpp>

Collaboration diagram for dlgAddMatchFiles::ArrayMatchPattern:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void add (MatchPattern pattern)
 Adds a pattern to the array.

void alloc (size_t count)
 Preallocates memory for a given number of patterns.

 ArrayMatchPattern (const ArrayMatchPattern &source)
 Copy constructor.

 ArrayMatchPattern (size_t count)
 Constructor with an amount of allocated elements.

 ArrayMatchPattern ()
 Default constructor.

void clear ()
 Empties the array.

size_t getCount () const
 Gets the number of patterns in the array.

MatchPatternitem (size_t index) const
 Gets the pattern at the given index.

ArrayMatchPatternoperator= (const ArrayMatchPattern &source)
 Assignment operator.

MatchPatternoperator[] (size_t index) const
 Gets the pattern at the given index.

 ~ArrayMatchPattern ()
 Destructor.


Protected Types

typedef MatchPatternpMatchPattern
 Pointer on a matching pattern.


Protected Member Functions

void clone (const ArrayMatchPattern &source)
 Clones the source instance in this instance.


Protected Attributes

size_t allocated
 number of allocated matching patterns.

pMatchPatternpatterns
 Array of patterns.

size_t used
 number of used matching patterns.


Static Protected Attributes

const size_t ALLOC_NEW = 10
 Number of patterns to allocate when the array is to small for new elements.


Detailed Description

Array of matching patterns.

Definition at line 335 of file dlgAddMatchFiles.hpp.


Member Typedef Documentation

typedef MatchPattern* dlgAddMatchFiles::ArrayMatchPattern::pMatchPattern [protected]
 

Pointer on a matching pattern.

Definition at line 338 of file dlgAddMatchFiles.hpp.


Constructor & Destructor Documentation

dlgAddMatchFiles::ArrayMatchPattern::ArrayMatchPattern  ) 
 

Default constructor.

Definition at line 323 of file dlgAddMatchFiles.cpp.

References alloc(), ALLOC_NEW, allocated, patterns, and used.

dlgAddMatchFiles::ArrayMatchPattern::ArrayMatchPattern size_t  count  ) 
 

Constructor with an amount of allocated elements.

Parameters:
count Number of patterns to allocate.

Definition at line 338 of file dlgAddMatchFiles.cpp.

References alloc(), allocated, patterns, and used.

dlgAddMatchFiles::ArrayMatchPattern::ArrayMatchPattern const ArrayMatchPattern source  ) 
 

Copy constructor.

Parameters:
source Source instance.

Definition at line 373 of file dlgAddMatchFiles.cpp.

References allocated, clone(), patterns, and used.

dlgAddMatchFiles::ArrayMatchPattern::~ArrayMatchPattern  ) 
 

Destructor.

Definition at line 400 of file dlgAddMatchFiles.cpp.

References clear().


Member Function Documentation

void dlgAddMatchFiles::ArrayMatchPattern::add MatchPattern  pattern  ) 
 

Adds a pattern to the array.

  • The pattern is added if there is no other pattern with the same directory and same patterns and with a bigger depth.
  • If a pattern is found with the same directory and the same patterns (including) and a smallest depth, the depth of the existing pattern is changed.
  • If a pattern have the same directory and the same depth, the patterns are merged.

Parameters:
pattern Pattern to add.

Definition at line 420 of file dlgAddMatchFiles.cpp.

References add(), dlgAddMatchFiles::MatchPattern::addPatterns(), alloc(), ALLOC_NEW, allocated, dlgAddMatchFiles::MatchPattern::compareDepth(), getCount(), dlgAddMatchFiles::MatchPattern::getDirectory(), dlgAddMatchFiles::MatchPattern::getPattern(), dlgAddMatchFiles::MatchPattern::isIncludingAllPatterns(), patterns, dlgAddMatchFiles::MatchPattern::removePatterns(), and used.

Referenced by add(), dlgAddMatchFiles::readMatchPatternsFile(), ChecksumsListView::selectMatchingFilesToAdd(), and dlgAddMatchFiles::PatternsListValidator::TransferFromWindow().

void dlgAddMatchFiles::ArrayMatchPattern::alloc size_t  count  ) 
 

Preallocates memory for a given number of patterns.

Parameters:
count Number of patterns to allocate.

Definition at line 474 of file dlgAddMatchFiles.cpp.

References alloc(), allocated, patterns, and used.

Referenced by add(), alloc(), ArrayMatchPattern(), and clone().

void dlgAddMatchFiles::ArrayMatchPattern::clear  ) 
 

Empties the array.

Definition at line 500 of file dlgAddMatchFiles.cpp.

References allocated, patterns, and used.

Referenced by clone(), and ~ArrayMatchPattern().

void dlgAddMatchFiles::ArrayMatchPattern::clone const ArrayMatchPattern source  )  [protected]
 

Clones the source instance in this instance.

Parameters:
source Source instance.

Definition at line 353 of file dlgAddMatchFiles.cpp.

References alloc(), allocated, clear(), clone(), patterns, and used.

Referenced by ArrayMatchPattern(), clone(), and operator=().

size_t dlgAddMatchFiles::ArrayMatchPattern::getCount  )  const
 

Gets the number of patterns in the array.

Returns:
The number of patterns in the array.

Definition at line 525 of file dlgAddMatchFiles.cpp.

References used.

Referenced by add(), dlgAddMatchFiles::btnAddListClick(), dlgAddMatchFiles::btnLoadListClick(), ChecksumsListView::selectMatchingFilesToAdd(), and dlgAddMatchFiles::PatternsListValidator::TransferToWindow().

dlgAddMatchFiles::MatchPattern & dlgAddMatchFiles::ArrayMatchPattern::item size_t  index  )  const
 

Gets the pattern at the given index.

If the index is out of bounds, nothing special is done (and the program will surely fail with a segmentation fault).

Parameters:
index Index of the item to get.
Returns:
A reference on the matching pattern.

Definition at line 540 of file dlgAddMatchFiles.cpp.

References item(), and patterns.

Referenced by item(), and dlgAddMatchFiles::PatternsListValidator::TransferToWindow().

dlgAddMatchFiles::ArrayMatchPattern & dlgAddMatchFiles::ArrayMatchPattern::operator= const ArrayMatchPattern source  ) 
 

Assignment operator.

Parameters:
source Source instance.
Returns:
A reference on the instance.

Definition at line 389 of file dlgAddMatchFiles.cpp.

References clone(), and operator=().

Referenced by operator=().

dlgAddMatchFiles::MatchPattern & dlgAddMatchFiles::ArrayMatchPattern::operator[] size_t  index  )  const
 

Gets the pattern at the given index.

If the index is out of bounds, nothing special is done (and the program will surely fail with a segmentation fault).

Parameters:
index Index of the item to get.
Returns:
A reference on the matching pattern.

Definition at line 556 of file dlgAddMatchFiles.cpp.

References operator[](), and patterns.

Referenced by operator[]().


Member Data Documentation

const size_t dlgAddMatchFiles::ArrayMatchPattern::ALLOC_NEW = 10 [static, protected]
 

Number of patterns to allocate when the array is to small for new elements.

Definition at line 318 of file dlgAddMatchFiles.cpp.

Referenced by add(), and ArrayMatchPattern().

size_t dlgAddMatchFiles::ArrayMatchPattern::allocated [protected]
 

number of allocated matching patterns.

Definition at line 340 of file dlgAddMatchFiles.hpp.

Referenced by add(), alloc(), ArrayMatchPattern(), clear(), and clone().

pMatchPattern* dlgAddMatchFiles::ArrayMatchPattern::patterns [protected]
 

Array of patterns.

Definition at line 342 of file dlgAddMatchFiles.hpp.

Referenced by add(), alloc(), ArrayMatchPattern(), clear(), clone(), item(), and operator[]().

size_t dlgAddMatchFiles::ArrayMatchPattern::used [protected]
 

number of used matching patterns.

Definition at line 341 of file dlgAddMatchFiles.hpp.

Referenced by add(), alloc(), ArrayMatchPattern(), clear(), clone(), and getCount().


The documentation for this class was generated from the following files:
Generated on Sun May 30 13:38:03 2004 for wxChecksums by doxygen 1.3.7