|
PST File Format SDK v0.4
|
An in memory representation of the "node" concept in a PST data file. More...
#include <node.h>
Collaboration diagram for pstsdk::node:Public Types | |
| typedef boost::transform_iterator< subnode_transform_info, const_subnodeinfo_iterator > | subnode_iterator |
| A transform iterator, so we can expose the subnodes as a collection of nodes rather than subnode_info objects. | |
Public Member Functions | |
| node (const shared_db_ptr &db, const node_info &info) | |
| Constructor for top level nodes. | |
| node (const node &container_node, const subnode_info &info) | |
| Constructor for subnodes. | |
| node (const std::shared_ptr< node_impl > &container_node, const subnode_info &info) | |
| Constructor for subnodes. | |
| node (const node &other) | |
| Copy construct this node. | |
| node (const node &other, alias_tag) | |
| Alias constructor. | |
| node (node &&other) | |
| Move constructor. | |
| node & | operator= (const node &other) |
| Set one node equal to another. | |
| node_id | get_id () const |
| Get the id of this node. | |
| block_id | get_data_id () const |
| Get the block_id of the data block of this node. | |
| block_id | get_sub_id () const |
| Get the block_id of the subnode block of this node. | |
| node_id | get_parent_id () const |
| Get the parent id. | |
| bool | is_subnode () |
| Tells you if this is a subnode. | |
| std::shared_ptr< data_block > | get_data_block () const |
| Returns the data block associated with this node. | |
| std::shared_ptr< subnode_block > | get_subnode_block () const |
| Returns the subnode block associated with this node. | |
| size_t | read (std::vector< byte > &buffer, ulong offset) const |
| Read data from this node. | |
| template<typename T > | |
| T | read (ulong offset) const |
| Read data from this node. | |
| size_t | read (std::vector< byte > &buffer, uint page_num, ulong offset) const |
| Read data from this node. | |
| template<typename T > | |
| T | read (uint page_num, ulong offset) const |
| Read data from a specific block on this node. | |
| node_stream_device | open_as_stream () |
| Creates a stream device over this node. | |
| size_t | size () const |
| Returns the size of this node. | |
| size_t | get_page_size (uint page_num) const |
| Returns the size of a page in this node. | |
| uint | get_page_count () const |
| Returns the number of pages in this node. | |
| const_subnodeinfo_iterator | subnode_info_begin () const |
| Returns an iterator positioned at first subnodeinfo. | |
| const_subnodeinfo_iterator | subnode_info_end () const |
| Returns an iterator positioned past the last subnodeinfo. | |
| subnode_iterator | subnode_begin () const |
| Returns a proxy iterator for the first subnode. | |
| subnode_iterator | subnode_end () const |
| Returns a proxy iterator positioned past the last subnode. | |
| node | lookup (node_id id) const |
| Lookup a subnode by node id. | |
An in memory representation of the "node" concept in a PST data file.
A node is the primary abstraction exposed by the NDB Layer to the upper layers. It's purpose is to abstract away the details of working with immutable blocks and subnode blocks. It can therefor be thought of simply as a mutable stream of bytes and a collection of sub nodes, themselves a mutable stream of bytes potentially with another collection of subnodes, etc.
When using the node class, think of it as creating an in memory "instance" of the node on the disk. You can have several in memory instances of the same node on disk. You can even have an alias of another in memory instance, as is sometimes required when creating higher level abstractions.
There isn't much interesting to do with a node, you can query its size, read from a specific location, get it's id and parent id, iterate over subnodes, etc. Most of the interesting things are done by higher level abstractions which are built on top of and know specifically how to interpret the bytes in a node - such as the heap, table, and property_bag.
| typedef boost::transform_iterator<subnode_transform_info, const_subnodeinfo_iterator> pstsdk::node::subnode_iterator |
A transform iterator, so we can expose the subnodes as a collection of nodes rather than subnode_info objects.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Creates a stream device over this node.
The returned stream device can be used to construct a proper stream:
Which can then be used as any iostream would be.
Set one node equal to another.
The assignment semantics of a node cause the assigned to node to refer to the same data on disk as the assigned from node. It still has it's own unique id, parent, etc - only the data contained in this node is 'assigned'
| [in] | other | The node to assign from |
|
inline |
Read data from this node.
Fills the specified buffer with data on the specified page at the specified offset. The size of teh buffer indicates how much data to read.
| [in,out] | buffer | The buffer to fill |
| [in] | page_num | The page to read from |
| [in] | offset | The location to read from |
Read data from this node.
Fills the specified buffer with data starting at the specified offset. The size of the buffer indicates how much data to read.
| [in,out] | buffer | The buffer to fill |
| [in] | offset | The location to read from |
Read data from a specific block on this node.
| T | The type to read |
| [in] | page_num | The block (ordinal) to read data from |
| [in] | offset | The offset into that block to read from |
|
inline |
|
inline |
Returns a proxy iterator for the first subnode.
This is known as a proxy iterator because the dereferenced type is of type node, not node& or const node&. This means the object is an rvalue, constructed specifically for the purpose of being returned from this iterator.
|
inline |
Returns a proxy iterator positioned past the last subnode.
This is known as a proxy iterator because the dereferenced type is of type node, not node& or const node&. This means the object is an rvalue, constructed specifically for the purpose of being returned from this iterator.
|
inline |
|
inline |