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

dlgBatchCreation Class Reference

Dialog which displays results of multiple files checking. More...

#include <dlgBatchCreate.hpp>

Inheritance diagram for dlgBatchCreation:

Inheritance graph
[legend]
Collaboration diagram for dlgBatchCreation:

Collaboration graph
[legend]
List of all members.

Public Types

enum  Verbosity {
  vErrors = 0, vWarnings, vNormal, vTalkative,
  Verbosity_Min = vErrors, Verbosity_Max = vTalkative
}
 Verbosity levels. More...


Public Member Functions

void createControls ()
 Creates and initializes the controls of the dialog.

 dlgBatchCreation ()
 Creates a new dialog.

unsigned long getFilesToProcess () const
 Gets the number of files to process.

unsigned long getFileToBeProcessed () const
 Gets the number of the current file to be processed.

BytesDisplayer getReadBytes () const
 Gets the number of bytes read of the current processed file.

BytesDisplayer getTotalBytes () const
 Gets the number of bytes of the current processed file.

void setFilesToProcess (unsigned long nbTotalFiles)
 // Sets the number of files to process.

void setFileToBeProcessed (unsigned long nbFiles)
 Sets the number of the file to be processed.

void setReadBytes (const BytesDisplayer &bytes)
 Sets the number of bytes read of the current processed file.

void setTotalBytes (const BytesDisplayer &bytes)
 Sets the number of bytes of the current processed file.


Static Public Member Functions

void batchCreation (const wxArrayString &files, const Options &options, wxArrayInt ckSumsTypes, wxWindow *parent=NULL)
 Checks multiple checksums' files.


Protected Member Functions

void btnCancelClick (wxCommandEvent &event)
 Processes button Cancel.

 dlgBatchCreation (wxWindow *parent)
 Creates a new dialog.

void updateCurrentProcessedFile ()
 Update the information of the current processed file.

void updateTotalFiles ()
 Update the information of the total of the files to be processed.


Protected Attributes

BytesDisplayer bytesRead
 Number of read bytes in the current checked file.

unsigned long fileProcessed
 Number of the current file to be processed.

unsigned long filesToProcess
 Number of files to process.

wxGauge * gauFile
 Current file (gauge).

wxGauge * gauTotal
 Current checksum file (gauge).

wxStaticText * lblFile
 Current file (bytes read/total).

wxStaticText * lblTotal
 Current checksum file (number/total).

BytesDisplayer totalBytes
 Number of bytes of the current checked file.


Static Private Member Functions

bool allChecksumsFileNamesExist (const wxString &srcFileName, const dlgBatchCreation::Options &options, const wxArrayInt &ckSumsTypes)
 Indicates if all the checksums' files exist.

wxArrayString getChecksumsFileNames (const wxString &srcFileName, const dlgBatchCreation::Options &options, const wxArrayInt &ckSumsTypes)
 Gets the names of the checksums' files to create.

void saveChecksumsInFiles (const wxString &srcFileName, const dlgBatchCreation::Options &options, const wxArrayInt &ckSumsTypes, const ArraySumFile &sumFiles, const wxArrayString &sums, dlgBatchCreation::FilesStatistics &fstats, dlgBatchCreation *dlgPrg)
 Saves the given sums in checksums files.


Detailed Description

Dialog which displays results of multiple files checking.

Definition at line 52 of file dlgBatchCreate.hpp.


Member Enumeration Documentation

enum dlgBatchCreation::Verbosity
 

Verbosity levels.

Definition at line 123 of file dlgBatchCreate.hpp.

Referenced by dlgBatchCreation::Options::getVerbosity().


Constructor & Destructor Documentation

dlgBatchCreation::dlgBatchCreation  ) 
 

Creates a new dialog.

Definition at line 317 of file dlgBatchCreate.cpp.

References createControls().

dlgBatchCreation::dlgBatchCreation wxWindow *  parent  )  [protected]
 

Creates a new dialog.

Parameters:
parent Parent of the dialog.

Definition at line 330 of file dlgBatchCreate.cpp.

References createControls(), AppPrefs::get(), and AppPrefs::readSize().


Member Function Documentation

bool dlgBatchCreation::allChecksumsFileNamesExist const wxString &  srcFileName,
const dlgBatchCreation::Options options,
const wxArrayInt &  ckSumsTypes
[static, private]
 

Indicates if all the checksums' files exist.

Parameters:
srcFileName Name of the source file.
options Options for the batch creation of the checksums' files.
ckSumsTypes Array of checksums' file types to create.
Returns:
true if all the checksums' files exist, false otherwise.

Definition at line 622 of file dlgBatchCreate.cpp.

References allChecksumsFileNamesExist(), and getChecksumsFileNames().

Referenced by allChecksumsFileNamesExist(), and batchCreation().

void dlgBatchCreation::batchCreation const wxArrayString &  files,
const Options options,
wxArrayInt  ckSumsTypes,
wxWindow *  parent = NULL
[static]
 

Checks multiple checksums' files.

Parameters:
files List of the files from which the checksums' files will be created.
options Options for the batch creation of the checksums' files.
ckSumsTypes Array of checksums' file types to create.
parent Parent of the dialog that will be created.

Definition at line 729 of file dlgBatchCreate.cpp.

References dlgResultsProgress::addResultLine(), allChecksumsFileNamesExist(), dlgBatchCreation::FilesStatistics::allChecksumsFilesAreCorrects(), dlgBatchCreation::FilesStatistics::allFileAreCorrects(), batchCreation(), ChecksumFileCalculator::calculate(), dlgResultsProgress::canContinue(), dlgBatchCreation::FilesStatistics::CKCreated, dlgBatchCreation::FilesStatistics::CKOverwritten, dlgBatchCreation::FilesStatistics::CKSkipped, dlgBatchCreation::FilesStatistics::CKWriteError, dlgBatchCreation::FilesStatistics::FCorrect, dlgResultsProgress::Finished(), dlgBatchCreation::ChecksumProgress::finished(), dlgBatchCreation::FilesStatistics::FNotFound, dlgBatchCreation::FilesStatistics::FNotOpened, dlgBatchCreation::FilesStatistics::FReadError, dlgBatchCreation::FilesStatistics::FSkipped, dlgBatchCreation::FilesStatistics::getNbProcessedChecksumsFiles(), dlgBatchCreation::FilesStatistics::getNbProcessedFiles(), dlgResultsProgress::getState(), dlgBatchCreation::Options::getVerbosity(), dlgBatchCreation::Options::ovrCkFileWhenItExists, saveChecksumsInFiles(), ChecksumCalculator::setChecksumProgress(), setFilesToProcess(), setFileToBeProcessed(), wxCGetFileLength, and wxCOff_t.

Referenced by batchCreation().

void dlgBatchCreation::btnCancelClick wxCommandEvent &  event  )  [protected]
 

Processes button Cancel.

Parameters:
event The event's parameters

Reimplemented from dlgResultsProgress.

Definition at line 412 of file dlgBatchCreate.cpp.

References btnCancelClick(), AppPrefs::get(), dlgResultsProgress::getState(), and AppPrefs::write().

Referenced by btnCancelClick().

void dlgBatchCreation::createControls  ) 
 

Creates and initializes the controls of the dialog.

Reimplemented from dlgResultsProgress.

Definition at line 361 of file dlgBatchCreate.cpp.

References CONTROL_SPACE, gauFile, GAUGE_MAX, gauTotal, lblFile, lblTotal, setFilesToProcess(), and setTotalBytes().

Referenced by dlgBatchCreation().

wxArrayString dlgBatchCreation::getChecksumsFileNames const wxString &  srcFileName,
const dlgBatchCreation::Options options,
const wxArrayInt &  ckSumsTypes
[static, private]
 

Gets the names of the checksums' files to create.

Parameters:
srcFileName Name of the source file.
options Options for the batch creation of the checksums' files.
ckSumsTypes Array of checksums' file types to create.
Returns:
A array of strings which contains the names of the checksums' files to create.

Definition at line 590 of file dlgBatchCreate.cpp.

References getChecksumsFileNames(), and dlgBatchCreation::Options::replaceExtension.

Referenced by allChecksumsFileNamesExist(), getChecksumsFileNames(), and saveChecksumsInFiles().

unsigned long dlgBatchCreation::getFilesToProcess  )  const
 

Gets the number of files to process.

Returns:
The number of files to process.

Definition at line 431 of file dlgBatchCreate.cpp.

References filesToProcess.

Referenced by setFilesToProcess(), setFileToBeProcessed(), updateCurrentProcessedFile(), and updateTotalFiles().

unsigned long dlgBatchCreation::getFileToBeProcessed  )  const
 

Gets the number of the current file to be processed.

Returns:
The number of the current file to be processed.

Definition at line 459 of file dlgBatchCreate.cpp.

References fileProcessed.

Referenced by setFilesToProcess(), updateCurrentProcessedFile(), and updateTotalFiles().

BytesDisplayer dlgBatchCreation::getReadBytes  )  const
 

Gets the number of bytes read of the current processed file.

Returns:
The number of bytes read of the current processed file.

Definition at line 512 of file dlgBatchCreate.cpp.

References bytesRead.

Referenced by setTotalBytes(), and updateCurrentProcessedFile().

BytesDisplayer dlgBatchCreation::getTotalBytes  )  const
 

Gets the number of bytes of the current processed file.

Returns:
The number of bytes of the current processed file.

Definition at line 484 of file dlgBatchCreate.cpp.

References totalBytes.

Referenced by setReadBytes(), setTotalBytes(), and updateCurrentProcessedFile().

void dlgBatchCreation::saveChecksumsInFiles const wxString &  srcFileName,
const dlgBatchCreation::Options options,
const wxArrayInt &  ckSumsTypes,
const ArraySumFile &  sumFiles,
const wxArrayString &  sums,
dlgBatchCreation::FilesStatistics fstats,
dlgBatchCreation dlgPrg
[static, private]
 

Saves the given sums in checksums files.

Parameters:
srcFileName Name of the source file.
options Options for the batch creation of the checksums' files.
ckSumsTypes Array of checksums' file types to create.
sumFiles Array of SumFile for each checksum type.
sums Checksums values for each checksum type.
fstats Statistics on the files.
dlgPrg Progression dialog.

Definition at line 652 of file dlgBatchCreate.cpp.

References dlgResultsProgress::addResultLine(), dlgBatchCreation::FilesStatistics::CKCreated, dlgBatchCreation::FilesStatistics::CKOverwritten, dlgBatchCreation::FilesStatistics::CKSkipped, dlgBatchCreation::FilesStatistics::CKWriteError, getChecksumsFileNames(), dlgBatchCreation::Options::getVerbosity(), dlgBatchCreation::Options::ovrCkFileWhenItExists, and saveChecksumsInFiles().

Referenced by batchCreation(), and saveChecksumsInFiles().

void dlgBatchCreation::setFilesToProcess unsigned long  nbTotalFiles  ) 
 

// Sets the number of files to process.

Parameters:
nbTotalFiles Number of files to process.

Definition at line 443 of file dlgBatchCreate.cpp.

References filesToProcess, getFilesToProcess(), getFileToBeProcessed(), setFilesToProcess(), setFileToBeProcessed(), and updateTotalFiles().

Referenced by batchCreation(), createControls(), and setFilesToProcess().

void dlgBatchCreation::setFileToBeProcessed unsigned long  nbFiles  ) 
 

Sets the number of the file to be processed.

Parameters:
nbFiles The number of the current file to process.

Definition at line 471 of file dlgBatchCreate.cpp.

References fileProcessed, getFilesToProcess(), setFileToBeProcessed(), and updateTotalFiles().

Referenced by batchCreation(), setFilesToProcess(), and setFileToBeProcessed().

void dlgBatchCreation::setReadBytes const BytesDisplayer bytes  ) 
 

Sets the number of bytes read of the current processed file.

Parameters:
bytes The number of bytes read of the current processed file.

Definition at line 524 of file dlgBatchCreate.cpp.

References bytesRead, getTotalBytes(), setReadBytes(), BytesDisplayer::toDouble(), and updateCurrentProcessedFile().

Referenced by dlgBatchCreation::ChecksumProgress::ChecksumProgress(), dlgBatchCreation::ChecksumProgress::finished(), setReadBytes(), setTotalBytes(), and dlgBatchCreation::ChecksumProgress::update().

void dlgBatchCreation::setTotalBytes const BytesDisplayer bytes  ) 
 

Sets the number of bytes of the current processed file.

Parameters:
bytes The number of bytes of the current processed file.

Definition at line 496 of file dlgBatchCreate.cpp.

References getReadBytes(), getTotalBytes(), setReadBytes(), setTotalBytes(), BytesDisplayer::toDouble(), totalBytes, and updateCurrentProcessedFile().

Referenced by dlgBatchCreation::ChecksumProgress::ChecksumProgress(), createControls(), and setTotalBytes().

void dlgBatchCreation::updateCurrentProcessedFile  )  [protected]
 

Update the information of the current processed file.

Definition at line 554 of file dlgBatchCreate.cpp.

References DGAUGE_MAX, gauFile, gauTotal, getFilesToProcess(), getFileToBeProcessed(), getReadBytes(), getTotalBytes(), lblFile, dlgResultsProgress::refreshDialog(), and BytesDisplayer::toDouble().

Referenced by setReadBytes(), and setTotalBytes().

void dlgBatchCreation::updateTotalFiles  )  [protected]
 

Update the information of the total of the files to be processed.

Definition at line 535 of file dlgBatchCreate.cpp.

References DGAUGE_MAX, gauTotal, getFilesToProcess(), getFileToBeProcessed(), lblTotal, and dlgResultsProgress::refreshDialog().

Referenced by setFilesToProcess(), and setFileToBeProcessed().


Member Data Documentation

BytesDisplayer dlgBatchCreation::bytesRead [protected]
 

Number of read bytes in the current checked file.

Definition at line 87 of file dlgBatchCreate.hpp.

Referenced by getReadBytes(), and setReadBytes().

unsigned long dlgBatchCreation::fileProcessed [protected]
 

Number of the current file to be processed.

Definition at line 85 of file dlgBatchCreate.hpp.

Referenced by getFileToBeProcessed(), and setFileToBeProcessed().

unsigned long dlgBatchCreation::filesToProcess [protected]
 

Number of files to process.

Definition at line 84 of file dlgBatchCreate.hpp.

Referenced by getFilesToProcess(), and setFilesToProcess().

wxGauge* dlgBatchCreation::gauFile [protected]
 

Current file (gauge).

Definition at line 73 of file dlgBatchCreate.hpp.

Referenced by createControls(), and updateCurrentProcessedFile().

wxGauge* dlgBatchCreation::gauTotal [protected]
 

Current checksum file (gauge).

Definition at line 71 of file dlgBatchCreate.hpp.

Referenced by createControls(), updateCurrentProcessedFile(), and updateTotalFiles().

wxStaticText* dlgBatchCreation::lblFile [protected]
 

Current file (bytes read/total).

Definition at line 72 of file dlgBatchCreate.hpp.

Referenced by createControls(), and updateCurrentProcessedFile().

wxStaticText* dlgBatchCreation::lblTotal [protected]
 

Current checksum file (number/total).

Definition at line 70 of file dlgBatchCreate.hpp.

Referenced by createControls(), and updateTotalFiles().

BytesDisplayer dlgBatchCreation::totalBytes [protected]
 

Number of bytes of the current checked file.

Definition at line 86 of file dlgBatchCreate.hpp.

Referenced by getTotalBytes(), and setTotalBytes().


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