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

An abstraction of a table row. More...

#include <table.h>

+ Inheritance diagram for pstsdk::const_table_row:
+ Collaboration diagram for pstsdk::const_table_row:

Public Member Functions

 const_table_row (const const_table_row &other)
 Copy construct this row.
 
 const_table_row (ulong position, const const_table_ptr &table)
 Construct a const_table_row object from a table and row offset.
 
row_id get_row_id () const
 Get the row_id of this row.
 
std::vector< prop_idget_prop_list () const
 Get a list of all properties on this object.
 
prop_type get_prop_type (prop_id id) const
 Get the property type of a given prop_id.
 
bool prop_exists (prop_id id) const
 Indicates the existance of a given property on this object.
 
size_t size (prop_id id) const
 Returns the total size of a variable length property.
 
hnid_stream_device open_prop_stream (prop_id id)
 Creates a stream device over a property on this object.
 
- Public Member Functions inherited from pstsdk::const_property_object
virtual ~const_property_object ()
 
template<typename T >
read_prop (prop_id id) const
 Read a property as a given type.
 
template<typename T >
std::optional< T > read_prop_if_exists (prop_id id) const
 Read a property as a given type, if it exists.
 
template<typename T >
std::vector< T > read_prop_array (prop_id id) const
 Read a property as an array of the given type.
 
template<>
bool read_prop (prop_id id) const
 
template<>
std::vector< bool > read_prop_array (prop_id id) const
 
template<>
time_t read_prop (prop_id id) const
 
template<>
std::vector< time_tread_prop_array (prop_id id) const
 

Additional Inherited Members

Detailed Description

An abstraction of a table row.

A const_table_row represents a single row in a table. It models a const_property_object, allowing access to the properties stored in the row.

This object is basically a thin wrapper around the table proper, it holds a reference to the table as well as the index of the row it represents, and fowards most requests to the table.

Definition at line 50 of file table.h.

Constructor & Destructor Documentation

◆ const_table_row() [1/2]

pstsdk::const_table_row::const_table_row ( const const_table_row other)
inline

Copy construct this row.

Parameters
[in]otherThe row to copy from

Definition at line 55 of file table.h.

◆ const_table_row() [2/2]

pstsdk::const_table_row::const_table_row ( ulong  position,
const const_table_ptr table 
)
inline

Construct a const_table_row object from a table and row offset.

Parameters
[in]positionThe offset into the table to represent
[in]tableThe table to reference

Definition at line 60 of file table.h.

Member Function Documentation

◆ get_prop_list()

std::vector< pstsdk::prop_id > pstsdk::const_table_row::get_prop_list ( ) const
inlinevirtual

Get a list of all properties on this object.

Returns
A vector of all properties on this object

Implements pstsdk::const_property_object.

Definition at line 414 of file table.h.

◆ get_prop_type()

pstsdk::prop_type pstsdk::const_table_row::get_prop_type ( prop_id  id) const
inlinevirtual

Get the property type of a given prop_id.

Parameters
[in]idThe prop_id
Exceptions
key_not_found<prop_id>If the specified property is not present
Returns
The type of the prop_id

Implements pstsdk::const_property_object.

Definition at line 433 of file table.h.

◆ get_row_id()

pstsdk::row_id pstsdk::const_table_row::get_row_id ( ) const
inline

Get the row_id of this row.

Returns
The row_id of this row

Definition at line 443 of file table.h.

◆ open_prop_stream()

pstsdk::hnid_stream_device pstsdk::const_table_row::open_prop_stream ( prop_id  id)
inlinevirtual

Creates a stream device over a property on this object.

The returned stream device can be used to construct a proper stream:

prop_stream nstream(po->open_prop_stream(0x3001));
Contains references to other bth_node allocations.
Definition heap.h:364
Property object base class.
Definition object.h:94
boost::iostreams::stream< hnid_stream_device > prop_stream
The actual property stream, defined using the boost iostream library and the hnid_stream_device.
Definition object.h:81

Which can then be used as any iostream would be.

Note
This is operation is only valid for variable length properties
Parameters
[in]idThe prop_id
Exceptions
key_not_found<prop_id>If the specified property is not present
Returns
A stream device for the requested property

Implements pstsdk::const_property_object.

Definition at line 473 of file table.h.

◆ prop_exists()

bool pstsdk::const_table_row::prop_exists ( prop_id  id) const
inlinevirtual

Indicates the existance of a given property on this object.

Parameters
[in]idThe prop_id
Returns
true if the property exists

Implements pstsdk::const_property_object.

Definition at line 438 of file table.h.

◆ size()

size_t pstsdk::const_table_row::size ( prop_id  id) const
inlinevirtual

Returns the total size of a variable length property.

Note
This operation is only valid for variable length properties
Parameters
[in]idThe prop_id
Returns
The vector.size() if read_prop was called for this prop

Implements pstsdk::const_property_object.

Definition at line 428 of file table.h.


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