|
ADTF File Library
|
#include <indexedfile_v100.h>
Classes | |
| struct | TagChunkHeader |
| struct | TagDateTime |
| struct | TagFileHeader |
| struct | TagIndexBlockItem |
Public Types | |
| enum | { tf_chunk_index = 1 , tf_chunk_time = 2 } |
| typedef struct ifhd::v100::IndexedFileV100::TagDateTime | DateTime |
| typedef struct ifhd::v100::IndexedFileV100::TagFileHeader | FileHeader |
| typedef struct ifhd::v100::IndexedFileV100::TagChunkHeader | ChunkHeader |
Public Member Functions | |
| IndexedFileV100 () | |
| ~IndexedFileV100 () | |
| void | close () |
| void | setDescription (const std::string &description) |
| std::string | getDescription () const |
| void | setDateTime (const DateTime &date_time) |
| DateTime | getDateTime () |
| void | allocHeaderExtension (int size) |
| void | freeHeaderExtension () |
| void | getHeaderExtension (void **data, int *data_size) |
| void | setHeaderExtension (void *data, int data_size) |
Protected Types | |
| typedef struct ifhd::v100::IndexedFileV100::TagIndexBlockItem | IndexBlockItem |
Protected Member Functions | |
| void | initialize () |
| void | allocBuffer (int size) |
| void | freeBuffer () |
| void | allocIndexTable (int size) |
| void | freeIndexTable () |
| void | appendIndex (uint64_t pos, timestamp_t time_stamp) |
| void | allocIndexBlock (int count=-1) |
| void | allocHeader () |
| void | freeHeader () |
| void | allocCache (int size) |
| void | freeCache () |
| void * | getCacheAddr () |
| int | getSectorSize (const std::string &filename) const |
| void * | internalMalloc (int size) |
| void | internalFree (void *memory) |
Protected Attributes | |
| bool | _attached |
| File attached? | |
| int | _sector_size |
| Sector size. | |
| utils5ext::File * | _file |
| File pointer. | |
| int64_t | _index |
| Current index. | |
| int64_t | _file_pos |
| Current file position. | |
| uint8_t * | _buffer |
| Internal buffer. | |
| int | _buffer_size |
| Buffer size. | |
| IndexBlockItem * | _index_blocks |
| Pointer to index blocks. | |
| IndexBlockItem * | _active_index_block |
| Pointer to current index block. | |
| FileHeader * | _file_header |
| File header. | |
| void * | _header_extension |
| Header extension. | |
| void * | _cache |
| Pointer to cache. | |
| int | _cache_size |
| Cache size. | |
| bool | _write_mode |
| Write mode enabled? | |
Static Protected Attributes | |
| static int | _default_block_size |
| Default block size. | |
| static int | _default_cache_size |
| Default cache size. | |
| static int | _index_table_cluster_size |
| Size of index table clusters. | |
Compatibility class for reading indexed files in format version 100.
ChunkHeader Structure
DateTime Structure
FileHeader Structure
|
protected |
IndexBlockItem Structure
| anonymous enum |
| ifhd::v100::IndexedFileV100::IndexedFileV100 | ( | ) |
Default constructor.
| ifhd::v100::IndexedFileV100::~IndexedFileV100 | ( | ) |
Destructor.
|
protected |
Allocate internal buffer.
| size | [in] Size of buffer. |
|
protected |
Allocate cache.
| size | [in] Size of cache. |
|
protected |
Allocate header.
| void ifhd::v100::IndexedFileV100::allocHeaderExtension | ( | int | size | ) |
Allocate memory for the header extension.
| size | [in] The amount of memory to allocate. |
|
protected |
Allocate index block.
| count | [in] Number of entries. |
|
protected |
Allocate index table.
| size | [in] Size of table. |
|
protected |
Append index.
| pos | [in] Position. |
| time_stamp | [in] Timestamp. |
| void ifhd::v100::IndexedFileV100::close | ( | ) |
Closes the file.
|
protected |
Free internal buffer.
|
protected |
Free cache.
|
protected |
Free header.
| void ifhd::v100::IndexedFileV100::freeHeaderExtension | ( | ) |
Frees memory allocated for the header extension.
|
protected |
Free index table.
|
protected |
Retrieve cache address.
| DateTime ifhd::v100::IndexedFileV100::getDateTime | ( | ) |
Get the timestamp of the file.
| std::string ifhd::v100::IndexedFileV100::getDescription | ( | ) | const |
Get the description of the file.
| void ifhd::v100::IndexedFileV100::getHeaderExtension | ( | void ** | data, |
| int * | data_size ) |
Returns the header extension.
| data | [out] This will point to the header extension. |
| data_size | [out] The size of the header extension. |
|
protected |
Get sector size of specified file.
| filename | [in] File to retrieve sector size of. |
|
protected |
Internal initialization method.
|
protected |
Internal deallocation method.
| memory | [in] Pointer to memory. |
|
protected |
Internal allocation method.
| size | [in] Size of Allocation. |
| void ifhd::v100::IndexedFileV100::setDateTime | ( | const DateTime & | date_time | ) |
Set the timestamp of the file.
| date_time | [in] The new timestamp. |
| void ifhd::v100::IndexedFileV100::setDescription | ( | const std::string & | description | ) |
Sets the description of the file
| description | [in] The new description. |
| void ifhd::v100::IndexedFileV100::setHeaderExtension | ( | void * | data, |
| int | data_size ) |
Set the header extension.
| data | [in] The new extension data. |
| data_size | [in] The size of the extension data. |