adtf_file_library
0.13.1
|
namespace for indexed file definitions in version 2.0, 2.1, 3.0 and 3.1 More...
Classes | |
struct | FileHeader |
The File header for dat-files. More... | |
struct | FileExtension |
Header for a file extensions. More... | |
struct | ChunkHeader |
header for chunks Each Chunk header 16 Byte aligned within the file. More... | |
struct | ChunkRef |
header for a chunk reference More... | |
struct | StreamRef |
struct | StreamInfoHeader |
struct | AdditionalIndexInfo |
Additional index table information. More... | |
class | IndexedFile |
class | SourceFile |
class | IndexedFileReader |
class | IndexedFileWriter |
class | IndexReadTable |
class | IndexWriteTable |
Enumerations | |
enum | TimeFormat { tf_chunk_index = 1 , tf_chunk_time = 2 , tf_stream_index = 3 } |
enum | FieldMask { fm_none = 0x00 , fm_description = 0x01 , fm_date_time = 0x02 } |
enum | ReadFlags { rf_none = 0x0 , rf_use_external_buffer = 0x1 , rf_backwards = 0x2 } |
enum | SeekFlags { sf_default = 0x0 , sf_keydata = 0x1 , sf_before = 0x02 } |
enum | ChunkType { ct_data = 0x00 , ct_keydata = 0x01 , ct_info = 0x02 , ct_marker = 0x04 , ct_type = 0x08 , ct_trigger = 0x10 } |
enum | OpenMode { om_none = 0x00 , om_query_info = 0x04 , om_validate_chunk_header = 0x08 , om_file_change_mode = 0x10 , om_no_overwrite = 0x20 } |
Functions | |
a_util::datetime::DateTime | getDateTimeHelper (const FileHeader &file_header) |
Retrieve the date time from the file_header . More... | |
a_util::datetime::DateTime | getDateTime (const a_util::filesystem::Path &filename) |
Retrieve the date time from the filename , if it is an indexed file. More... | |
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 | queryFileInfo (const std::string &filename, std::string &file_info, std::list< std::string > &extensions) |
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) |
namespace for indexed file definitions in version 2.0, 2.1, 3.0 and 3.1
Mask which fields of the file header should be updated.
File open modes.
Read options.
Time format (for seek etc.)
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.
filename | the filepath to open and to retrieve the date time from |
exceptions::ErrorFileAccess | |
std::runtime_error | if file is not a valid IFHD file |
a_util::datetime::DateTime ifhd::v201_v301::getDateTimeHelper | ( | const FileHeader & | file_header | ) |
Retrieve the date time from the file_header
.
file_header | the file header to retrieve the date time from |
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;
filename | The input file name. |
extension | The requested file extension. |
extension_info | This will be filled with the file extension information. |
data | This will be filled with the file extension data. |
exceptions::ErrorFileAccess | |
std::runtime_error | if file is not a valid IFHD file |
void ifhd::v201_v301::getHeader | ( | const std::string & | filename, |
FileHeader & | file_header | ||
) |
Returns the header of a file.
filename | The filename |
file_header | This will be filled with the information. |
exceptions::ErrorFileAccess | |
std::runtime_error | if file is not a valid IFHD file |
void ifhd::v201_v301::isIfhdFile | ( | const std::string & | filename | ) |
Check if a particular file is a DAT file.
filename | Name of the file to check. |
exceptions::ErrorFileAccess | |
std::runtime_error | if file is not a valid IFHD file |
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.
filename | [in] The filename. |
file_info | [out] The info string. |
exceptions::ErrorFileAlreadyExists | |
exceptions::ErrorFileAccess | |
std::runtime_error | if file is not a valid IFHD file |
void ifhd::v201_v301::queryFileInfo | ( | const std::string & | filename, |
std::string & | file_info, | ||
std::list< std::string > & | extensions | ||
) |
Returns the date and the description of a file in a string. It will also check if the given extension exits.
filename | [in] The filename. |
file_info | [out] The info string. |
extensions | [inout] the list of extensions. |
exceptions::ErrorFileAccess | |
std::runtime_error | if file is not a valid IFHD file |
void ifhd::v201_v301::stream2AdditionalStreamIndexInfo | ( | const FileHeader & | file_header, |
AdditionalIndexInfo & | additional_index_info | ||
) |
Convert a additional stream info structure to native byte order.
[in] | file_header | The header |
[in] | additional_index_info | The additional index info. |
void ifhd::v201_v301::stream2ChunkHeader | ( | const FileHeader & | file_header, |
ChunkHeader & | chunk | ||
) |
Convert a chunk header structure to native byte order.
[in] | file_header | The header |
[in] | chunk | The chunk header. |
void ifhd::v201_v301::stream2ChunkRef | ( | const FileHeader & | file_header, |
ChunkRef & | chunk_ref | ||
) |
Convert a chunk reference structure to native byte order.
[in] | file_header | The header |
[in] | chunk_ref | The chunk reference |
void ifhd::v201_v301::stream2FileHeader | ( | FileHeader & | file_header | ) |
Convert a file header structure to native byte order.
[in] | file_header | The header |
std::runtime_error | if file version in file_header is not supported |
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.
[in] | file_header | The header |
[in] | header_ext | The header extension. |
[in] | num_extensions | The number of Extensions. |
void ifhd::v201_v301::stream2StreamInfoHeader | ( | const FileHeader & | file_header, |
StreamInfoHeader & | stream_info | ||
) |
Convert a stream info header structure to native byte order.
[in] | file_header | The header |
[in] | stream_info | The stream info. |
void ifhd::v201_v301::stream2StreamRef | ( | const FileHeader & | file_header, |
StreamRef & | stream_ref | ||
) |
Convert a stream reference structure to native byte order.
[in] | file_header | The header |
[in] | stream_ref | The stream reference |
void ifhd::v201_v301::updateHeader | ( | const std::string & | filename, |
const FileHeader & | file_header, | ||
uint32_t | mask | ||
) |
Update header info.
filename | The filename. |
file_header | The new header info. |
mask | Which fields to update, see FieldMask |
exceptions::ErrorFileAlreadyExists | |
exceptions::ErrorFileAccess | |
std::runtime_error | if file is not a valid IFHD file |
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
filename | The input file name. |
extension_info | This will be filled with the file extension information. |
data | This will be filled with the file extension data. |
exceptions::ErrorFileAccess | |
std::runtime_error | if file is not a valid IFHD file |