libxcks  0.1.0.1
libxcks::ZXCKSWriter Class Reference

ZXCKS file writer. More...

#include <xckswriter.hpp>

Inheritance diagram for libxcks::ZXCKSWriter:
Collaboration diagram for libxcks::ZXCKSWriter:

Public Member Functions

 ZXCKSWriter ()=delete
 Deleted default constructor. More...
 
 ZXCKSWriter (const ZXCKSWriter &)=delete
 Deleted copy constructor. More...
 
ZXCKSWriteroperator= (const ZXCKSWriter &)=delete
 Deleted copy assignment operator. More...
 
 ZXCKSWriter (XCKSWriterHandler &xcksWriterHandler, XCKSWriterChecksumProvider &checksumProvider, const ZXCKSWriterOptions &options, const Version version, const ArrayChecksumAlgoId &algoIds, const ChecksumFormatter::ConfigurationProvider &ckftConfProvider)
 Constructor. More...
 
virtual ~ZXCKSWriter ()
 Destructor. More...
 
- Public Member Functions inherited from libxcks::XCKSWriter
 XCKSWriter ()=delete
 Deleted default constructor. More...
 
 XCKSWriter (const XCKSWriter &)=delete
 Deleted copy constructor. More...
 
XCKSWriteroperator= (const XCKSWriter &)=delete
 Deleted copy assignment operator. More...
 
 XCKSWriter (XCKSWriterHandler &xcksWriterHandler, XCKSWriterChecksumProvider &checksumProvider, const XCKSWriterOptions &options, const Version version, const ArrayChecksumAlgoId &algoIds, const ChecksumFormatter::ConfigurationProvider &ckftConfProvider)
 Constructor. More...
 
virtual ~XCKSWriter ()
 Destructor. More...
 
bool write (std::ostream &os, const std::filesystem::path &basePath, const ArrayPath &relativePaths)
 Writes an XCKS file to an output stream. More...
 
bool write (const std::filesystem::path &fileFullPath, const ArrayPath &relativePaths)
 Writes an XCKS file to a file. More...
 
bool write (const std::filesystem::path &filePath, const std::filesystem::path &basePath, const ArrayPath &relativePaths)
 Writes an XCKS file to a file with a different base path. More...
 

Protected Member Functions

bool doWrite (std::ostream &os, const std::filesystem::path &basePath, const ArrayPath &relativePaths) override
 Writes a ZXCKS file to an output stream. More...
 

Additional Inherited Members

- Protected Attributes inherited from libxcks::XCKSWriter
XCKSWriterHandlerwriterHandler
 The XCKS file writer handler. More...
 
XCKSWriterChecksumProviderckProvider
 The provider of checksums values. More...
 
const XCKSWriterOptionswriterOptions
 The writer options. More...
 
const Version version
 Version of the (Z)XCKS file to write. More...
 
const ArrayChecksumAlgoId sumsAlgos
 Type of algorithms' checksums to write for each file. More...
 
const ChecksumFormatter::ConfigurationProviderckfConfProvider
 Configuration provider for ChecksumFormatter. More...
 

Detailed Description

ZXCKS file writer.

Definition at line 204 of file xckswriter.hpp.

Constructor & Destructor Documentation

◆ ZXCKSWriter() [1/3]

libxcks::ZXCKSWriter::ZXCKSWriter ( )
delete

Deleted default constructor.

◆ ZXCKSWriter() [2/3]

libxcks::ZXCKSWriter::ZXCKSWriter ( const ZXCKSWriter )
delete

Deleted copy constructor.

◆ ZXCKSWriter() [3/3]

libxcks::ZXCKSWriter::ZXCKSWriter ( XCKSWriterHandler xcksWriterHandler,
XCKSWriterChecksumProvider checksumProvider,
const ZXCKSWriterOptions options,
const Version  version,
const ArrayChecksumAlgoId algoIds,
const ChecksumFormatter::ConfigurationProvider ckftConfProvider 
)

Constructor.

Parameters
xcksWriterHandlerThe XCKS file reader handler.
checksumProviderThe provider of checksums values from an array of of wanted algorithms of checksums.
optionsOptions of the ZXCKS writer.
versionThe wanted version of XCKS specification file.
algoIdsThe algorithms to compute for each file. Each algorithm must appears only once in the array.
ckftConfProviderConfiguration provider for ChecksumFormatter.

Definition at line 213 of file xckswriter.cpp.

◆ ~ZXCKSWriter()

libxcks::ZXCKSWriter::~ZXCKSWriter ( )
virtual

Destructor.

Definition at line 229 of file xckswriter.cpp.

Member Function Documentation

◆ doWrite()

bool libxcks::ZXCKSWriter::doWrite ( std::ostream &  os,
const std::filesystem::path &  basePath,
const ArrayPath relativePaths 
)
overrideprotectedvirtual

Writes a ZXCKS file to an output stream.

Call this method only after checkBaseDirAndPathList().

Note
Errors must be handled in XCKSWriterHandler::onFatalError, XCKSWriterHandler::onFileGetChecksumsError, XCKSWriterHandler::onFileGetChecksumError and XCKSWriterHandler::onFileReadError (the provided XCKS file writer's handler).
Parameters
[in,out]osThe output stream.
[in]basePathThe base path of the written ZXCKS file. This path must be an absolute path of a directory and must ends with a path separator.
[in]relativePathsRelative paths (to basePath) of files to add in the ZXCKS file.
Returns
true if the ZXCKS file has been successfully written to the given stream, false otherwise.

Reimplemented from libxcks::XCKSWriter.

Definition at line 238 of file xckswriter.cpp.

◆ operator=()

ZXCKSWriter& libxcks::ZXCKSWriter::operator= ( const ZXCKSWriter )
delete

Deleted copy assignment operator.


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