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

Property Context (PC) Implementation. More...

#include <propbag.h>

+ Inheritance diagram for pstsdk::property_bag:
+ Collaboration diagram for pstsdk::property_bag:

Public Member Functions

 property_bag (const node &n)
 Construct a property_bag from this node.
 
 property_bag (const node &n, alias_tag)
 Construct a property_bag from this node.
 
 property_bag (const heap &h)
 Construct a property_bag from this heap.
 
 property_bag (const heap &h, alias_tag)
 Construct a property_bag from this heap.
 
 property_bag (const property_bag &other)
 Copy construct a property_bag.
 
 property_bag (const property_bag &other, alias_tag)
 Alias a property_bag.
 
 property_bag (property_bag &&other)
 Move construct a property_bag.
 
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.
 
const nodeget_node () const
 Get the node underlying this property_bag.
 
nodeget_node ()
 Get the node underlying this property_bag.
 
std::vector< byteget_value_variable (prop_id id) const
 Implemented by child classes to fetch a variable sized property.
 
- 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

Property Context (PC) Implementation.

A Property Context is simply a BTH where the BTH is stored as the client root allocation in the heap. The BTH contains a "prop_entry", which is defines the type of the property and it's storage.

const_property_object does most of the heavy lifting in terms of property access and interpretation.

See also
[MS-PST] 2.3.3

Definition at line 40 of file propbag.h.

Constructor & Destructor Documentation

◆ property_bag() [1/7]

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

Construct a property_bag from this node.

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

Definition at line 101 of file propbag.h.

◆ property_bag() [2/7]

pstsdk::property_bag::property_bag ( const node n,
alias_tag   
)
inline

Construct a property_bag from this node.

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

Definition at line 108 of file propbag.h.

◆ property_bag() [3/7]

pstsdk::property_bag::property_bag ( const heap h)
inlineexplicit

Construct a property_bag from this heap.

Parameters
[in]hThe heap to copy and interpret as a property_bag

Definition at line 115 of file propbag.h.

◆ property_bag() [4/7]

pstsdk::property_bag::property_bag ( const heap h,
alias_tag   
)
inline

Construct a property_bag from this heap.

Parameters
[in]hThe heap to alias and interpret as a property_bag

Definition at line 127 of file propbag.h.

◆ property_bag() [5/7]

pstsdk::property_bag::property_bag ( const property_bag other)
inline

Copy construct a property_bag.

Parameters
otherThe property bag to copy

Definition at line 139 of file propbag.h.

◆ property_bag() [6/7]

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

Alias a property_bag.

Parameters
otherThe property bag to alias

Definition at line 146 of file propbag.h.

◆ property_bag() [7/7]

pstsdk::property_bag::property_bag ( property_bag &&  other)
inline

Move construct a property_bag.

Parameters
otherThe property bag to move from

Definition at line 65 of file propbag.h.

Member Function Documentation

◆ get_node() [1/2]

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

Get the node underlying this property_bag.

Returns
The node

Definition at line 80 of file propbag.h.

◆ get_node() [2/2]

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

Get the node underlying this property_bag.

Returns
The node

Definition at line 77 of file propbag.h.

◆ get_prop_list()

std::vector< pstsdk::prop_id > pstsdk::property_bag::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 153 of file propbag.h.

◆ get_prop_type()

prop_type pstsdk::property_bag::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 69 of file propbag.h.

◆ get_value_variable()

std::vector< pstsdk::byte > pstsdk::property_bag::get_value_variable ( prop_id  id) const
inlinevirtual

Implemented by child classes to fetch a variable sized property.

Implements pstsdk::const_property_object.

Definition at line 203 of file propbag.h.

◆ open_prop_stream()

pstsdk::hnid_stream_device pstsdk::property_bag::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 233 of file propbag.h.

◆ prop_exists()

bool pstsdk::property_bag::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 181 of file propbag.h.

◆ size()

size_t pstsdk::property_bag::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 223 of file propbag.h.


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