libxcks  0.1.0.1
libxcks::XCKSWriterDefaultHandler Class Reference

Default handler for writing XCKS files. More...

#include <handlers.hpp>

Inheritance diagram for libxcks::XCKSWriterDefaultHandler:
Collaboration diagram for libxcks::XCKSWriterDefaultHandler:

Public Member Functions

virtual ~XCKSWriterDefaultHandler ()=default
 Destructor. More...
 
void onChecksumsFileStart (const std::string &version) override
 Called on write checksumsFile start tag. More...
 
void onChecksumsFileEnd () override
 Called on write checksumsFile end tag. More...
 
void onGenerated (const std::string &by, const std::string &version, const std::time_t on) override
 Called on write generated element. More...
 
void onAlgorithm (const ChecksumAlgoId type) override
 Called on write algorithm element. More...
 
void onAlgorithmsStart () override
 Called on write algorithms start tag. More...
 
void onAlgorithmsEnd () override
 Called on write algorithms end tag. More...
 
void onAlgorithms (const ArrayChecksumAlgoId &types) override
 Called on write algorithms element. More...
 
void onLocalFilesStart () override
 Called on write localFiles start tag. More...
 
void onLocalFilesEnd () override
 Called on write localFiles end tag. More...
 
void onParentDirectoryStart () override
 Called on write parentDirectory start tag. More...
 
void onParentDirectoryStart (const std::filesystem::path &path) override
 Called on write parentDirectory start tag. More...
 
void onParentDirectoryEnd () override
 Called on write parentDirectory end tag. More...
 
void onDirectoryStart (const std::string name) override
 Called on write directory start tag. More...
 
void onDirectoryStart (const std::filesystem::path &path) override
 Called on write directory start tag. More...
 
void onDirectoryEnd () override
 Called on write directory end tag. More...
 
void onFileStart (const std::string name) override
 Called on write file start tag. More...
 
void onFileStart (const std::filesystem::path &path) override
 Called on write file start tag. More...
 
void onFileEnd () override
 Called on write file end tag. More...
 
void onFileInformation (const uintmax_t size=Invalid_File_Size, const time_t date=Invalid_DateTime) override
 Called on write information tag (for file). More...
 
void onFileChecksum (const ChecksumValue &value) override
 Called on write checksum element (for file). More...
 
void onFile (const std::filesystem::path &path, const ArrayChecksumValue &checksums, const uintmax_t size=Invalid_File_Size, const time_t date=Invalid_DateTime) override
 Called on write file element. More...
 
void onFileGetChecksumsError (const std::filesystem::path &relativePath, const std::filesystem::path &absolutePath, const XCKSWriterChecksumProvider::Status status, bool &stopWriting, const ChecksumAlgoId algoId=ChecksumAlgoId::Invalid) override
 Called on a failure on getting the checksums values for a file. More...
 
void onFileGetChecksumError (const std::filesystem::path &relativePath, const std::filesystem::path &absolutePath, const XCKSWriterChecksumProvider::Status status, const ChecksumValue &ckValue) override
 Called on a failure on verifying a checksums value for a file. More...
 
void onFatalError (const std::string &errorMessage) override
 Called on a non-recoverable error. More...
 
- Public Member Functions inherited from libxcks::XCKSWriterHandler
virtual ~XCKSWriterHandler ()=default
 Destructor. More...
 

Detailed Description

Default handler for writing XCKS files.

Definition at line 619 of file handlers.hpp.

Constructor & Destructor Documentation

◆ ~XCKSWriterDefaultHandler()

virtual libxcks::XCKSWriterDefaultHandler::~XCKSWriterDefaultHandler ( )
virtualdefault

Destructor.

Member Function Documentation

◆ onAlgorithm()

void libxcks::XCKSWriterDefaultHandler::onAlgorithm ( const ChecksumAlgoId  type)
inlineoverridevirtual

Called on write algorithm element.

Parameters
[in]typeThe algorithm of the checksum.

Implements libxcks::XCKSWriterHandler.

Definition at line 654 of file handlers.hpp.

◆ onAlgorithms()

void libxcks::XCKSWriterDefaultHandler::onAlgorithms ( const ArrayChecksumAlgoId types)
inlineoverridevirtual

Called on write algorithms element.

Parameters
[in]typesThe algorithms of the checksum.

Implements libxcks::XCKSWriterHandler.

Definition at line 671 of file handlers.hpp.

◆ onAlgorithmsEnd()

void libxcks::XCKSWriterDefaultHandler::onAlgorithmsEnd ( )
inlineoverridevirtual

Called on write algorithms end tag.

Implements libxcks::XCKSWriterHandler.

Definition at line 664 of file handlers.hpp.

◆ onAlgorithmsStart()

void libxcks::XCKSWriterDefaultHandler::onAlgorithmsStart ( )
inlineoverridevirtual

Called on write algorithms start tag.

Implements libxcks::XCKSWriterHandler.

Definition at line 659 of file handlers.hpp.

◆ onChecksumsFileEnd()

void libxcks::XCKSWriterDefaultHandler::onChecksumsFileEnd ( )
inlineoverridevirtual

Called on write checksumsFile end tag.

Parameters
[in]versionThe version of the XCKS file.

Implements libxcks::XCKSWriterHandler.

Definition at line 637 of file handlers.hpp.

◆ onChecksumsFileStart()

void libxcks::XCKSWriterDefaultHandler::onChecksumsFileStart ( const std::string &  version)
inlineoverridevirtual

Called on write checksumsFile start tag.

Parameters
[in]versionThe version of the XCKS file.

Implements libxcks::XCKSWriterHandler.

Definition at line 630 of file handlers.hpp.

◆ onDirectoryEnd()

void libxcks::XCKSWriterDefaultHandler::onDirectoryEnd ( )
inlineoverridevirtual

Called on write directory end tag.

Implements libxcks::XCKSWriterHandler.

Definition at line 717 of file handlers.hpp.

◆ onDirectoryStart() [1/2]

void libxcks::XCKSWriterDefaultHandler::onDirectoryStart ( const std::filesystem::path &  path)
inlineoverridevirtual

Called on write directory start tag.

Parameters
[in]pathThe relative full path of the directory.

Implements libxcks::XCKSWriterHandler.

Definition at line 712 of file handlers.hpp.

◆ onDirectoryStart() [2/2]

void libxcks::XCKSWriterDefaultHandler::onDirectoryStart ( const std::string  name)
inlineoverridevirtual

Called on write directory start tag.

Parameters
[in]nameThe name of the directory (without its path).

Implements libxcks::XCKSWriterHandler.

Definition at line 705 of file handlers.hpp.

◆ onFatalError()

void libxcks::XCKSWriterDefaultHandler::onFatalError ( const std::string &  errorMessage)
inlineoverridevirtual

Called on a non-recoverable error.

Parameters
errorMessageThe error message.

Implements libxcks::XCKSWriterHandler.

Definition at line 808 of file handlers.hpp.

◆ onFile()

void libxcks::XCKSWriterDefaultHandler::onFile ( const std::filesystem::path &  path,
const ArrayChecksumValue checksums,
const uintmax_t  size = Invalid_File_Size,
const time_t  date = Invalid_DateTime 
)
inlineoverridevirtual

Called on write file element.

Parameters
[in]pathThe relative full path of the file.
[in]checksumsThe checksums associated to the file.
[in]sizeThe size of the file.
[in]dateThe date and time of the file.

Implements libxcks::XCKSWriterHandler.

Definition at line 762 of file handlers.hpp.

◆ onFileChecksum()

void libxcks::XCKSWriterDefaultHandler::onFileChecksum ( const ChecksumValue value)
inlineoverridevirtual

Called on write checksum element (for file).

Parameters
[in]valueThe type and the value of the checksum.

Implements libxcks::XCKSWriterHandler.

Definition at line 752 of file handlers.hpp.

◆ onFileEnd()

void libxcks::XCKSWriterDefaultHandler::onFileEnd ( )
inlineoverridevirtual

Called on write file end tag.

Implements libxcks::XCKSWriterHandler.

Definition at line 736 of file handlers.hpp.

◆ onFileGetChecksumError()

void libxcks::XCKSWriterDefaultHandler::onFileGetChecksumError ( const std::filesystem::path &  relativePath,
const std::filesystem::path &  absolutePath,
const XCKSWriterChecksumProvider::Status  status,
const ChecksumValue ckValue 
)
inlineoverridevirtual

Called on a failure on verifying a checksums value for a file.

Note
status can be BadChecksumValue and BadDuplicateValue.
Parameters
[in]relativePathThe relative full path of the file.
[in]absolutePathThe absolute full path of the file. Must be set to true to stop the writing.
[in]statusThe type of the error.
[in]ckValueThe incorrect value of checksum.

Implements libxcks::XCKSWriterHandler.

Definition at line 798 of file handlers.hpp.

◆ onFileGetChecksumsError()

void libxcks::XCKSWriterDefaultHandler::onFileGetChecksumsError ( const std::filesystem::path &  relativePath,
const std::filesystem::path &  absolutePath,
const XCKSWriterChecksumProvider::Status  status,
bool &  stopWriting,
const ChecksumAlgoId  algoId = ChecksumAlgoId::Invalid 
)
inlineoverridevirtual

Called on a failure on getting the checksums values for a file.

Note
If stopWriting is set to false the file won't be added to the XCKS file.
status can be MissingAlgorithm, FileNotFound and ReadError.
Parameters
[in]relativePathThe relative full path of the file.
[in]absolutePathThe absolute full path of the file.
[in]statusThe type of the error.
[in,out]stopWritingShould the writing of the XCKS must be stopped? Must be set to true to stop the writing.
[in]algoIdThe faulty algorithm id (if relevant).

Implements libxcks::XCKSWriterHandler.

Definition at line 781 of file handlers.hpp.

◆ onFileInformation()

void libxcks::XCKSWriterDefaultHandler::onFileInformation ( const uintmax_t  size = Invalid_File_Size,
const time_t  date = Invalid_DateTime 
)
inlineoverridevirtual

Called on write information tag (for file).

Parameters
[in]sizeThe size of the file.
[in]dateThe date and time of the file.

Implements libxcks::XCKSWriterHandler.

Definition at line 744 of file handlers.hpp.

◆ onFileStart() [1/2]

void libxcks::XCKSWriterDefaultHandler::onFileStart ( const std::filesystem::path &  path)
inlineoverridevirtual

Called on write file start tag.

Parameters
[in]pathThe relative full path of the file.

Implements libxcks::XCKSWriterHandler.

Definition at line 731 of file handlers.hpp.

◆ onFileStart() [2/2]

void libxcks::XCKSWriterDefaultHandler::onFileStart ( const std::string  name)
inlineoverridevirtual

Called on write file start tag.

Parameters
[in]nameThe name of the file (without its path).

Implements libxcks::XCKSWriterHandler.

Definition at line 724 of file handlers.hpp.

◆ onGenerated()

void libxcks::XCKSWriterDefaultHandler::onGenerated ( const std::string &  by,
const std::string &  version,
const std::time_t  on 
)
inlineoverridevirtual

Called on write generated element.

Parameters
[in]byThe name of the application that wrote the file.
[in]versionThe version of the application that wrote the file.
[in]onThe writing date and time of the file.

Implements libxcks::XCKSWriterHandler.

Definition at line 646 of file handlers.hpp.

◆ onLocalFilesEnd()

void libxcks::XCKSWriterDefaultHandler::onLocalFilesEnd ( )
inlineoverridevirtual

Called on write localFiles end tag.

Implements libxcks::XCKSWriterHandler.

Definition at line 681 of file handlers.hpp.

◆ onLocalFilesStart()

void libxcks::XCKSWriterDefaultHandler::onLocalFilesStart ( )
inlineoverridevirtual

Called on write localFiles start tag.

Implements libxcks::XCKSWriterHandler.

Definition at line 676 of file handlers.hpp.

◆ onParentDirectoryEnd()

void libxcks::XCKSWriterDefaultHandler::onParentDirectoryEnd ( )
inlineoverridevirtual

Called on write parentDirectory end tag.

Implements libxcks::XCKSWriterHandler.

Definition at line 698 of file handlers.hpp.

◆ onParentDirectoryStart() [1/2]

void libxcks::XCKSWriterDefaultHandler::onParentDirectoryStart ( )
inlineoverridevirtual

Called on write parentDirectory start tag.

Implements libxcks::XCKSWriterHandler.

Definition at line 686 of file handlers.hpp.

◆ onParentDirectoryStart() [2/2]

void libxcks::XCKSWriterDefaultHandler::onParentDirectoryStart ( const std::filesystem::path &  path)
inlineoverridevirtual

Called on write parentDirectory start tag.

Parameters
[in]pathThe relative full path of the directory.

Implements libxcks::XCKSWriterHandler.

Definition at line 693 of file handlers.hpp.


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