|
PST File Format SDK v0.4
|
Property object base class. More...
#include <object.h>
Inheritance diagram for pstsdk::const_property_object:
Collaboration diagram for pstsdk::const_property_object:Public Member Functions | |
| virtual | ~const_property_object () |
| virtual std::vector< prop_id > | get_prop_list () const =0 |
| Get a list of all properties on this object. | |
| virtual prop_type | get_prop_type (prop_id id) const =0 |
| Get the property type of a given prop_id. | |
| virtual bool | prop_exists (prop_id id) const =0 |
| Indicates the existance of a given property on this object. | |
| virtual size_t | size (prop_id id) const =0 |
| Returns the total size of a variable length property. | |
| template<typename T > | |
| 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. | |
| virtual hnid_stream_device | open_prop_stream (prop_id id)=0 |
| Creates a stream device over a property on this object. | |
| 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_t > | read_prop_array (prop_id id) const |
Protected Member Functions | |
| virtual byte | get_value_1 (prop_id id) const =0 |
| Implemented by child classes to fetch a 1 byte sized property. | |
| virtual ushort | get_value_2 (prop_id id) const =0 |
| Implemented by child classes to fetch a 2 byte sized property. | |
| virtual ulong | get_value_4 (prop_id id) const =0 |
| Implemented by child classes to fetch a 4 byte sized property. | |
| virtual ulonglong | get_value_8 (prop_id id) const =0 |
| Implemented by child classes to fetch a 8 byte sized property. | |
| virtual std::vector< byte > | get_value_variable (prop_id id) const =0 |
| Implemented by child classes to fetch a variable sized property. | |
Property object base class.
This class provides a simple interface (using templates) to access properties on an object. It defines a handful of virtual functions child classes implement to read the raw data.
This class is contains all the conversion logic between the different types, implemented as template specializations, and other property logic such as multivalued property parsing.
|
inlinevirtual |
Get a list of all properties on this object.
Implemented in pstsdk::property_bag, and pstsdk::const_table_row.
Get the property type of a given prop_id.
| [in] | id | The prop_id |
| key_not_found<prop_id> | If the specified property is not present |
Implemented in pstsdk::property_bag, and pstsdk::const_table_row.
Implemented by child classes to fetch a 1 byte sized property.
Implemented by child classes to fetch a 2 byte sized property.
Implemented by child classes to fetch a 4 byte sized property.
|
protectedpure virtual |
Implemented by child classes to fetch a 8 byte sized property.
|
protectedpure virtual |
Implemented by child classes to fetch a variable sized property.
Implemented in pstsdk::property_bag.
|
pure virtual |
Creates a stream device over a property on this object.
The returned stream device can be used to construct a proper stream:
Which can then be used as any iostream would be.
| [in] | id | The prop_id |
| key_not_found<prop_id> | If the specified property is not present |
Implemented in pstsdk::property_bag, and pstsdk::const_table_row.
Indicates the existance of a given property on this object.
| [in] | id | The prop_id |
Implemented in pstsdk::property_bag, and pstsdk::const_table_row.
Read a property as a given type.
It is the callers responsibility to ensure the prop_id is of or convertable to the requested type.
| T | The type to interpret he property as |
| [in] | id | The prop_id |
| key_not_found<prop_id> | If the specified property is not present |
|
inline |
|
inline |
Read a property as an array of the given type.
It is the callers responsibility to ensure the prop_id is of or convertable to the requested type.
| T | The type to interpret he property as |
| [in] | id | The prop_id |
| key_not_found<prop_id> | If the specified property is not present |
|
inline |
| std::optional< T > pstsdk::const_property_object::read_prop_if_exists | ( | prop_id | id | ) | const |
Read a property as a given type, if it exists.
It is the callers responsibility to ensure the prop_id is of or convertable to the requested type.
| T | The type to interpret he property as |
| [in] | id | The prop_id |
| key_not_found<prop_id> | If the specified property is not present |
Returns the total size of a variable length property.
| [in] | id | The prop_id |
Implemented in pstsdk::property_bag, and pstsdk::const_table_row.