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

Represents a message in a PST file. More...

#include <message.h>

+ Collaboration diagram for pstsdk::message:

Public Types

typedef boost::transform_iterator< attachment_transform, const_table_row_iterattachment_iterator
 Attachment iterator type; a transform iterator over a table row iterator.
 
typedef boost::transform_iterator< recipient_transform, const_table_row_iterrecipient_iterator
 Recipient iterator type; a transform iterator over a table row iterator.
 

Public Member Functions

 message (const node &n)
 Construct a message object.
 
 message (const message &other)
 
 message (message &&other)
 
attachment_iterator attachment_begin () const
 Get an iterator to the first message on this message.
 
attachment_iterator attachment_end () const
 Get the end attachment iterator.
 
recipient_iterator recipient_begin () const
 Get an iterator to the first recipient of this message.
 
recipient_iterator recipient_end () const
 Get the end recipient iterator.
 
std::wstring get_subject () const
 Get the subject of this message.
 
bool has_subject () const
 Check to see if a subject is set on this message.
 
std::wstring get_body () const
 Get the body of this message.
 
hnid_stream_device open_body_stream ()
 Get the body of this message.
 
size_t body_size () const
 Size of the body, in bytes.
 
bool has_body () const
 Checks to see if this message has a body.
 
std::wstring get_html_body () const
 Get the HTML body of this message.
 
hnid_stream_device open_html_body_stream ()
 Get the HTML body of this message.
 
size_t html_body_size () const
 Size of the HTML body, in bytes.
 
bool has_html_body () const
 Checks to see if this message has a HTML body.
 
size_t size () const
 
size_t get_attachment_count () const
 Get the number of attachments on this message.
 
size_t get_recipient_count () const
 Get the number of recipients on this message.
 
property_bagget_property_bag ()
 Get the property bag backing this message.
 
const property_bagget_property_bag () const
 Get the property bag backing this message.
 
tableget_attachment_table ()
 Get the attachment table of this message.
 
tableget_recipient_table ()
 Get the recipient table of this message.
 
const tableget_attachment_table () const
 Get the attachment table of this message.
 
const tableget_recipient_table () const
 Get the recipient table of this message.
 
node_id get_id () const
 Get the node_id of this message.
 

Detailed Description

Represents a message in a PST file.

A message is the basic abstraction exposed by MAPI - everything is a message; a mail item, a calendar item, a contact, etc.

This class exposes some common properties on messages as well as iteration mechanisms to get to the attachments and recipients on the message. You will most likely find it necessary to get the underylying property bag and look up specific properties not exposed here.

Definition at line 228 of file message.h.

Member Typedef Documentation

◆ attachment_iterator

Attachment iterator type; a transform iterator over a table row iterator.

Definition at line 232 of file message.h.

◆ recipient_iterator

Recipient iterator type; a transform iterator over a table row iterator.

Definition at line 234 of file message.h.

Constructor & Destructor Documentation

◆ message() [1/3]

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

Construct a message object.

Parameters
[in]nA message node

Definition at line 238 of file message.h.

◆ message() [2/3]

pstsdk::message::message ( const message other)
inline

Definition at line 422 of file message.h.

◆ message() [3/3]

pstsdk::message::message ( message &&  other)
inline

Definition at line 243 of file message.h.

Member Function Documentation

◆ attachment_begin()

attachment_iterator pstsdk::message::attachment_begin ( ) const
inline

Get an iterator to the first message on this message.

Returns
an iterator positioned on the first attachment on this message

Definition at line 250 of file message.h.

◆ attachment_end()

attachment_iterator pstsdk::message::attachment_end ( ) const
inline

Get the end attachment iterator.

Returns
An iterator at the end position

Definition at line 254 of file message.h.

◆ body_size()

size_t pstsdk::message::body_size ( ) const
inline

Size of the body, in bytes.

Returns
The size of the body

Definition at line 290 of file message.h.

◆ get_attachment_count()

size_t pstsdk::message::get_attachment_count ( ) const
inline

Get the number of attachments on this message.

Returns
The number of attachments

Definition at line 457 of file message.h.

◆ get_attachment_table() [1/2]

pstsdk::table & pstsdk::message::get_attachment_table ( )
inline

Get the attachment table of this message.

Returns
The attachment table

Definition at line 447 of file message.h.

◆ get_attachment_table() [2/2]

const pstsdk::table & pstsdk::message::get_attachment_table ( ) const
inline

Get the attachment table of this message.

Returns
The attachment table

Definition at line 431 of file message.h.

◆ get_body()

std::wstring pstsdk::message::get_body ( ) const
inline

Get the body of this message.

Returns
The message body as a string

Definition at line 275 of file message.h.

◆ get_html_body()

std::wstring pstsdk::message::get_html_body ( ) const
inline

Get the HTML body of this message.

Returns
The HTML message body as a string

Definition at line 298 of file message.h.

◆ get_id()

node_id pstsdk::message::get_id ( ) const
inline

Get the node_id of this message.

Returns
The node_id of the message

Definition at line 362 of file message.h.

◆ get_property_bag() [1/2]

property_bag & pstsdk::message::get_property_bag ( )
inline

Get the property bag backing this message.

Returns
The property bag

Definition at line 344 of file message.h.

◆ get_property_bag() [2/2]

const property_bag & pstsdk::message::get_property_bag ( ) const
inline

Get the property bag backing this message.

Returns
The property bag

Definition at line 347 of file message.h.

◆ get_recipient_count()

size_t pstsdk::message::get_recipient_count ( ) const
inline

Get the number of recipients on this message.

Returns
The number of recipients

Definition at line 469 of file message.h.

◆ get_recipient_table() [1/2]

pstsdk::table & pstsdk::message::get_recipient_table ( )
inline

Get the recipient table of this message.

Returns
The recipient table

Definition at line 452 of file message.h.

◆ get_recipient_table() [2/2]

const pstsdk::table & pstsdk::message::get_recipient_table ( ) const
inline

Get the recipient table of this message.

Returns
The recipient table

Definition at line 439 of file message.h.

◆ get_subject()

std::wstring pstsdk::message::get_subject ( ) const
inline

Get the subject of this message.

Returns
The message subject

Definition at line 481 of file message.h.

◆ has_body()

bool pstsdk::message::has_body ( ) const
inline

Checks to see if this message has a body.

Returns
true if the body prop exists

Definition at line 294 of file message.h.

◆ has_html_body()

bool pstsdk::message::has_html_body ( ) const
inline

Checks to see if this message has a HTML body.

Returns
true if the HTML body property exists

Definition at line 317 of file message.h.

◆ has_subject()

bool pstsdk::message::has_subject ( ) const
inline

Check to see if a subject is set on this message.

Returns
true if a subject is set on this message

Definition at line 271 of file message.h.

◆ html_body_size()

size_t pstsdk::message::html_body_size ( ) const
inline

Size of the HTML body, in bytes.

Returns
The size of the HTML body

Definition at line 313 of file message.h.

◆ open_body_stream()

hnid_stream_device pstsdk::message::open_body_stream ( )
inline

Get the body of this message.

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

message m = ...;
prop_stream body(a.open_body_stream());
Contains references to other bth_node allocations.
Definition heap.h:364
Represents a message in a PST file.
Definition message.h:229
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.

Returns
The message body as a stream

Definition at line 286 of file message.h.

◆ open_html_body_stream()

hnid_stream_device pstsdk::message::open_html_body_stream ( )
inline

Get the HTML body of this message.

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

message m = ...;
prop_stream htmlbody(a.open_html_body_stream());

Which can then be used as any iostream would be.

Returns
The message body as a stream

Definition at line 309 of file message.h.

◆ recipient_begin()

recipient_iterator pstsdk::message::recipient_begin ( ) const
inline

Get an iterator to the first recipient of this message.

Returns
An iterator positioned on the first recipient of this message

Definition at line 258 of file message.h.

◆ recipient_end()

recipient_iterator pstsdk::message::recipient_end ( ) const
inline

Get the end recipient iterator.

Returns
An iterator at the end position

Definition at line 262 of file message.h.

◆ size()

size_t pstsdk::message::size ( ) const
inline
Returns
The message size

Definition at line 321 of file message.h.


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