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

MD5File Class Reference

A MD5 file. More...

#include <md5file.hpp>

Inheritance diagram for MD5File:

Inheritance graph
[legend]
Collaboration diagram for MD5File:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual ChecksumgetChecksumCalculator () const
 Returns an instance of a class that permits to compute the MD5 value.

virtual wxString getFileType () const
 Returns the type of the file.

 MD5File ()
 Default constructor.

virtual bool read (const wxFileName &fileName)
 Reads the checksums from a MD5 file.

virtual bool write (const wxFileName &fileName)
 Writes the checksums in a file.


Static Public Member Functions

SumFilegetNewInstance ()
 Gets a new instance of this class.

bool IsValidChecksum (const wxString &checksum)
 Indicates if the given checksum is valid.


Protected Member Functions

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


Private Member Functions

 MD5File (const MD5File &source)
 Copy constructor.

virtual MD5Fileoperator= (const MD5File &source)
 Assignment operator.


Detailed Description

A MD5 file.

Definition at line 38 of file md5file.hpp.


Constructor & Destructor Documentation

MD5File::MD5File const MD5File source  )  [private]
 

Copy constructor.

Parameters:
source Source instance.

Definition at line 82 of file md5file.cpp.

References clone().

MD5File::MD5File  ) 
 

Default constructor.

Definition at line 57 of file md5file.cpp.

Referenced by getNewInstance().


Member Function Documentation

void MD5File::clone const MD5File source  )  [protected]
 

Clones the source instance in this instance.

Don't forget to call this method when cloning inherited classes.

Parameters:
source Source instance.

Definition at line 70 of file md5file.cpp.

References clone().

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

Checksum * MD5File::getChecksumCalculator  )  const [virtual]
 

Returns an instance of a class that permits to compute the MD5 value.

The calling function is responsible of the deletion of the instance with the delete operator.

Returns:
An instance of a class that permits to compute the checksum value.

Implements SumFile.

Definition at line 111 of file md5file.cpp.

wxString MD5File::getFileType  )  const [virtual]
 

Returns the type of the file.

Returns:
The type of the file.

Implements SumFile.

Definition at line 123 of file md5file.cpp.

SumFile * MD5File::getNewInstance  )  [static]
 

Gets a new instance of this class.

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

Returns:
A new instance of this class.

Definition at line 425 of file md5file.cpp.

References MD5File().

bool MD5File::IsValidChecksum const wxString &  checksum  )  [static]
 

Indicates if the given checksum is valid.

Parameters:
checksum The checksum to check.

Definition at line 384 of file md5file.cpp.

References IsValidChecksum().

Referenced by IsValidChecksum(), and read().

MD5File & MD5File::operator= const MD5File source  )  [private, virtual]
 

Assignment operator.

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

Definition at line 95 of file md5file.cpp.

References clone(), and operator=().

Referenced by operator=().

bool MD5File::read const wxFileName &  fileName  )  [virtual]
 

Reads the checksums from a MD5 file.

After the reading of the file, the state of the file should be unmodified and on success, the checksum file name must be the given one (absolute path).

The paths of the files in the ChecksumData must be relative to the path of fileName.

The information about the type of the file (text or binary) is skipped, wxChecksums always reads files in binary mode.

Parameters:
fileName The file name from which the checksums are read.
Returns:
true if the file has been read successfully, false otherwise.

Implements SumFile.

Definition at line 147 of file md5file.cpp.

References AppPrefs::get(), IsValidChecksum(), read(), AppPrefs::readLong(), and SumFile::reset().

Referenced by openChecksumFile(), and read().

bool MD5File::write const wxFileName &  fileName  )  [virtual]
 

Writes the checksums in a file.

After the writing of the file, the state of the file should be unmodified and the file name must be modified to fileName. The paths of the files in the ChecksumData must be relative to the path of fileName.

As wxChecksums always reads files in binary mode, all the file are marked as binary files.

Parameters:
fileName The file name in which the checksums are written.
Returns:
true if the checksums have been written successfully, false otherwise.

Implements SumFile.

Definition at line 269 of file md5file.cpp.

References AppPrefs::get(), getAppName(), ChecksumData::getChecksum(), SumFile::getChecksumDataBegin(), SumFile::getChecksumDataBeginI(), SumFile::getChecksumDataEnd(), SumFile::getChecksumDataEndI(), ChecksumData::getFileName(), AppPrefs::readBool(), AppPrefs::readLong(), ChecksumData::setFileName(), write(), wxCGetFileLength, and wxCOff_t.

Referenced by write().


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