MAPIC++ClientLibraryBindings 2.0 API Documentation

- Main Page
- Related Pages
- Namespaces
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
libmapipp::attachment Class Reference

This class represents a message attachment. More...

`#include <attachment.h>`

Inheritance diagram for libmapipp::attachment:

## Public Member Functions
| attachment (message &mapi_message, const uint32_t attach_num) throw (mapi_exception)
| Constructor.
const uint8_t * | get_data () const
| the contents of the attachment
uint32_t | get_data_size () const
| the size of the attachment
std::string | get_filename () const
| the filename of the attachment
uint32_t | get_num () const
| The attachment number.
virtual | ~attachment () throw ()
| Destructor.
Public Member Functions inherited from libmapipp::object
virtual mapi_object_t & | data () throw ()
| Obtain a reference to the mapi_object_t associated with this object.
virtual property_container | get_property_container ()
| Obtain a property_container to be used with this object.
virtual session & | get_session ()
| Obtain the session associated with this object.
| object (session &mapi_session, const std::string &object_type="") throw ()
| Object Constructor.
virtual | ~object () throw ()
| Destructor.

## Detailed Description

This class represents a message attachment.

A message can contain both text content, and also have attached (embedded) files and messages. This class represents the attachments for one messaage.

You may not need to create the attachments yourself, since you can create a container with all the attachments using message::fetch_attachments().

## Constructor & Destructor Documentation

libmapipp::attachment::attachment | ( | message & | mapi_message,
|  | const uint32_t | attach_num
| ) |  | throw (mapi_exception)

Constructor.

Parameters

  mapi_message | the message that this attachment belongs to.
  attach_num | Attachment Number.

## Member Function Documentation

const uint8_t* libmapipp::attachment::get_data | ( |  | ) | const
| inline

the contents of the attachment

Note
  the length of the array is given by get_data_size()

uint32_t libmapipp::attachment::get_data_size | ( |  | ) | const
| inline

the size of the attachment

Returns
  the size of the attachment in bytes

std::string libmapipp::attachment::get_filename | ( |  | ) | const
| inline

the filename of the attachment

Note
  not all attachments have file names

Returns
  string containing the file name of the attachment, if any

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

- libmapi++/attachment.h

| This content is licensed under the Creative Commons Attribution ShareAlike License v. 3.0: http://creativecommons.org/licenses/by-sa/3.0/