libxcks  0.1.0.1
libxcks::XCKSWriterChecksumProvider Class Referenceabstract

Provides checksums values from an array of wanted algorithms of checksums for the XCKS writer. More...

#include <handlers.hpp>

Public Types

enum class  Status : int {
  Ok , FileNotFound , ReadError , BadChecksumValue ,
  BadDuplicateValue , MissingAlgorithm
}
 Return status of getChecksumValues(). More...
 

Public Member Functions

 XCKSWriterChecksumProvider ()=default
 Default constructor. More...
 
virtual ~XCKSWriterChecksumProvider ()=default
 Destructor. More...
 
virtual Status getChecksumValues (ArrayChecksumValue &sumValues, uintmax_t &filesize, time_t &filedatetime, const ArrayChecksumAlgoId &ids, const std::filesystem::path &filepath)=0
 Provides checksums values from an array of wanted algorithms of checksums. More...
 

Detailed Description

Provides checksums values from an array of wanted algorithms of checksums for the XCKS writer.

Definition at line 374 of file handlers.hpp.

Member Enumeration Documentation

◆ Status

Return status of getChecksumValues().

Enumerator
Ok 

File read and checksums calculated successfully.

FileNotFound 

File not found.

ReadError 

Read error.

BadChecksumValue 

Bad value of checksum returned.

BadDuplicateValue 

A duplicate value has been returned.

MissingAlgorithm 

An asked algorithm is missing.

Definition at line 378 of file handlers.hpp.

Constructor & Destructor Documentation

◆ XCKSWriterChecksumProvider()

libxcks::XCKSWriterChecksumProvider::XCKSWriterChecksumProvider ( )
default

Default constructor.

◆ ~XCKSWriterChecksumProvider()

virtual libxcks::XCKSWriterChecksumProvider::~XCKSWriterChecksumProvider ( )
virtualdefault

Destructor.

Member Function Documentation

◆ getChecksumValues()

virtual Status libxcks::XCKSWriterChecksumProvider::getChecksumValues ( ArrayChecksumValue sumValues,
uintmax_t &  filesize,
time_t &  filedatetime,
const ArrayChecksumAlgoId ids,
const std::filesystem::path &  filepath 
)
pure virtual

Provides checksums values from an array of wanted algorithms of checksums.

When returning sumValues must contains the checksums values required in ids, in any order, but no less and no more.

Parameters
[out]sumValuesThe calculated values.
[out]filesizeThe size of path. Can be Invalid_File_Size.
[out]filedatetimeThe date/time of path. Can be Invalid_DateTime.
[in]idsThe ids of the wanted algorithm of checksums.
[in]filepathAbsolute path of the file from which the checksums must be calculated.
Returns
The status of the calculation of the checksums for the given file.

The documentation for this class was generated from the following file: