ADTF File Library
Loading...
Searching...
No Matches
ifhd::v500 Namespace Reference

namespace for indexed file definitions in version 5.0 More...

Classes

class  IndexedFile
 
class  IndexedFileReader
 
class  IndexedFileWriter
 

Typedefs

using TimeFormat = v400::TimeFormat
 
using ReadFlags = v400::ReadFlags
 
using FieldMask = v400::FieldMask
 
using FileHeader = v400::FileHeader
 The File header for dat-files.
 
using FileExtension = v400::FileExtension
 Header for a file extensions.
 
using ChunkHeader = v400::ChunkHeader
 header for chunks Each Chunk header 16 Byte aligned within the file.
 
using ChunkRef = v400::ChunkRef
 header for a chunk reference
 
using StreamRef = v400::StreamRef
 
using StreamInfoHeader = v400::StreamInfoHeader
 
using AdditionalIndexInfo = v400::AdditionalIndexInfo
 Additional index table information.
 
using ChecksumType = v400::ChecksumType
 Type of the checksum function used for calculating the checksum in the "checksums" extension.
 
using ChecksumExtensionHeader = v201_v301::ChecksumExtensionHeader
 Header of the "checksums" extension.
 
using FileRangeChecksumXxh3_64 = v400::FileRangeChecksumXxh3_64
 A checksum over a range within the file itself.
 
using SeekFlags = v400::SeekFlags
 
using ChunkType = v400::ChunkType
 
using OpenMode = v400::OpenMode
 
using IndexReadTable = v400::IndexReadTable
 
using IndexWriteTable = v400::IndexWriteTable
 

Functions

a_util::datetime::DateTime getDateTime (const a_util::filesystem::Path &filename)
 Retrieve the date time from the filename , if it is an indexed file.
 
void getHeader (const std::string &filename, FileHeader &file_header)
 
void updateHeader (const std::string &filename, const FileHeader &file_header, uint32_t mask)
 
void queryFileInfo (const std::string &filename, std::string &file_info)
 
void getExtension (const std::string &filename, const std::string &extension, FileExtension *extension_info, void **data)
 
void writeExtension (const std::string &filename, const FileExtension &extension_info, const void *data)
 
void isIfhdFile (const std::string &filename)
 
void stream2FileHeader (FileHeader &file_header)
 
void stream2FileHeaderExtension (const FileHeader &file_header, FileExtension *header_ext, size_t num_extensions)
 
void stream2ChunkHeader (const FileHeader &file_header, ChunkHeader &chunk)
 
void stream2ChunkRef (const FileHeader &file_header, ChunkRef &chunk_ref)
 
void stream2StreamRef (const FileHeader &file_header, StreamRef &stream_ref)
 
void stream2StreamInfoHeader (const FileHeader &file_header, StreamInfoHeader &stream_info)
 
void stream2AdditionalStreamIndexInfo (const FileHeader &file_header, AdditionalIndexInfo &additional_index_info)
 
void verifyIntegrity (const std::string &file_name)
 

Detailed Description

namespace for indexed file definitions in version 5.0

Typedef Documentation

◆ AdditionalIndexInfo

Additional index table information.

◆ ChecksumExtensionHeader

Header of the "checksums" extension.

◆ ChecksumType

Type of the checksum function used for calculating the checksum in the "checksums" extension.

◆ ChunkHeader

header for chunks Each Chunk header 16 Byte aligned within the file.

◆ ChunkRef

header for a chunk reference

◆ ChunkType

The chunk types.

◆ FieldMask

◆ FileExtension

Header for a file extensions.

◆ FileHeader

The File header for dat-files.

◆ FileRangeChecksumXxh3_64

A checksum over a range within the file itself.

◆ IndexReadTable

Class for storing an index table of an indexed file.

◆ IndexWriteTable

Class for storing an index table of an indexed file.

◆ OpenMode

File open modes.

◆ ReadFlags

Read options.

◆ SeekFlags

◆ StreamInfoHeader

◆ StreamRef

◆ TimeFormat

Time format (for seek etc.)

Function Documentation

◆ getDateTime()

a_util::datetime::DateTime ifhd::v201_v301::getDateTime ( const a_util::filesystem::Path & filename)

Retrieve the date time from the filename , if it is an indexed file.

Parameters
filenamethe filepath to open and to retrieve the date time from
Returns
a_util::datetime::DateTime
Exceptions
exceptions::ErrorFileAccess
std::runtime_errorif file is not a valid IFHD file

◆ getExtension()

void ifhd::v201_v301::getExtension ( const std::string & filename,
const std::string & extension,
FileExtension * extension_info,
void ** data )

Return the requested file extension. You have to release the memory for the return value data with delete [] data;

Parameters
filenameThe input file name.
extensionThe requested file extension.
extension_infoThis will be filled with the file extension information.
dataThis will be filled with the file extension data.
Exceptions
exceptions::ErrorFileAccess
std::runtime_errorif file is not a valid IFHD file

◆ getHeader()

void ifhd::v201_v301::getHeader ( const std::string & filename,
FileHeader & file_header )

Returns the header of a file.

Parameters
filenameThe filename
file_headerThis will be filled with the information.
Exceptions
exceptions::ErrorFileAccess
std::runtime_errorif file is not a valid IFHD file

◆ isIfhdFile()

void ifhd::v201_v301::isIfhdFile ( const std::string & filename)

Check if a particular file is a DAT file.

Parameters
filenameName of the file to check.
Exceptions
exceptions::ErrorFileAccess
std::runtime_errorif file is not a valid IFHD file

◆ queryFileInfo()

void ifhd::v201_v301::queryFileInfo ( const std::string & filename,
std::string & file_info )

Returns the date and the description of a file in a string.

Parameters
filename[in] The filename.
file_info[out] The info string.
Exceptions
exceptions::ErrorFileAlreadyExists
exceptions::ErrorFileAccess
std::runtime_errorif file is not a valid IFHD file

◆ stream2AdditionalStreamIndexInfo()

void ifhd::v201_v301::stream2AdditionalStreamIndexInfo ( const FileHeader & file_header,
AdditionalIndexInfo & additional_index_info )

Convert a additional stream info structure to native byte order.

Parameters
[in]file_headerThe header
[in]additional_index_infoThe additional index info.
Remarks
implemented rt safe

◆ stream2ChunkHeader()

void ifhd::v201_v301::stream2ChunkHeader ( const FileHeader & file_header,
ChunkHeader & chunk )

Convert a chunk header structure to native byte order.

Parameters
[in]file_headerThe header
[in]chunkThe chunk header.
Remarks
implemented rt safe

◆ stream2ChunkRef()

void ifhd::v201_v301::stream2ChunkRef ( const FileHeader & file_header,
ChunkRef & chunk_ref )

Convert a chunk reference structure to native byte order.

Parameters
[in]file_headerThe header
[in]chunk_refThe chunk reference
Remarks
implemented rt safe

◆ stream2FileHeader()

void ifhd::v201_v301::stream2FileHeader ( FileHeader & file_header)

Convert a file header structure to native byte order.

Parameters
[in]file_headerThe header
Remarks
implemented rt safe
Exceptions
std::runtime_errorif file version in file_header is not supported

◆ stream2FileHeaderExtension()

void ifhd::v201_v301::stream2FileHeaderExtension ( const FileHeader & file_header,
FileExtension * header_ext,
size_t num_extensions )

Convert a file header extension structure to native byte order.

Parameters
[in]file_headerThe header
[in]header_extThe header extension.
[in]num_extensionsThe number of Extensions.
Remarks
implemented rt safe

◆ stream2StreamInfoHeader()

void ifhd::v201_v301::stream2StreamInfoHeader ( const FileHeader & file_header,
StreamInfoHeader & stream_info )

Convert a stream info header structure to native byte order.

Parameters
[in]file_headerThe header
[in]stream_infoThe stream info.
Remarks
implemented rt safe

◆ stream2StreamRef()

void ifhd::v201_v301::stream2StreamRef ( const FileHeader & file_header,
StreamRef & stream_ref )

Convert a stream reference structure to native byte order.

Parameters
[in]file_headerThe header
[in]stream_refThe stream reference
Remarks
implemented rt safe

◆ updateHeader()

void ifhd::v201_v301::updateHeader ( const std::string & filename,
const FileHeader & file_header,
uint32_t mask )

Update header info.

Parameters
filenameThe filename.
file_headerThe new header info.
maskWhich fields to update, see FieldMask
Exceptions
exceptions::ErrorFileAlreadyExists
exceptions::ErrorFileAccess
std::runtime_errorif file is not a valid IFHD file

◆ verifyIntegrity()

void ifhd::v201_v301::verifyIntegrity ( const std::string & file_name)

Verify the integrity of the given file by checking the contained hashes

Exceptions
std::runtime_errorin case of an error

◆ writeExtension()

void ifhd::v201_v301::writeExtension ( const std::string & filename,
const FileExtension & extension_info,
const void * data )

Write an extension If the extension already exists, it will be overwritten

Warning
The extension 'GUID' is protected and could not be overwritten
Parameters
filenameThe input file name.
extension_infoThis will be filled with the file extension information.
dataThis will be filled with the file extension data.
Exceptions
exceptions::ErrorFileAccess
std::runtime_errorif file is not a valid IFHD file