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

The actual table object that clients reference. More...

#include <table.h>

+ Collaboration diagram for pstsdk::table:

Public Member Functions

 table (const node &n)
 Construct a table from this node.
 
 table (const node &n, alias_tag)
 Construct a table from this node.
 
 table (const table &other)
 Copy constructor.
 
 table (const table &other, alias_tag)
 Alias constructor.
 
const_table_row operator[] (ulong row) const
 Get the requested table row.
 
const_table_row_iter begin () const
 Get an iterator pointing to the first row.
 
const_table_row_iter end () const
 Get an end iterator for this table.
 
nodeget_node ()
 Get the node backing this table.
 
const nodeget_node () const
 Get the node backing this table.
 
ulonglong get_cell_value (ulong row, prop_id id) const
 Get the contents of the specified cell in the specified row.
 
std::vector< byteread_cell (ulong row, prop_id id) const
 Get the contents of a indirect property in the specified row.
 
hnid_stream_device open_cell_stream (ulong row, prop_id id)
 Open a stream over a property in a given row.
 
std::vector< prop_idget_prop_list () const
 Get all of the properties on this table.
 
prop_type get_prop_type (prop_id id) const
 Get the type of a property.
 
row_id get_row_id (ulong row) const
 Get the row id of a specified row.
 
ulong lookup_row (row_id id) const
 Find the offset into the table of the given row_id.
 
size_t size () const
 Get the number of rows in this table.
 

Detailed Description

The actual table object that clients reference.

The table object is an in memory representation of the table context (TC). Clients use the open_table(const node&) free function to create table objects.

A table object's job in general is to allow access to the individual row objects, either via operator[] or the iterators. Most property access should go through the row objects. Other member functions allow for row and type lookup.

See also
[MS-PST] 2.3.4

Definition at line 307 of file table.h.

Constructor & Destructor Documentation

◆ table() [1/4]

pstsdk::table::table ( const node n)
inlineexplicit

Construct a table from this node.

Parameters
[in]nThe node to copy and interpret as a table

Definition at line 723 of file table.h.

◆ table() [2/4]

pstsdk::table::table ( const node n,
alias_tag   
)

Construct a table from this node.

Parameters
[in]nThe node to alias and interpret as a table

◆ table() [3/4]

pstsdk::table::table ( const table other)
inline

Copy constructor.

Parameters
[in]otherThe table to copy

Definition at line 728 of file table.h.

◆ table() [4/4]

pstsdk::table::table ( const table other,
alias_tag   
)
inline

Alias constructor.

Parameters
[in]otherThe table to alias

Definition at line 321 of file table.h.

Member Function Documentation

◆ begin()

const_table_row_iter pstsdk::table::begin ( ) const
inline

Get an iterator pointing to the first row.

Returns
The requested iterator

Definition at line 328 of file table.h.

◆ end()

const_table_row_iter pstsdk::table::end ( ) const
inline

Get an end iterator for this table.

Returns
The requested iterator

Definition at line 331 of file table.h.

◆ get_cell_value()

ulonglong pstsdk::table::get_cell_value ( ulong  row,
prop_id  id 
) const
inline

Get the contents of the specified cell in the specified row.

Exceptions
key_not_found<prop_id>If the specified property does not exist on the specified row
out_of_rangeIf the specified row offset is beyond the size of this table
Parameters
[in]rowThe offset into the table
[in]idThe prop_id to find the cell value of
Returns
The cell value

Definition at line 341 of file table.h.

◆ get_node() [1/2]

node & pstsdk::table::get_node ( )
inline

Get the node backing this table.

Returns
The node

Definition at line 335 of file table.h.

◆ get_node() [2/2]

const node & pstsdk::table::get_node ( ) const
inline

Get the node backing this table.

Returns
The node

Definition at line 338 of file table.h.

◆ get_prop_list()

std::vector< prop_id > pstsdk::table::get_prop_list ( ) const
inline

Get all of the properties on this table.

This returns the properties behind all of the columns which make up this table. This doesn't imply that every property is present on every row, however.

Returns
A vector all of the column prop_ids

Definition at line 350 of file table.h.

◆ get_prop_type()

prop_type pstsdk::table::get_prop_type ( prop_id  id) const
inline

Get the type of a property.

Returns
The property type

Definition at line 353 of file table.h.

◆ get_row_id()

row_id pstsdk::table::get_row_id ( ulong  row) const
inline

Get the row id of a specified row.

On disk, the first DWORD is always the row_id.

See also
[MS-PST] 2.3.4.4.1/dwRowID
Returns
The row id

Definition at line 356 of file table.h.

◆ lookup_row()

ulong pstsdk::table::lookup_row ( row_id  id) const
inline

Find the offset into the table of the given row_id.

Exceptions
key_not_found<row_id>If the given row_id is not present in this table
Parameters
[in]idThe row id to lookup
Returns
The offset into the table

Definition at line 359 of file table.h.

◆ open_cell_stream()

hnid_stream_device pstsdk::table::open_cell_stream ( ulong  row,
prop_id  id 
)
inline

Open a stream over a property in a given row.

Exceptions
key_not_found<prop_id>If the specified property does not exist on the specified row
out_of_rangeIf the specified row offset is beyond the size of this table
Note
This operation is only valid for variable length properties
Parameters
[in]rowThe offset into the table
[in]idThe prop_id to find the cell value of
Returns
A device which can be used to construct a stream object

Definition at line 347 of file table.h.

◆ operator[]()

const_table_row pstsdk::table::operator[] ( ulong  row) const
inline

Get the requested table row.

Parameters
[in]rowThe offset into the table to construct a row for
Returns
The requested row

Definition at line 325 of file table.h.

◆ read_cell()

std::vector< byte > pstsdk::table::read_cell ( ulong  row,
prop_id  id 
) const
inline

Get the contents of a indirect property in the specified row.

Exceptions
key_not_found<prop_id>If the specified property does not exist on the specified row
out_of_rangeIf the specified row offset is beyond the size of this table
Parameters
[in]rowThe offset into the table
[in]idThe prop_id to find the cell value of
Returns
The raw bytes of the property

Definition at line 344 of file table.h.

◆ size()

size_t pstsdk::table::size ( ) const
inline

Get the number of rows in this table.

Returns
The number of rows

Definition at line 362 of file table.h.


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