libxcks  0.1.0.1
libxcks::XCKSWriterHandler Class Referenceabstract

Handler for writing XCKS files. More...

#include <handlers.hpp>

Inheritance diagram for libxcks::XCKSWriterHandler:

Public Member Functions

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

Detailed Description

Handler for writing XCKS files.

Definition at line 422 of file handlers.hpp.

Constructor & Destructor Documentation

◆ ~XCKSWriterHandler()

virtual libxcks::XCKSWriterHandler::~XCKSWriterHandler ( )
virtualdefault

Destructor.

Member Function Documentation

◆ onAlgorithm()

virtual void libxcks::XCKSWriterHandler::onAlgorithm ( const ChecksumAlgoId  type)
pure virtual

Called on write algorithm element.

Parameters
[in]typeThe algorithm of the checksum.

Implemented in libxcks::XCKSWriterDefaultHandler.

◆ onAlgorithms()

virtual void libxcks::XCKSWriterHandler::onAlgorithms ( const ArrayChecksumAlgoId types)
pure virtual

Called on write algorithms element.

Parameters
[in]typesThe algorithms of the checksum.

Implemented in libxcks::XCKSWriterDefaultHandler.

◆ onAlgorithmsEnd()

virtual void libxcks::XCKSWriterHandler::onAlgorithmsEnd ( )
pure virtual

Called on write algorithms end tag.

Implemented in libxcks::XCKSWriterDefaultHandler.

◆ onAlgorithmsStart()

virtual void libxcks::XCKSWriterHandler::onAlgorithmsStart ( )
pure virtual

Called on write algorithms start tag.

Implemented in libxcks::XCKSWriterDefaultHandler.

◆ onChecksumsFileEnd()

virtual void libxcks::XCKSWriterHandler::onChecksumsFileEnd ( )
pure virtual

Called on write checksumsFile end tag.

Parameters
[in]versionThe version of the XCKS file.

Implemented in libxcks::XCKSWriterDefaultHandler.

◆ onChecksumsFileStart()

virtual void libxcks::XCKSWriterHandler::onChecksumsFileStart ( const std::string &  version)
pure virtual

Called on write checksumsFile start tag.

Parameters
[in]versionThe version of the XCKS file.

Implemented in libxcks::XCKSWriterDefaultHandler.

◆ onDirectoryEnd()

virtual void libxcks::XCKSWriterHandler::onDirectoryEnd ( )
pure virtual

Called on write directory end tag.

Implemented in libxcks::XCKSWriterDefaultHandler.

◆ onDirectoryStart() [1/2]

virtual void libxcks::XCKSWriterHandler::onDirectoryStart ( const std::filesystem::path &  path)
pure virtual

Called on write directory start tag.

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

Implemented in libxcks::XCKSWriterDefaultHandler.

◆ onDirectoryStart() [2/2]

virtual void libxcks::XCKSWriterHandler::onDirectoryStart ( const std::string  name)
pure virtual

Called on write directory start tag.

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

Implemented in libxcks::XCKSWriterDefaultHandler.

◆ onFatalError()

virtual void libxcks::XCKSWriterHandler::onFatalError ( const std::string &  errorMessage)
pure virtual

Called on a non-recoverable error.

Parameters
errorMessageThe error message.

Implemented in libxcks::XCKSWriterDefaultHandler.

◆ onFile()

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

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.

Implemented in libxcks::XCKSWriterDefaultHandler.

◆ onFileChecksum()

virtual void libxcks::XCKSWriterHandler::onFileChecksum ( const ChecksumValue value)
pure virtual

Called on write checksum element (for file).

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

Implemented in libxcks::XCKSWriterDefaultHandler.

◆ onFileEnd()

virtual void libxcks::XCKSWriterHandler::onFileEnd ( )
pure virtual

Called on write file end tag.

Implemented in libxcks::XCKSWriterDefaultHandler.

◆ onFileGetChecksumError()

virtual void libxcks::XCKSWriterHandler::onFileGetChecksumError ( const std::filesystem::path &  relativePath,
const std::filesystem::path &  absolutePath,
const XCKSWriterChecksumProvider::Status  status,
const ChecksumValue ckValue 
)
pure virtual

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.

Implemented in libxcks::XCKSWriterDefaultHandler.

◆ onFileGetChecksumsError()

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

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).

Implemented in libxcks::XCKSWriterDefaultHandler.

◆ onFileInformation()

virtual void libxcks::XCKSWriterHandler::onFileInformation ( const uintmax_t  size = Invalid_File_Size,
const time_t  date = Invalid_DateTime 
)
pure virtual

Called on write information tag (for file).

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

Implemented in libxcks::XCKSWriterDefaultHandler.

◆ onFileStart() [1/2]

virtual void libxcks::XCKSWriterHandler::onFileStart ( const std::filesystem::path &  path)
pure virtual

Called on write file start tag.

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

Implemented in libxcks::XCKSWriterDefaultHandler.

◆ onFileStart() [2/2]

virtual void libxcks::XCKSWriterHandler::onFileStart ( const std::string  name)
pure virtual

Called on write file start tag.

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

Implemented in libxcks::XCKSWriterDefaultHandler.

◆ onGenerated()

virtual void libxcks::XCKSWriterHandler::onGenerated ( const std::string &  by,
const std::string &  version,
const std::time_t  on 
)
pure virtual

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.

Implemented in libxcks::XCKSWriterDefaultHandler.

◆ onLocalFilesEnd()

virtual void libxcks::XCKSWriterHandler::onLocalFilesEnd ( )
pure virtual

Called on write localFiles end tag.

Implemented in libxcks::XCKSWriterDefaultHandler.

◆ onLocalFilesStart()

virtual void libxcks::XCKSWriterHandler::onLocalFilesStart ( )
pure virtual

Called on write localFiles start tag.

Implemented in libxcks::XCKSWriterDefaultHandler.

◆ onParentDirectoryEnd()

virtual void libxcks::XCKSWriterHandler::onParentDirectoryEnd ( )
pure virtual

Called on write parentDirectory end tag.

Implemented in libxcks::XCKSWriterDefaultHandler.

◆ onParentDirectoryStart() [1/2]

virtual void libxcks::XCKSWriterHandler::onParentDirectoryStart ( )
pure virtual

Called on write parentDirectory start tag.

Implemented in libxcks::XCKSWriterDefaultHandler.

◆ onParentDirectoryStart() [2/2]

virtual void libxcks::XCKSWriterHandler::onParentDirectoryStart ( const std::filesystem::path &  path)
pure virtual

Called on write parentDirectory start tag.

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

Implemented in libxcks::XCKSWriterDefaultHandler.


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