24 #ifndef INC_XCKSFILEREADER_1_HPP_1B941C5D_4F8F_4379_9279_18E35D5DD8EB
25 #define INC_XCKSFILEREADER_1_HPP_1B941C5D_4F8F_4379_9279_18E35D5DD8EB
48 typedef SSIZE_T ssize_t;
152 void endElement(const std::
string& name) noexcept(false) override;
155 void characters(const std::
string& chars) noexcept(false) override;
158 void fatalError(XML_Error errorCode, const std::
string& errorMessage,
int line,
int column) noexcept override;
Stores the value of a checksum.
std::vector< ChecksumValue > ArrayChecksumValue
Array of values of checksum.
XCKS file version 1 handler.
void startDirectoryElement(const XMLParserAttributes &atts) noexcept(false)
Receives notification of the beginning of a "directory" element.
XCKS1FileHandler & operator=(const XCKS1FileHandler &)=delete
Deleted copy assignment operator.
virtual ~XCKS1FileHandler()
Destructor.
ArrayChecksumValue readChecksumsValues
Read checksums values.
void fatalError(XML_Error errorCode, const std::string &errorMessage, int line, int column) noexcept override
Receive notification of a non-recoverable error.
XCKS1FileHandler(const XCKS1FileHandler &)=delete
Deleted copy constructor.
ArrayChecksumAlgoId sumsAlgos
Type of algorithms' checksums to read for each file.
void startLocalFilesElement(const XMLParserAttributes &atts) noexcept(false)
Receives notification of the beginning of a "localFiles" element.
XMLTags tagInChecksumsFileTag
Current tag in "checksumsFile" tag.
void startElement(const std::string &name, const XMLParserAttributes &atts) noexcept(false) override
Receives notification of the beginning of an element.
void endFileElement() noexcept(false)
Receives notification of the end of a "file" element.
static const std::string parentDir
Parent directory on Unix and windows.
void startGeneratedElement(const XMLParserAttributes &atts) noexcept(false)
Receives notification of the beginning of a "generated" element.
ArrayChecksumAlgoId algosToRead
Remaining algorithms to read for a file.
ssize_t curBaseDirectoryDir
Current directory in the base directory of the checksums' file name.
uintmax_t fileLength
The current file size.
std::string fileName
Name of checksums' file.
time_t lastFileModicationTime
The current last file modification time.
std::stack< XMLTags > readTags
Stack of read tags.
const StringSet possibleSumsAlgosName
Possible algorithms names for a (Z)XCKS file.
void startFileElement(const XMLParserAttributes &atts) noexcept(false)
Receives notification of the beginning of a "file" element.
std::stack< StringSet > namesInDirectories
Read filenames in directories.
void startAlgorithmElement(const XMLParserAttributes &atts) noexcept(false)
Receives notification of the beginning of a "algorithm" element.
@ DIRECTORY
directory element
@ GENERATED
generated element
@ LOCALFILES
localFiles element
@ BAD_TAG
Bad or unknown tag.
@ SEQ_BEGIN
Beginning of a sequence.
@ CHECKSUMSFILE
checksumsFile element
@ PARENTDIRECTORY
parentDirectory element
@ CHECKSUM
checksum element
@ INFORMATION
information element
@ ALGORITHM
algorithm element
@ ALGORITHMS
algorithms element
void startChecksumElement(const XMLParserAttributes &atts) noexcept(false)
Receives notification of the beginning of a "checksum" element.
XCKS1FileHandler()=delete
Deleted default constructor.
ArrayString currentRelativeDirectory
The current relative directory.
void startAlgorithmsElement(const XMLParserAttributes &atts) noexcept(false)
Receives notification of the beginning of a "algorithms" element.
void characters(const std::string &chars) noexcept(false) override
Receives notification of character data.
XMLTags tagInFileTag
Information tag seen inside a file tag.
XMLTags stringToXMLTags(const std::string &str)
Gets a XML tag identifier from a string.
void startParentDirectoryElement(const XMLParserAttributes &atts) noexcept(false)
Receives notification of the beginning of a "parentDirectory" element.
const std::filesystem::path baseDirectory
The base directory of the checksums' file.
void startInformationElement(const XMLParserAttributes &atts) noexcept(false)
Receives notification of the beginning of a "information" element.
void endElement(const std::string &name) noexcept(false) override
Receives notification of the end of an element.
const std::vector< std::filesystem::path > baseDirectoryDirs
The base directory of the checksums' file directories.
XCKSReaderHandler & readerHandler
The XCKS file reader handler.
Handler for reading XCKS files.
Manages elements' attributes.
Default XML parser handler.
Handlers for reading and writing XCKS files.
std::vector< ChecksumAlgoId > ArrayChecksumAlgoId
Array of ids of algorithms of checksums.
std::vector< std::string > ArrayString
Array of strings.
std::set< std::string > StringSet
Set of strings.
A very simple XML Parser.