|
PST File Format SDK v0.4
|
A data block which refers to other data blocks, in order to extend the physical size limit (8k) to a larger logical size. More...
#include <node.h>
Inheritance diagram for pstsdk::extended_block:
Collaboration diagram for pstsdk::extended_block:Public Member Functions | |
| extended_block (const shared_db_ptr &db, const block_info &info, ushort level, size_t total_size, size_t child_max_total_size, ulong page_max_count, ulong child_page_max_count, std::vector< block_id > bi) | |
| Construct an extended_block from disk. | |
| size_t | read_raw (byte *pdest_buffer, size_t size, ulong offset) const |
| Read data from this block. | |
| uint | get_page_count () const |
| Get the number of physical pages in this data_block. | |
| std::shared_ptr< external_block > | get_page (uint page_num) const |
| Get a specific page of this data_block. | |
| ushort | get_level () const |
| Get the "level" of this extended_block. | |
| bool | is_internal () const |
| Returns the blocks internal/external state. | |
Public Member Functions inherited from pstsdk::data_block | |
| data_block (const shared_db_ptr &db, const block_info &info, size_t total_size) | |
| Constructor for a data_block. | |
| virtual | ~data_block () |
| size_t | read (std::vector< byte > &buffer, ulong offset) const |
| Read data from this block. | |
| template<typename T > | |
| T | read (ulong offset) const |
| Read data from this block. | |
| size_t | get_total_size () const |
| Get the total logical size of this block. | |
Public Member Functions inherited from pstsdk::block | |
| block (const shared_db_ptr &db, const block_info &info) | |
| Basic block constructor. | |
| virtual | ~block () |
| size_t | get_disk_size () const |
| Get the last known size of this block on disk. | |
| block_id | get_id () const |
| Get the block_id of this block. | |
| ulonglong | get_address () const |
| Get the address of this block on disk. | |
Additional Inherited Members | |
Protected Member Functions inherited from pstsdk::block | |
| shared_db_ptr | get_db_ptr () const |
| virtual void | trim () |
Protected Attributes inherited from pstsdk::data_block | |
| size_t | m_total_size |
| the total or logical size (sum of all external child blocks) | |
Protected Attributes inherited from pstsdk::block | |
| bool | m_modified |
| True if this block has been modified and needs to be saved. | |
| size_t | m_size |
| The size of this specific block on disk at last save. | |
| block_id | m_id |
| The id of this block. | |
| ulonglong | m_address |
| The address of this specific block on disk, 0 if unknown. | |
| weak_db_ptr | m_db |
A data block which refers to other data blocks, in order to extend the physical size limit (8k) to a larger logical size.
An extended_block is essentially a list of block_ids of other data_block, which themselves may be an extended_block or an external_block. Ultimately they form a "data tree", the leafs of which form the "logical" contents of the block.
This class is an in memory representation of the disk::extended_block structure.
|
inline |
Construct an extended_block from disk.
| [in] | db | The database context |
| [in] | info | Information about this block |
| [in] | level | The level of this extended block (1 or 2) |
| [in] | total_size | The total logical size of this block |
| [in] | child_max_total_size | The maximum logical size of a child block |
| [in] | page_max_count | The maximum number of external blocks that can be contained in this block |
| [in] | child_page_max_count | The maximum number of external blocks that can be contained in a child block |
| [in] | bi | The block_info for all child blocks |
|
inline |
Get the "level" of this extended_block.
A level 1 extended_block (or "xblock") points to external blocks. A level 2 extended_block (or "xxblock") points to other extended_blocks
|
inlinevirtual |
Get a specific page of this data_block.
| out_of_range | If page_num >= get_page_count() |
| [in] | page_num | The ordinal of the external_block to get, zero based |
Implements pstsdk::data_block.
|
inlinevirtual |
Get the number of physical pages in this data_block.
Implements pstsdk::data_block.
|
inlinevirtual |
Returns the blocks internal/external state.
Implements pstsdk::block.
|
inlinevirtual |
Read data from this block.
| [out] | pdest_buffer | The location to read the data into |
| [in] | size | The amount of data to read |
| [in] | offset | The location to read from |
Implements pstsdk::data_block.