Fairport  v1.0.38
fairport::empty_table Class Reference

Null table implementation. More...

#include <table.h>

+ Inheritance diagram for fairport::empty_table:
+ Collaboration diagram for fairport::empty_table:

List of all members.

Public Member Functions

nodeget_node ()
 Get the node backing this table.
const nodeget_node () const
 Get the node backing this table.
ulong lookup_row (row_id id) const
 Find the offset into the table of the given row_id.
ulonglong get_cell_value (ulong row, prop_id) const
 Get the contents of the specified cell in the specified row.
std::vector< byteread_cell (ulong row, prop_id) const
 Get the contents of a indirect property in the specified row.
hnid_stream_device open_cell_stream (ulong row, prop_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.
size_t size () const
 Get the number of rows in this table.
bool prop_exists (ulong row, prop_id) const
 Check to see if a property exists for a given row.
size_t row_prop_size (ulong row, prop_id) const
 Return the size of a property for a given row.

Detailed Description

Null table implementation.

As an optimization some parts of the PST delay create tables. A message, for example, might not actually have an attachment table subnode unless it actually contains an attachment. Implementations need to be aware of this and handle it, by representing the non-existant table as a table with zero rows so clients can treat table iteration uniformly.

This object is how Fairport represents such non-existant tables. It's a fake table whose only purpose is to have zero rows, with .begin() == .end(). Doing pretty much anything with the table will result in some sort of exception being thrown.

Definition at line 233 of file table.h.


Member Function Documentation

ulonglong fairport::empty_table::get_cell_value ( ulong  row,
prop_id  id 
) const [inline, 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

Implements fairport::table_impl.

Definition at line 242 of file table.h.

node& fairport::empty_table::get_node ( ) [inline, virtual]

Get the node backing this table.

Returns:
The node

Implements fairport::table_impl.

Definition at line 236 of file table.h.

const node& fairport::empty_table::get_node ( ) const [inline, virtual]

Get the node backing this table.

Returns:
The node

Implements fairport::table_impl.

Definition at line 238 of file table.h.

std::vector<prop_id> fairport::empty_table::get_prop_list ( ) const [inline, 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

Implements fairport::table_impl.

Definition at line 248 of file table.h.

prop_type fairport::empty_table::get_prop_type ( prop_id  id) const [inline, virtual]

Get the type of a property.

Returns:
The property type

Implements fairport::table_impl.

Definition at line 250 of file table.h.

row_id fairport::empty_table::get_row_id ( ulong  row) const [inline, 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

Implements fairport::table_impl.

Definition at line 252 of file table.h.

ulong fairport::empty_table::lookup_row ( row_id  id) const [inline, 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

Implements fairport::table_impl.

Definition at line 240 of file table.h.

hnid_stream_device fairport::empty_table::open_cell_stream ( ulong  row,
prop_id  id 
) [inline, 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

Implements fairport::table_impl.

Definition at line 246 of file table.h.

bool fairport::empty_table::prop_exists ( ulong  row,
prop_id  id 
) const [inline, 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

Implements fairport::table_impl.

Definition at line 256 of file table.h.

std::vector<byte> fairport::empty_table::read_cell ( ulong  row,
prop_id  id 
) const [inline, 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

Implements fairport::table_impl.

Definition at line 244 of file table.h.

size_t fairport::empty_table::row_prop_size ( ulong  row,
prop_id  id 
) const [inline, 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

Implements fairport::table_impl.

Definition at line 258 of file table.h.

size_t fairport::empty_table::size ( ) const [inline, virtual]

Get the number of rows in this table.

Returns:
The number of rows

Implements fairport::table_impl.

Definition at line 254 of file table.h.


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