#include <sumfile.hpp>
Inheritance diagram for SumFile:
Public Member Functions | |
long | addChecksumData (const ChecksumData &checksumData) |
Adds a checksum data in the file. | |
virtual Checksum * | getChecksumCalculator () const =0 |
Returns an instance of a class that permits to compute the checksum value. | |
void | getChecksumData (const long key, ChecksumData &checksumData) const |
Gets the checksum data of the given key. | |
ChecksumData | getChecksumData (const long key) const |
Returns the checksum data of the given key. | |
MChecksumData::const_iterator | getChecksumDataBegin () const |
Returns an iterator pointing at the first element of the checksums data. | |
size_t | getChecksumDataCount () const |
Returns the number of checksum data in file. | |
MChecksumData::const_iterator | getChecksumDataEnd () const |
Returns an iterator pointing at the one-after-the-last element of the checksums data. | |
void | getChecksumDataKeys (MChecksumDataKeys &keys) const |
Gets all the keys of the checksums data. | |
wxString | getFileName () const |
Gets the name of the checksum file. | |
virtual wxString | getFileType () const =0 |
Returns the type of the file. | |
bool | getModified () const |
Indicates whether the file has been modified. | |
wxPathFormat | getPathFormat (const wxFileName &fileName, const wxString &commentChars=wxT(";"), const unsigned int maxLinesToRead=UINT_MAX) const |
Gets the path format that is used in the given file. | |
virtual bool | read (const wxFileName &fileName)=0 |
Reads the checksums from a file. | |
bool | removeChecksumData (const long key) |
Removes a checksum data in the file. | |
virtual void | reset () |
Resets the sum file. | |
bool | setChecksumData (const long key, const ChecksumData &checksumData) |
Sets the checksum data of the given key. | |
bool | setChecksumState (const long key, const ChecksumData::State state) |
Sets the checksum state of the given key. | |
void | setFileName (const wxString &newFileName) |
Sets the name of the checksum file. | |
void | setModified (const bool newModifiedState) |
Sets the "modified" state of the file. | |
SumFile () | |
Default constructor. | |
virtual bool | write (const wxFileName &fileName)=0 |
Writes the checksums in a file. | |
Protected Member Functions | |
void | clone (const SumFile &source) |
Clones the source instance in this instance. | |
MChecksumData::iterator | getChecksumDataBeginI () |
Returns an iterator pointing at the first element of the checksums data. | |
MChecksumData::iterator | getChecksumDataEndI () |
Returns an iterator pointing at the one-after-the-last element of the checksums data. | |
Static Protected Member Functions | |
long | getID () |
Gets a new unique identifier. | |
Private Member Functions | |
virtual SumFile & | operator= (const SumFile &source) |
Assignment operator. | |
SumFile (const SumFile &source) | |
Copy constructor. | |
Private Attributes | |
MChecksumData | checksums |
The checksums that are contained in the file. | |
wxString | fileName |
Name of the checksum file. Empty for none. | |
bool | modified |
Indicates that the file has been modified. | |
Static Private Attributes | |
long | idGen = 0L |
Value for unique identifiers generation. |
Definition at line 129 of file sumfile.hpp.
|
Copy constructor.
Definition at line 286 of file sumfile.cpp. References clone(). |
|
Default constructor.
Definition at line 256 of file sumfile.cpp. References setModified(). |
|
Adds a checksum data in the file. After setting the checksum data, the state of the file is "modified".
Definition at line 509 of file sumfile.cpp. References addChecksumData(), checksums, getID(), and setModified(). Referenced by addChecksumData(), and ChecksumsListView::addFiles(). |
|
Clones the source instance in this instance. Don't forget to call this method when cloning inherited classes.
Definition at line 270 of file sumfile.cpp. References checksums, clone(), and modified. Referenced by clone(), operator=(), and SumFile(). |
|
Returns an instance of a class that permits to compute the checksum value.
The calling function is responsible of the deletion of the instance with the
Implemented in MD5File, and SFVFile. Referenced by ChecksumsListView::addFiles(), ChecksumsListView::check(), dlgMultiCheck::checkChecksumsFiles(), and ChecksumsListView::recompute(). |
|
Gets the checksum data of the given key.
Definition at line 441 of file sumfile.cpp. References checksums, and getChecksumData(). |
|
Returns the checksum data of the given key.
Definition at line 423 of file sumfile.cpp. References getChecksumData(). Referenced by ChecksumsListView::addChecksum(), ChecksumsListView::check(), getChecksumData(), ChecksumsListView::getStates(), ChecksumsListView::recompute(), ChecksumsListView::setChecksum(), ChecksumsListView::setChecksumState(), and SumListCompareFnct(). |
|
Returns an iterator pointing at the first element of the checksums data.
Definition at line 546 of file sumfile.cpp. References checksums. Referenced by dlgMultiCheck::checkChecksumsFiles(), ChecksumsListView::isInList(), ChecksumsListView::removeFilesInList(), SFVFile::write(), and MD5File::write(). |
|
Returns an iterator pointing at the first element of the checksums data. For internal use only.
Definition at line 572 of file sumfile.cpp. References checksums. Referenced by SFVFile::write(), and MD5File::write(). |
|
Returns the number of checksum data in file.
Definition at line 408 of file sumfile.cpp. References checksums. Referenced by dlgMultiCheck::checkChecksumsFiles(), and ChecksumsListView::removeFilesInList(). |
|
Returns an iterator pointing at the one-after-the-last element of the checksums data.
Definition at line 558 of file sumfile.cpp. References checksums. Referenced by dlgMultiCheck::checkChecksumsFiles(), ChecksumsListView::isInList(), ChecksumsListView::removeFilesInList(), SFVFile::write(), and MD5File::write(). |
|
Returns an iterator pointing at the one-after-the-last element of the checksums data. For internal use only.
Definition at line 586 of file sumfile.cpp. References checksums. Referenced by SFVFile::write(), and MD5File::write(). |
|
Gets all the keys of the checksums data.
Definition at line 389 of file sumfile.cpp. References checksums, and getChecksumDataKeys(). Referenced by getChecksumDataKeys(), and ChecksumsListView::setSumFile(). |
|
Gets the name of the checksum file.
Definition at line 338 of file sumfile.cpp. References fileName. Referenced by dlgMultiCheck::checkChecksumsFiles(), frmSums::checkFileBeforeClose(), ChecksumsListView::isInList(), frmSums::itmFileOpenRecentClick(), frmSums::itmFileSaveClick(), ChecksumsListView::removeFilesInList(), ChecksumsListView::selectDirectoriesToAdd(), ChecksumsListView::selectFilesToAdd(), ChecksumsListView::setChecksum(), SumListCompareFnct(), and frmSums::updateTitle(). |
|
Returns the type of the file.
Implemented in MD5File, and SFVFile. Referenced by frmSums::itmFileSaveAsClick(), and frmSums::updateTitle(). |
|
Gets a new unique identifier.
Definition at line 312 of file sumfile.cpp. References idGen. Referenced by addChecksumData(). |
|
Indicates whether the file has been modified.
Definition at line 364 of file sumfile.cpp. References modified. Referenced by frmSums::checkFileBeforeClose(), frmSums::FrameClose(), frmSums::itmFileSaveClick(), and frmSums::updateTitle(). |
|
Gets the path format that is used in the given file.
Definition at line 604 of file sumfile.cpp. References getPathFormat(). Referenced by getPathFormat(). |
|
Assignment operator.
Definition at line 299 of file sumfile.cpp. References clone(), and operator=(). Referenced by operator=(). |
|
Reads the checksums from a 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
|
|
Removes a checksum data in the file. After setting the checksum data, the state of the file is "modified".
Definition at line 528 of file sumfile.cpp. References checksums, modified, and removeChecksumData(). Referenced by removeChecksumData(), and ChecksumsListView::removeSelectedChecksums(). |
|
Resets the sum file.
Clears all the checksums in the file and sets the "modified" state to Definition at line 325 of file sumfile.cpp. References checksums, and setModified(). Referenced by SFVFile::read(), and MD5File::read(). |
|
Sets the checksum data of the given key. After setting the checksum data, the state of the file is "modified".
Definition at line 462 of file sumfile.cpp. References checksums, setChecksumData(), and setModified(). Referenced by ChecksumsListView::recompute(), and setChecksumData(). |
|
Sets the checksum state of the given key. After setting the checksum data, the state of the file is unchanged.
Definition at line 487 of file sumfile.cpp. References checksums, and setChecksumState(). Referenced by setChecksumState(), and ChecksumsListView::setChecksumState(). |
|
Sets the name of the checksum file.
Definition at line 351 of file sumfile.cpp. References fileName, and setFileName(). Referenced by frmSums::itmFileNewClick(), and setFileName(). |
|
Sets the "modified" state of the file.
Definition at line 376 of file sumfile.cpp. References modified, and setModified(). Referenced by addChecksumData(), frmSums::initializeFromCmdLine(), reset(), setChecksumData(), setModified(), and SumFile(). |
|
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
Implemented in MD5File, and SFVFile. Referenced by frmSums::initializeFromCmdLine(), and frmSums::saveChecksumFile(). |
|
The checksums that are contained in the file.
Definition at line 133 of file sumfile.hpp. Referenced by addChecksumData(), clone(), getChecksumData(), getChecksumDataBegin(), getChecksumDataBeginI(), getChecksumDataCount(), getChecksumDataEnd(), getChecksumDataEndI(), getChecksumDataKeys(), removeChecksumData(), reset(), setChecksumData(), and setChecksumState(). |
|
Name of the checksum file. Empty for none.
Definition at line 134 of file sumfile.hpp. Referenced by getFileName(), and setFileName(). |
|
Value for unique identifiers generation.
Definition at line 249 of file sumfile.cpp. Referenced by getID(). |
|
Indicates that the file has been modified.
Definition at line 135 of file sumfile.hpp. Referenced by clone(), getModified(), removeChecksumData(), and setModified(). |