Fairport
v1.0.38
|
Implementation of an ANSI TC (64k rows) and a unicode TC. More...
#include <table.h>
Public Member Functions | |
node & | get_node () |
Get the node backing this table. | |
const node & | get_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 id) const |
Get the contents of the specified cell in the specified row. | |
std::vector< byte > | read_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_id > | get_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 id) const |
Check to see if a property exists for a given row. | |
size_t | row_prop_size (ulong row, prop_id id) const |
Return the size of a property for a given row. | |
Friends | |
table_ptr | open_table (const node &n) |
Open the specified node as a table. |
Implementation of an ANSI TC (64k rows) and a unicode TC.
ANSI and Unicode TCs differ in the "row index" BTH. On an ANSI PST the type type is 2 bytes and in Unicode PSTs the value type is 4 bytes. Since the value type is the row offset for a given row_id, that implies a 64k row limit for TCs in ANSI stores.
Note that the information about the key/value size is stored in the BTH header. We use that to determine what type of table this is, rather than trying to figure out if we're opened over an ANSI or Unicode PST (which has been abstracted away from us at this point).
T | The size of the value type in the row index BTH - ushort for an ANSI table, ulong for a Unicode table |
fairport::ulonglong fairport::basic_table< T >::get_cell_value | ( | ulong | row, |
prop_id | id | ||
) | const [inline, virtual] |
Get the contents of the specified cell in the specified row.
key_not_found<prop_id> | If the specified property does not exist on the specified row |
out_of_range | If the specified row offset is beyond the size of this table |
[in] | row | The offset into the table |
[in] | id | The prop_id to find the cell value of |
Implements fairport::table_impl.
node& fairport::basic_table< T >::get_node | ( | ) | [inline, virtual] |
const node& fairport::basic_table< T >::get_node | ( | ) | const [inline, virtual] |
std::vector< fairport::prop_id > fairport::basic_table< T >::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.
Implements fairport::table_impl.
fairport::prop_type fairport::basic_table< T >::get_prop_type | ( | prop_id | id | ) | const [inline, virtual] |
fairport::row_id fairport::basic_table< T >::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.
Implements fairport::table_impl.
fairport::ulong fairport::basic_table< T >::lookup_row | ( | row_id | id | ) | const [inline, virtual] |
Find the offset into the table of the given row_id.
key_not_found<row_id> | If the given row_id is not present in this table |
[in] | id | The row id to lookup |
Implements fairport::table_impl.
fairport::hnid_stream_device fairport::basic_table< T >::open_cell_stream | ( | ulong | row, |
prop_id | id | ||
) | [inline, virtual] |
Open a stream over a property in a given row.
key_not_found<prop_id> | If the specified property does not exist on the specified row |
out_of_range | If the specified row offset is beyond the size of this table |
[in] | row | The offset into the table |
[in] | id | The prop_id to find the cell value of |
Implements fairport::table_impl.
bool fairport::basic_table< T >::prop_exists | ( | ulong | row, |
prop_id | id | ||
) | const [inline, virtual] |
Check to see if a property exists for a given row.
[in] | row | The offset into the table |
[in] | id | The prop_id |
Implements fairport::table_impl.
std::vector< fairport::byte > fairport::basic_table< T >::read_cell | ( | ulong | row, |
prop_id | id | ||
) | const [inline, virtual] |
Get the contents of a indirect property in the specified row.
key_not_found<prop_id> | If the specified property does not exist on the specified row |
out_of_range | If the specified row offset is beyond the size of this table |
[in] | row | The offset into the table |
[in] | id | The prop_id to find the cell value of |
Implements fairport::table_impl.
size_t fairport::basic_table< T >::row_prop_size | ( | ulong | row, |
prop_id | id | ||
) | const [inline, virtual] |
Return the size of a property for a given row.
[in] | row | The offset into the table |
[in] | id | The prop_id |
Implements fairport::table_impl.
size_t fairport::basic_table< T >::size | ( | ) | const [inline, virtual] |
Open the specified node as a table.
[in] | n | The node to copy and interpret as a TC |