#include <indexedfile_v201_v301.h>
|
| | IndexedFile () |
| |
| virtual | ~IndexedFile () |
| |
| virtual void | close () |
| |
| virtual std::set< uint32_t > | getSupportedVersions () const |
| | Get a set of all supported versions.
|
| |
| void | setDescription (const std::string &description) |
| |
| std::string | getDescription () const |
| |
| std::string | getGUID () const |
| |
| a_util::datetime::DateTime | getDateTime () const |
| |
| uint8_t | getByteOrder () const |
| |
| size_t | getExtensionCount () const |
| |
| bool | findExtension (const char *identifier, FileExtension **extension_info, void **data) const |
| |
| void | getExtension (size_t index, FileExtension **extension_info, void **data) const |
| |
| void | appendExtension (const char *identifier, const void *data, size_t data_size, uint32_t type_id=0, uint32_t file_version_id=0, uint16_t stream_id=0, uint32_t user_id=0) |
| |
| void | appendExtension (const void *data, const FileExtension *extension_info) |
| |
| void | freeExtensions () |
| |
| void | getHeaderRef (FileHeader **file_header) const |
| |
|
|
typedef std::list< FileExtensionStruct > | FileExtensionList |
| | own type definition for a better work with file extension lists
|
| |
|
|
utils5ext::File | _file |
| | the open file
|
| |
|
FilePos | _file_pos |
| | current filepos
|
| |
|
uint8_t * | _buffer |
| | internal Buffer
|
| |
|
int64_t | _buffer_size |
| | internal Buffer size
|
| |
|
FileHeader * | _file_header |
| | current file header
|
| |
|
bool | _write_guid |
| | protection for writing GUID
|
| |
|
FileExtensionList | _extensions |
| | list with all extensions
|
| |
|
void * | _cache |
| | cache data area
|
| |
|
uint64_t | _cache_size |
| | size of cache
|
| |
|
bool | _write_mode |
| | For internal use only (will be moved to a private implementation).
|
| |
|
| static const uint8_t | byte_order |
| | current value of platform ByteOrder (
|
| |
|
static int64_t | default_block_size |
| | Default block size in bytes.
|
| |
|
static int64_t | default_cache_size |
| | Default cache size in bytes.
|
| |
Base class for all indexed file classes.
- FILE LAYOUT for Version 2.0.1
+----------------------------------------------------------------------------------—+
|HDR| DATA | EXTENSIONS | EXTENSIONSHEADER-HDR |
+----------------------------------------------------------------------------------—+
- FILE LAYOUT for Version 2.0.2
+-----------------------------------------------------------------------------------------------—+
|HDR| QUEUED HISTORY CHUNK DATA | SORTED CHUNK DATA | EXTENSIONS | EXTENSIONSHEADER-HDR |
+-----------------------------------------------------------------------------------------------—+
- Special Extensions to provide:
- GUUID within the File
- MASTER Index Table
- Stream Index Tables
◆ IndexedFile()
| ifhd::v201_v301::IndexedFile::IndexedFile |
( |
| ) |
|
◆ ~IndexedFile()
| virtual ifhd::v201_v301::IndexedFile::~IndexedFile |
( |
| ) |
|
|
virtual |
◆ allocBuffer()
| void ifhd::v201_v301::IndexedFile::allocBuffer |
( |
uint64_t | size | ) |
|
|
protected |
Allocates an internal buffer.
- Parameters
-
| [in] | size | The size in bytes to allocate. |
◆ allocCache()
| void ifhd::v201_v301::IndexedFile::allocCache |
( |
int64_t | size | ) |
|
|
protected |
Initialzes an internal cache.
- Parameters
-
| [in] | size | The size of the cache. |
◆ allocExtensionPage()
| void ifhd::v201_v301::IndexedFile::allocExtensionPage |
( |
utils5ext::FileSize | size, |
|
|
void ** | data ) const |
|
protected |
Allocate memory for an extension.
- Parameters
-
| [in] | size | The amount of bytes to allocate. |
| [out] | data | Pointer to the allocated space. |
◆ allocHeader()
| void ifhd::v201_v301::IndexedFile::allocHeader |
( |
| ) |
|
|
protected |
Allocates the header structure/data.
◆ appendExtension() [1/2]
| void ifhd::v201_v301::IndexedFile::appendExtension |
( |
const char * | identifier, |
|
|
const void * | data, |
|
|
size_t | data_size, |
|
|
uint32_t | type_id = 0, |
|
|
uint32_t | file_version_id = 0, |
|
|
uint16_t | stream_id = 0, |
|
|
uint32_t | user_id = 0 ) |
Adds a new extension to the file.
- Warning
- The extension 'GUID' is protected and could not be overwritten
- Parameters
-
| identifier | The identifier of the extension. |
| data | The extension data. |
| data_size | The data size. |
| type_id | An optional type id |
| file_version_id | An optional version id |
| stream_id | An optional stream id |
| user_id | An optional user id |
- Exceptions
-
| std::runtime_error | if file not in write mode |
| std::invalid_argument | if identifier is not valid |
◆ appendExtension() [2/2]
| void ifhd::v201_v301::IndexedFile::appendExtension |
( |
const void * | data, |
|
|
const FileExtension * | extension_info ) |
Adds a new extension to the file.
- Warning
- The extension 'GUID' is protected and could not be overwritten
- Parameters
-
| data | The extension data. |
| extension_info | The extension info. |
- Exceptions
-
| std::runtime_error | if file not in write mode |
| std::invalid_argument | if identifier is not valid |
◆ close()
| virtual void ifhd::v201_v301::IndexedFile::close |
( |
| ) |
|
|
virtual |
◆ findExtension()
| bool ifhd::v201_v301::IndexedFile::findExtension |
( |
const char * | identifier, |
|
|
FileExtension ** | extension_info, |
|
|
void ** | data ) const |
Finds an extension with a specific identifier.
- Parameters
-
| identifier | The identifier of the extension |
| extension_info | The extension info data. |
| data | The extension data. |
- Return values
-
| true | extension found |
| false | extension not found |
◆ freeBuffer()
| void ifhd::v201_v301::IndexedFile::freeBuffer |
( |
| ) |
|
|
protected |
Releases the internal buffer.
◆ freeCache()
| void ifhd::v201_v301::IndexedFile::freeCache |
( |
| ) |
|
|
protected |
◆ freeExtensions()
| void ifhd::v201_v301::IndexedFile::freeExtensions |
( |
| ) |
|
◆ freeHeader()
| void ifhd::v201_v301::IndexedFile::freeHeader |
( |
| ) |
|
|
protected |
Releases the header data.
◆ generateNewGUID()
| void ifhd::v201_v301::IndexedFile::generateNewGUID |
( |
std::string & | generated_guid | ) |
|
|
protected |
Generates a new GUID (XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX)
- Parameters
-
| [out] | generated_guid | new generated GUID |
◆ getByteOrder()
| uint8_t ifhd::v201_v301::IndexedFile::getByteOrder |
( |
| ) |
const |
Returns the byteorder of the file.
- Returns
- PLATFORM_LITTLE_ENDIAN_8 or PLATFORM_BIG_ENDIAN_8
◆ getCacheAddr()
| void * ifhd::v201_v301::IndexedFile::getCacheAddr |
( |
| ) |
const |
|
protected |
Returns the cache pointer
◆ getDateTime()
| a_util::datetime::DateTime ifhd::v201_v301::IndexedFile::getDateTime |
( |
| ) |
const |
Get the timestamp of the file.
- Returns
- The timestamp.
◆ getDescription()
| std::string ifhd::v201_v301::IndexedFile::getDescription |
( |
| ) |
const |
Returns the description of the file.
- Returns
- The description of the file.
◆ getExtension()
| void ifhd::v201_v301::IndexedFile::getExtension |
( |
size_t | index, |
|
|
FileExtension ** | extension_info, |
|
|
void ** | data ) const |
Get an extension with a specific index.
- Parameters
-
| index | The index of the extension. |
| extension_info | The extension info data. |
| data | The extension data. |
- Exceptions
-
| std::out_of_range | if index is out of range |
◆ getExtensionCount()
| size_t ifhd::v201_v301::IndexedFile::getExtensionCount |
( |
| ) |
const |
Get the amount of extensions in the file.
- Returns
- The amount of extensions in the file.
◆ getGUID()
| std::string ifhd::v201_v301::IndexedFile::getGUID |
( |
| ) |
const |
Get the GUID of the file.
- Returns
- The GUID.
◆ getHeaderRef()
| void ifhd::v201_v301::IndexedFile::getHeaderRef |
( |
FileHeader ** | file_header | ) |
const |
Returns the file header.
- Parameters
-
| [out] | file_header | Will point to the file header. |
◆ getSupportedVersions()
| virtual std::set< uint32_t > ifhd::v201_v301::IndexedFile::getSupportedVersions |
( |
| ) |
const |
|
virtual |
◆ initialize()
| virtual void ifhd::v201_v301::IndexedFile::initialize |
( |
| ) |
|
|
protectedvirtual |
◆ internalFree()
| void ifhd::v201_v301::IndexedFile::internalFree |
( |
void * | memory | ) |
const |
|
protected |
Release memory.
- Parameters
-
| [in] | memory | The memory which should be free'd. |
◆ internalMalloc()
| void * ifhd::v201_v301::IndexedFile::internalMalloc |
( |
size_t | size | ) |
const |
|
protected |
Allocates memory.
- Parameters
-
| [in] | size | The size of the data block. |
- Returns
- Pointer to the allocated space.
◆ setDateTime()
| void ifhd::v201_v301::IndexedFile::setDateTime |
( |
const a_util::datetime::DateTime & | date_time | ) |
|
|
protected |
Set the timestamp of the file. The timestamp is calculated from the passed date/time structure while the current time zone from the system is used.
- Parameters
-
| [in] | date_time | The new date/time for the timestamp. |
◆ setDescription()
| void ifhd::v201_v301::IndexedFile::setDescription |
( |
const std::string & | description | ) |
|
Sets the description of the file.
- Parameters
-
| description | [in] The new description. |
◆ setGUID()
| void ifhd::v201_v301::IndexedFile::setGUID |
( |
| ) |
|
|
protected |
Sets the GUID of the file.
◆ byte_order
| const uint8_t ifhd::v201_v301::IndexedFile::byte_order |
|
staticprotected |
The documentation for this class was generated from the following file: