PST File Format SDK v0.4
Loading...
Searching...
No Matches
pstsdk::table_impl Class Referenceabstract

Table implementation. More...

#include <table.h>

+ Inheritance diagram for pstsdk::table_impl:
+ Collaboration diagram for pstsdk::table_impl:

Public Member Functions

virtual ~table_impl ()
 
virtual ulong lookup_row (row_id id) const =0
 Find the offset into the table of the given row_id.
 
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.
 
virtual nodeget_node ()=0
 Get the node backing this table.
 
virtual const nodeget_node () const =0
 Get the node backing this table.
 
virtual ulonglong get_cell_value (ulong row, prop_id id) const =0
 Get the contents of the specified cell in the specified row.
 
virtual std::vector< byteread_cell (ulong row, prop_id id) const =0
 Get the contents of a indirect property in the specified row.
 
virtual hnid_stream_device open_cell_stream (ulong row, prop_id id)=0
 Open a stream over a property in a given row.
 
virtual std::vector< prop_idget_prop_list () const =0
 Get all of the properties on this table.
 
virtual prop_type get_prop_type (prop_id id) const =0
 Get the type of a property.
 
virtual row_id get_row_id (ulong row) const =0
 Get the row id of a specified row.
 
virtual size_t size () const =0
 Get the number of rows in this table.
 
virtual bool prop_exists (ulong row, prop_id id) const =0
 Check to see if a property exists for a given row.
 
virtual size_t row_prop_size (ulong row, prop_id id) const =0
 Return the size of a property for a given row.
 

Detailed Description

Table implementation.

Similar to the node and heap classes, the table class is divided into an implementation class and stack based class. Child objects (in this case, table rows) can reference the implementation class and thus safely outlive the stack based class.

A key difference in the table implementation, however, is that there are actually a few different types of tables. So instead of having one impl class, we have one impl base class to which everyone holds a shared pointer to, and several child classes which we instiate depending on the actual underlying table type. This is the table implementation "interface" class.

See also
[MS-PST] 2.3.4

Definition at line 137 of file table.h.

Constructor & Destructor Documentation

◆ ~table_impl()

virtual pstsdk::table_impl::~table_impl ( )
inlinevirtual

Definition at line 140 of file table.h.

Member Function Documentation

◆ begin()

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

Get an iterator pointing to the first row.

Returns
The requested iterator

Definition at line 154 of file table.h.

◆ end()

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

Get an end iterator for this table.

Returns
The requested iterator

Definition at line 158 of file table.h.

◆ get_cell_value()

virtual ulonglong pstsdk::table_impl::get_cell_value ( ulong  row,
prop_id  id 
) const
pure virtual

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

Implemented in pstsdk::basic_table< T >.

◆ get_node() [1/2]

virtual const node & pstsdk::table_impl::get_node ( ) const
pure virtual

Get the node backing this table.

Returns
The node

Implemented in pstsdk::basic_table< T >.

◆ get_node() [2/2]

virtual node & pstsdk::table_impl::get_node ( )
pure virtual

Get the node backing this table.

Returns
The node

Implemented in pstsdk::basic_table< T >.

◆ get_prop_list()

virtual std::vector< prop_id > pstsdk::table_impl::get_prop_list ( ) const
pure virtual

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

Implemented in pstsdk::basic_table< T >.

◆ get_prop_type()

virtual prop_type pstsdk::table_impl::get_prop_type ( prop_id  id) const
pure virtual

Get the type of a property.

Returns
The property type

Implemented in pstsdk::basic_table< T >.

◆ get_row_id()

virtual row_id pstsdk::table_impl::get_row_id ( ulong  row) const
pure virtual

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

Implemented in pstsdk::basic_table< T >.

◆ lookup_row()

virtual ulong pstsdk::table_impl::lookup_row ( row_id  id) const
pure virtual

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

Implemented in pstsdk::basic_table< T >.

◆ open_cell_stream()

virtual hnid_stream_device pstsdk::table_impl::open_cell_stream ( ulong  row,
prop_id  id 
)
pure virtual

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

Implemented in pstsdk::basic_table< T >.

◆ operator[]()

const_table_row pstsdk::table_impl::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 150 of file table.h.

◆ prop_exists()

virtual bool pstsdk::table_impl::prop_exists ( ulong  row,
prop_id  id 
) const
pure virtual

Check to see if a property exists for a given row.

Parameters
[in]rowThe offset into the table
[in]idThe prop_id
Returns
true if the property exists

Implemented in pstsdk::basic_table< T >.

◆ read_cell()

virtual std::vector< byte > pstsdk::table_impl::read_cell ( ulong  row,
prop_id  id 
) const
pure virtual

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

Implemented in pstsdk::basic_table< T >.

◆ row_prop_size()

virtual size_t pstsdk::table_impl::row_prop_size ( ulong  row,
prop_id  id 
) const
pure virtual

Return the size of a property for a given row.

Note
This operation is only valid for variable length properties
Parameters
[in]rowThe offset into the table
[in]idThe prop_id
Returns
The vector.size() if read_prop were called

Implemented in pstsdk::basic_table< T >.

◆ size()

virtual size_t pstsdk::table_impl::size ( ) const
pure virtual

Get the number of rows in this table.

Returns
The number of rows

Implemented in pstsdk::basic_table< T >.


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