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

SumFileFactory Class Reference

Generates new instances of the subclasses of the SumFile class that the application knows. More...

#include <checksumfactory.hpp>

List of all members.

Public Types

enum  SumFileType { ftSFV = 0, ftMD5 }
 Enumeration of the types of the checksums' files. More...


Static Public Member Functions

bool exists (const int sumFileType)
 Returns true if the given identifer of checksums' file type exists.

wxArrayInt getAvailableSumFiles ()
 Gets all the identifers of the available checksums' file types.

wxString getSumFileDescription (const int sumFileType)
 Gives the description of the specified checksums' file type.

wxString getSumFileExtension (const int sumFileType)
 Gives the file's extension of the specified checksums' file type.

wxString getSumFileName (const int sumFileType)
 Gives the name of the specified checksums' file type.

SumFilegetSumFileNewInstance (const int sumFileType)
 Gives a pointer on a new instance of the specified checksums' file type.

int getSumFilesCount ()
 Gets the number of available identifers of checksums' file types.

void initialize ()
 Initializes the static members of the class.


Private Member Functions

 SumFileFactory ()
 Default constructor. Don't use it.

 WX_DECLARE_HASH_MAP (int, SumFileEntry, wxIntegerHash, wxIntegerEqual, SumFileEntries)
 A hashmap of string keys and SumFileEntry values.


Static Private Attributes

SumFileEntries sumFilesTypes
 All the checksums' file types that the application knows.


Detailed Description

Generates new instances of the subclasses of the SumFile class that the application knows.

Known classes are registered in the Initialize static member. Call it at the start of the program.

The enumeration of known checksums' file types begin from 0 to getSumFilesCount() - 1.

Definition at line 63 of file checksumfactory.hpp.


Member Enumeration Documentation

enum SumFileFactory::SumFileType
 

Enumeration of the types of the checksums' files.

Definition at line 151 of file checksumfactory.hpp.


Constructor & Destructor Documentation

SumFileFactory::SumFileFactory  )  [inline, private]
 

Default constructor. Don't use it.

Definition at line 122 of file checksumfactory.hpp.


Member Function Documentation

bool SumFileFactory::exists const int  sumFileType  )  [static]
 

Returns true if the given identifer of checksums' file type exists.

Returns:
true if the given identifer of checksums' file type exists, false otherwise.

Definition at line 137 of file checksumfactory.cpp.

References exists(), and sumFilesTypes.

Referenced by exists(), getSumFileDescription(), getSumFileExtension(), getSumFileName(), and getSumFileNewInstance().

wxArrayInt SumFileFactory::getAvailableSumFiles  )  [static]
 

Gets all the identifers of the available checksums' file types.

Returns:
All the identifers of the available checksums' file types.

Definition at line 105 of file checksumfactory.cpp.

References sumFilesTypes.

wxString SumFileFactory::getSumFileDescription const int  sumFileType  )  [static]
 

Gives the description of the specified checksums' file type.

Parameters:
sumFileType Type of the checksums' file of which the caller want the description.
Returns:
The description of the specified checksums' file type or an empty string if the specified checksums' file type is invalid.

Definition at line 194 of file checksumfactory.cpp.

References exists(), getSumFileDescription(), and sumFilesTypes.

Referenced by getSumFileDescription().

wxString SumFileFactory::getSumFileExtension const int  sumFileType  )  [static]
 

Gives the file's extension of the specified checksums' file type.

Parameters:
sumFileType Type of the checksums' file of which the caller want the file's extension.
Returns:
The file's extension of the specified checksums' file type or an empty string if the specified checksums' file type is invalid.

Definition at line 212 of file checksumfactory.cpp.

References exists(), getSumFileExtension(), and sumFilesTypes.

Referenced by getSumFileExtension().

wxString SumFileFactory::getSumFileName const int  sumFileType  )  [static]
 

Gives the name of the specified checksums' file type.

Parameters:
sumFileType Type of the checksums' file of which the caller want the name.
Returns:
The name of the specified checksums' file type or an empty string if the specified checksums' file type is invalid.

Definition at line 176 of file checksumfactory.cpp.

References exists(), getSumFileName(), and sumFilesTypes.

Referenced by getSumFileName().

SumFile * SumFileFactory::getSumFileNewInstance const int  sumFileType  )  [static]
 

Gives a pointer on a new instance of the specified checksums' file type.

The caller is responsible of the deletion of the instance with the delete operator.

Parameters:
sumFileType Type of the checksums' file of which the caller want a new instance.
Returns:
A pointer on a new instance of the specified checksums' file type or NULL if the specified checksums' file type is invalid.

Definition at line 158 of file checksumfactory.cpp.

References exists(), getSumFileNewInstance(), and sumFilesTypes.

Referenced by getSumFileNewInstance().

int SumFileFactory::getSumFilesCount  )  [static]
 

Gets the number of available identifers of checksums' file types.

Returns:
The number of available identifers of checksums' file types.

Definition at line 123 of file checksumfactory.cpp.

References sumFilesTypes.

Referenced by dlgBatchCreationConf::btnOKClick(), dlgBatchCreationConf::createControls(), dlgBatchCreationConf::getCkFileTypeCreateConfigKey(), getFilterForKnownTypesOfChecksumsFiles(), and frmSums::itmFileSaveAsClick().

void SumFileFactory::initialize  )  [static]
 

Initializes the static members of the class.

The name the type of the checksums' file should be the same as the one returned by checksums_file_type::getFileType().

Definition at line 92 of file checksumfactory.cpp.

References sumFilesTypes.

Referenced by CkSumsApp::OnInit().

SumFileFactory::WX_DECLARE_HASH_MAP int  ,
SumFileEntry  ,
wxIntegerHash  ,
wxIntegerEqual  ,
SumFileEntries 
[private]
 

A hashmap of string keys and SumFileEntry values.


Member Data Documentation

SumFileFactory::SumFileEntries SumFileFactory::sumFilesTypes [static, private]
 

All the checksums' file types that the application knows.

Definition at line 82 of file checksumfactory.cpp.

Referenced by exists(), getAvailableSumFiles(), getSumFileDescription(), getSumFileExtension(), getSumFileName(), getSumFileNewInstance(), getSumFilesCount(), and initialize().


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