PST File Format SDK v0.4
Loading...
Searching...
No Matches
pstsdk::external_block Class Reference

Contains actual data. More...

#include <node.h>

+ Inheritance diagram for pstsdk::external_block:
+ Collaboration diagram for pstsdk::external_block:

Public Member Functions

 external_block (const shared_db_ptr &db, const block_info &info, size_t max_size, std::vector< byte > buffer)
 Construct an external_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_blockget_page (uint page_num) const
 Get a specific page of this data_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 >
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
 

Detailed Description

Contains actual data.

An external_block contains the actual data contents used by the higher layers. This data is also "encrypted", although the encryption/decryption process occurs immediately before/after going to disk, not here.

See also
[MS-PST] 2.2.2.8.3.1

Definition at line 705 of file node.h.

Constructor & Destructor Documentation

◆ external_block()

pstsdk::external_block::external_block ( const shared_db_ptr db,
const block_info info,
size_t  max_size,
std::vector< byte buffer 
)
inline

Construct an external_block from disk.

Parameters
[in]dbThe database context
[in]infoInformation about this block
[in]max_sizeThe maximum possible size of this block
[in]bufferThe actual external data (decoded)

Definition at line 716 of file node.h.

Member Function Documentation

◆ get_page()

std::shared_ptr< pstsdk::external_block > pstsdk::external_block::get_page ( uint  page_num) const
inlinevirtual

Get a specific page of this data_block.

Note
In this context, "page" refers to an external_block
Exceptions
out_of_rangeIf page_num >= get_page_count()
Parameters
[in]page_numThe ordinal of the external_block to get, zero based
Returns
The requested external_block

Implements pstsdk::data_block.

Definition at line 1169 of file node.h.

◆ get_page_count()

uint pstsdk::external_block::get_page_count ( ) const
inlinevirtual

Get the number of physical pages in this data_block.

Note
In this context, "page" refers to an external_block
Returns
The total number of external_blocks under this data_block

Implements pstsdk::data_block.

Definition at line 735 of file node.h.

◆ is_internal()

bool pstsdk::external_block::is_internal ( ) const
inlinevirtual

Returns the blocks internal/external state.

Returns
true if this is an internal block, false otherwise

Implements pstsdk::block.

Definition at line 742 of file node.h.

◆ read_raw()

size_t pstsdk::external_block::read_raw ( byte pdest_buffer,
size_t  size,
ulong  offset 
) const
inlinevirtual

Read data from this block.

Parameters
[out]pdest_bufferThe location to read the data into
[in]sizeThe amount of data to read
[in]offsetThe location to read from
Returns
The amount of data read

Implements pstsdk::data_block.

Definition at line 1177 of file node.h.


The documentation for this class was generated from the following file: