Represents Personal Storage Table (.pst) file. More...

Inherits IDisposable.

Public Member Functions

ASPOSE_EMAIL_SHARED_API System::SharedPtr< FolderInfo > get_RootFolder () const
 Gets the root folder of PST. More...
 
ASPOSE_EMAIL_SHARED_API System::SharedPtr< MessageStoreget_Store () const
 Gets the PST message store. More...
 
ASPOSE_EMAIL_SHARED_API FileFormat get_Format ()
 Gets the file format. More...
 
ASPOSE_EMAIL_SHARED_API bool get_CanWrite ()
 Gets a value indicating whether the current pst supports writing. More...
 
ASPOSE_EMAIL_SHARED_API bool get_IsUnicode ()
 Gets a value indicating whether the PST file format is Unicode. There are two versions of the PST file format: Unicode and ANSI. More...
 
ASPOSE_EMAIL_SHARED_API void SaveAs (System::String fileName, FileFormat format)
 Saves the current object to a specified file format in a different file. More...
 
ASPOSE_EMAIL_SHARED_API void ConvertTo (FileFormat format)
 Converts the current object to the specified format. More...
 
ASPOSE_EMAIL_SHARED_API System::SharedPtr< Aspose::Email::Mapi::MapiPropertyExtractProperty (System::ArrayPtr< uint8_t > entryId, int64_t tag)
 Gets the specified property of item, without extract the item fully. More...
 
ASPOSE_EMAIL_SHARED_API System::SharedPtr< Aspose::Email::Mapi::MapiMessage > ExtractMessage (System::SharedPtr< MessageInfo > messageInfo)
 Get the message from PST. More...
 
ASPOSE_EMAIL_SHARED_API System::SharedPtr< Aspose::Email::Mapi::MapiMessage > ExtractMessage (System::ArrayPtr< uint8_t > entryId)
 Get the message from PST. More...
 
ASPOSE_EMAIL_SHARED_API System::SharedPtr< Aspose::Email::Mapi::MapiMessage > ExtractMessage (System::String entryId)
 Get the message from PST. More...
 
ASPOSE_EMAIL_SHARED_API void SaveMessageToStream (System::String entryId, System::SharedPtr< System::IO::Stream > stream)
 Saves the message, with specified entryID, to a stream. More...
 
ASPOSE_EMAIL_SHARED_API System::SharedPtr< Aspose::Email::Mapi::MapiAttachmentCollectionExtractAttachments (System::SharedPtr< MessageInfo > messageInfo)
 Extracts the attachments. More...
 
ASPOSE_EMAIL_SHARED_API System::SharedPtr< Aspose::Email::Mapi::MapiAttachmentCollectionExtractAttachments (System::String entryId)
 Extracts the attachments. More...
 
ASPOSE_EMAIL_SHARED_API System::SharedPtr< FolderInfo > GetFolderById (System::ArrayPtr< uint8_t > entryId)
 Gets the personal folder from PST. More...
 
ASPOSE_EMAIL_SHARED_API System::SharedPtr< FolderInfo > GetFolderById (System::String entryIdString)
 Gets the personal folder from PST. More...
 
ASPOSE_EMAIL_SHARED_API System::SharedPtr< FolderInfo > GetParentFolder (System::String entryIdString)
 Gets the parent folder of message. More...
 
ASPOSE_EMAIL_SHARED_API System::SharedPtr< FolderInfo > GetParentFolder (System::ArrayPtr< uint8_t > entryId)
 Gets the parent folder of message. More...
 
ASPOSE_EMAIL_SHARED_API System::SharedPtr< FolderInfo > GetPredefinedFolder (StandardIpmFolder defaultFolder)
 Gets the standard interpersonal message (IPM) folder from PST. Outlook can create a number of default folders, such as Outbox, Deleted Items, Sent Items etc. More...
 
ASPOSE_EMAIL_SHARED_API System::SharedPtr< FolderInfo > CreatePredefinedFolder (System::String name, StandardIpmFolder defaultFolder, bool createHierarchy)
 Creates the standard interpersonal message (IPM) folder. More...
 
ASPOSE_EMAIL_SHARED_API System::SharedPtr< FolderInfo > CreatePredefinedFolder (System::String name, StandardIpmFolder defaultFolder)
 Creates the standard interpersonal message (IPM) folder. More...
 
ASPOSE_EMAIL_SHARED_API void MoveItem (System::SharedPtr< MessageInfo > message, System::SharedPtr< FolderInfo > newFolder)
 Moves a specified message to a new folder within the current pst. More...
 
ASPOSE_EMAIL_SHARED_API void MoveItem (System::SharedPtr< FolderInfo > folder, System::SharedPtr< FolderInfo > newFolder)
 Moves a specified folder to a new parent folder within the current pst. More...
 
ASPOSE_EMAIL_SHARED_API void MergeWith (System::ArrayPtr< System::String > sourceFileNames)
 Merges the pst storage with one or more other pst files. Thus, the combined files are sources. More...
 
ASPOSE_EMAIL_SHARED_API void SplitInto (int64_t chunkSize, System::String path)
 Splits the pst storage into less sized parts. More...
 
ASPOSE_EMAIL_SHARED_API void SplitInto (System::SharedPtr< System::Collections::Generic::IList< System::SharedPtr< Aspose::Email::Tools::Search::MailQuery >>> criteria, System::String path)
 Splits the pst storage based on criteria. More...
 
ASPOSE_EMAIL_SHARED_API void ChangeMessage (System::String entryId, System::SharedPtr< Aspose::Email::Mapi::MapiPropertyCollection > updatedProperties)
 Changes the message properties. More...
 
ASPOSE_EMAIL_SHARED_API System::SharedPtr< PersonalStorageCloneFolderStructure (System::String fileName)
 Clones the folder structure. More...
 
ASPOSE_EMAIL_SHARED_API void Dispose ()
 Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. More...
 

Static Public Member Functions

static ASPOSE_EMAIL_SHARED_API System::SharedPtr< PersonalStorageFromFile (System::String fileName)
 Load PST from file. More...
 
static ASPOSE_EMAIL_SHARED_API System::SharedPtr< PersonalStorageFromFile (System::String fileName, bool writable)
 Load PST from file. More...
 
static ASPOSE_EMAIL_SHARED_API System::SharedPtr< PersonalStorageFromStream (System::SharedPtr< System::IO::Stream > stream, bool writable)
 Load PST from stream. More...
 
static ASPOSE_EMAIL_SHARED_API System::SharedPtr< PersonalStorageFromStream (System::SharedPtr< System::IO::Stream > stream)
 Load PST from stream. More...
 
static ASPOSE_EMAIL_SHARED_API System::SharedPtr< PersonalStorageCreate (System::String fileName, FileFormatVersion version)
 Creates the new PST file with the specified file name. More...
 
static ASPOSE_EMAIL_SHARED_API System::SharedPtr< PersonalStorageCreate (System::SharedPtr< System::IO::Stream > stream, FileFormatVersion version)
 Creates the PST in a stream. More...
 

Public Attributes

System::SharedPtr< PstDoer > pstDoer
 
System::Event< void(System::SharedPtr< System::Object >, System::SharedPtr< ItemMovedEventArgs >)> ItemMoved
 Occurs when an item is moved to the another folder. More...
 
System::Event< void(System::SharedPtr< System::Object >, System::SharedPtr< StorageProcessedEventArgs >)> StorageProcessed
 Occurs in splitting and merging operations when a new chunk of pst is created or the next file is processed and is to be merged. More...
 

Protected Member Functions

virtual ASPOSE_EMAIL_SHARED_API void Dispose (bool disposing)
 Releases unmanaged and - optionally - managed resources. More...
 
virtual ASPOSE_EMAIL_SHARED_API ~PersonalStorage ()
 

Friends

class Aspose::Email::Storage::Pst::ChunkInfo
 

Detailed Description

Represents Personal Storage Table (.pst) file.

Constructor & Destructor Documentation

◆ ~PersonalStorage()

virtual ASPOSE_EMAIL_SHARED_API Aspose::Email::Storage::Pst::PersonalStorage::~PersonalStorage ( )
protectedvirtual

Member Function Documentation

◆ ChangeMessage()

ASPOSE_EMAIL_SHARED_API void Aspose::Email::Storage::Pst::PersonalStorage::ChangeMessage ( System::String  entryId,
System::SharedPtr< Aspose::Email::Mapi::MapiPropertyCollection updatedProperties 
)

Changes the message properties.

Parameters
entryIdThe entry identifier of message.
updatedPropertiesThe updated properties.
Exceptions
System::NotImplementedExceptionThe ANSI file version editing is not implemented.
System::InvalidOperationExceptionThe PST is open for reading only. or The entryId is incorrect.
System::ArgumentNullExceptionentryIdCollection;The collection of entry ids cannot be null. or updatedProperties;The collection of properties cannot be null.

◆ CloneFolderStructure()

ASPOSE_EMAIL_SHARED_API System::SharedPtr<PersonalStorage> Aspose::Email::Storage::Pst::PersonalStorage::CloneFolderStructure ( System::String  fileName)

Clones the folder structure.

Returns
Personal storage.

◆ ConvertTo()

ASPOSE_EMAIL_SHARED_API void Aspose::Email::Storage::Pst::PersonalStorage::ConvertTo ( FileFormat  format)

Converts the current object to the specified format.

Parameters
formatThe FileFormat to convert the current object to.

◆ Create() [1/2]

static ASPOSE_EMAIL_SHARED_API System::SharedPtr<PersonalStorage> Aspose::Email::Storage::Pst::PersonalStorage::Create ( System::SharedPtr< System::IO::Stream >  stream,
FileFormatVersion  version 
)
static

Creates the PST in a stream.

Note, only Unicode file version creation is supported now.

Parameters
streamThe stream in which PST is created.
versionThe PST file version.
Returns
A PersonalStorage object that represents the new PST.
Exceptions
NotImplementedExceptionthrows if ANSI file version is created
ArgumentNullExceptionthrows if stream is null

◆ Create() [2/2]

static ASPOSE_EMAIL_SHARED_API System::SharedPtr<PersonalStorage> Aspose::Email::Storage::Pst::PersonalStorage::Create ( System::String  fileName,
FileFormatVersion  version 
)
static

Creates the new PST file with the specified file name.

Note, only Unicode file version creation is supported now.

Parameters
fileNameThe full name of the file.
versionThe PST file version.
Returns
A PersonalStorage object that represents the new PST.
Exceptions
NotImplementedExceptionthrows if ANSI file version is created
ArgumentNullExceptionthrows if file name is null or empty

◆ CreatePredefinedFolder() [1/2]

ASPOSE_EMAIL_SHARED_API System::SharedPtr<FolderInfo> Aspose::Email::Storage::Pst::PersonalStorage::CreatePredefinedFolder ( System::String  name,
StandardIpmFolder  defaultFolder 
)

Creates the standard interpersonal message (IPM) folder.

Parameters
nameThe name of folder.
defaultFolderThe value of StandardIpmFolder enumeration.
Returns
A FolderInfo object that represents a standard IPM folder.

◆ CreatePredefinedFolder() [2/2]

ASPOSE_EMAIL_SHARED_API System::SharedPtr<FolderInfo> Aspose::Email::Storage::Pst::PersonalStorage::CreatePredefinedFolder ( System::String  name,
StandardIpmFolder  defaultFolder,
bool  createHierarchy 
)

Creates the standard interpersonal message (IPM) folder.

Parameters
nameThe name of folder.
defaultFolderThe value of StandardIpmFolder enumeration.
createHierarchyif set to true, it is possible to create a folder hierarchy using string notation. Backslash ('\') is used as path separator.
Returns
A FolderInfo object that represents a standard IPM folder.

◆ Dispose() [1/2]

ASPOSE_EMAIL_SHARED_API void Aspose::Email::Storage::Pst::PersonalStorage::Dispose ( )

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

◆ Dispose() [2/2]

virtual ASPOSE_EMAIL_SHARED_API void Aspose::Email::Storage::Pst::PersonalStorage::Dispose ( bool  disposing)
protectedvirtual

Releases unmanaged and - optionally - managed resources.

Parameters
disposingtrue to release both managed and unmanaged resources; false to release only unmanaged resources.

◆ ExtractAttachments() [1/2]

ASPOSE_EMAIL_SHARED_API System::SharedPtr<Aspose::Email::Mapi::MapiAttachmentCollection> Aspose::Email::Storage::Pst::PersonalStorage::ExtractAttachments ( System::SharedPtr< MessageInfo >  messageInfo)

Extracts the attachments.

Parameters
messageInfoThe message information.
Returns
The MapiAttachmentCollection that represents the collection of attachments.

◆ ExtractAttachments() [2/2]

ASPOSE_EMAIL_SHARED_API System::SharedPtr<Aspose::Email::Mapi::MapiAttachmentCollection> Aspose::Email::Storage::Pst::PersonalStorage::ExtractAttachments ( System::String  entryId)

Extracts the attachments.

Parameters
entryIdThe message entryId.
Returns
The MapiAttachmentCollection that represents the collection of attachments.

◆ ExtractMessage() [1/3]

ASPOSE_EMAIL_SHARED_API System::SharedPtr<Aspose::Email::Mapi::MapiMessage> Aspose::Email::Storage::Pst::PersonalStorage::ExtractMessage ( System::ArrayPtr< uint8_t >  entryId)

Get the message from PST.

Parameters
entryIdEntryId of message.
Returns
A MapiMessage object.

◆ ExtractMessage() [2/3]

ASPOSE_EMAIL_SHARED_API System::SharedPtr<Aspose::Email::Mapi::MapiMessage> Aspose::Email::Storage::Pst::PersonalStorage::ExtractMessage ( System::SharedPtr< MessageInfo >  messageInfo)

Get the message from PST.

Parameters
messageInfoA MessageInfo object that represents information about message.
Returns
A MapiMessage object.

◆ ExtractMessage() [3/3]

ASPOSE_EMAIL_SHARED_API System::SharedPtr<Aspose::Email::Mapi::MapiMessage> Aspose::Email::Storage::Pst::PersonalStorage::ExtractMessage ( System::String  entryId)

Get the message from PST.

Parameters
entryIdString representation of EntryId.
Returns
A MapiMessage object.

◆ ExtractProperty()

ASPOSE_EMAIL_SHARED_API System::SharedPtr<Aspose::Email::Mapi::MapiProperty> Aspose::Email::Storage::Pst::PersonalStorage::ExtractProperty ( System::ArrayPtr< uint8_t >  entryId,
int64_t  tag 
)

Gets the specified property of item, without extract the item fully.

If a property is not found, null is returned.

Parameters
entryIdThe entry id of item.
tagThe property tag.
Returns
The MapiProperty.

◆ FromFile() [1/2]

static ASPOSE_EMAIL_SHARED_API System::SharedPtr<PersonalStorage> Aspose::Email::Storage::Pst::PersonalStorage::FromFile ( System::String  fileName)
static

Load PST from file.

Parameters
fileNameName of .pst file.
Returns
A PersonalStorage object that represents the current PST.

By default, the pst will support writing.

◆ FromFile() [2/2]

static ASPOSE_EMAIL_SHARED_API System::SharedPtr<PersonalStorage> Aspose::Email::Storage::Pst::PersonalStorage::FromFile ( System::String  fileName,
bool  writable 
)
static

Load PST from file.

Parameters
fileNameName of .pst file.
writableif set to true then the the pst file will support writing, otherwise it will be opened in read-only mode.
Returns
A PersonalStorage object that represents the current PST.

◆ FromStream() [1/2]

static ASPOSE_EMAIL_SHARED_API System::SharedPtr<PersonalStorage> Aspose::Email::Storage::Pst::PersonalStorage::FromStream ( System::SharedPtr< System::IO::Stream >  stream)
static

Load PST from stream.

Parameters
streamThe System.IO.Stream.
Returns
A PersonalStorage object that represents the current PST.

By default, the pst will support writing.

◆ FromStream() [2/2]

static ASPOSE_EMAIL_SHARED_API System::SharedPtr<PersonalStorage> Aspose::Email::Storage::Pst::PersonalStorage::FromStream ( System::SharedPtr< System::IO::Stream >  stream,
bool  writable 
)
static

Load PST from stream.

Parameters
streamThe System.IO.Stream.
writableif set to true then the the pst will support writing, otherwise it will be opened in read-only mode.
Returns
A PersonalStorage object that represents the current PST.

◆ get_CanWrite()

ASPOSE_EMAIL_SHARED_API bool Aspose::Email::Storage::Pst::PersonalStorage::get_CanWrite ( )

Gets a value indicating whether the current pst supports writing.

◆ get_Format()

ASPOSE_EMAIL_SHARED_API FileFormat Aspose::Email::Storage::Pst::PersonalStorage::get_Format ( )

Gets the file format.

FileFormat that specifies file format.

The .pst and .ost file formats are supported now.

◆ get_IsUnicode()

ASPOSE_EMAIL_SHARED_API bool Aspose::Email::Storage::Pst::PersonalStorage::get_IsUnicode ( )

Gets a value indicating whether the PST file format is Unicode. There are two versions of the PST file format: Unicode and ANSI.

◆ get_RootFolder()

ASPOSE_EMAIL_SHARED_API System::SharedPtr<FolderInfo> Aspose::Email::Storage::Pst::PersonalStorage::get_RootFolder ( ) const

Gets the root folder of PST.

FolderInfo that represents a root folder.

◆ get_Store()

ASPOSE_EMAIL_SHARED_API System::SharedPtr<MessageStore> Aspose::Email::Storage::Pst::PersonalStorage::get_Store ( ) const

Gets the PST message store.

The MessageStore which is the rough equivalent of the top of a Mailbox.

◆ GetFolderById() [1/2]

ASPOSE_EMAIL_SHARED_API System::SharedPtr<FolderInfo> Aspose::Email::Storage::Pst::PersonalStorage::GetFolderById ( System::ArrayPtr< uint8_t >  entryId)

Gets the personal folder from PST.

Parameters
entryIdThe Entry id.
Returns
A FolderInfo object.

◆ GetFolderById() [2/2]

ASPOSE_EMAIL_SHARED_API System::SharedPtr<FolderInfo> Aspose::Email::Storage::Pst::PersonalStorage::GetFolderById ( System::String  entryIdString)

Gets the personal folder from PST.

Parameters
entryIdStringString representation of entry ID.
Returns
A FolderInfo object.

◆ GetParentFolder() [1/2]

ASPOSE_EMAIL_SHARED_API System::SharedPtr<FolderInfo> Aspose::Email::Storage::Pst::PersonalStorage::GetParentFolder ( System::ArrayPtr< uint8_t >  entryId)

Gets the parent folder of message.

Parameters
entryIdEntry Id of message or folder.
Returns
The parent folderFolderInfo of message.

◆ GetParentFolder() [2/2]

ASPOSE_EMAIL_SHARED_API System::SharedPtr<FolderInfo> Aspose::Email::Storage::Pst::PersonalStorage::GetParentFolder ( System::String  entryIdString)

Gets the parent folder of message.

Parameters
entryIdStringString representation of Entry Id of message or folder.
Returns
The parent folderFolderInfo of message.

◆ GetPredefinedFolder()

ASPOSE_EMAIL_SHARED_API System::SharedPtr<FolderInfo> Aspose::Email::Storage::Pst::PersonalStorage::GetPredefinedFolder ( StandardIpmFolder  defaultFolder)

Gets the standard interpersonal message (IPM) folder from PST. Outlook can create a number of default folders, such as Outbox, Deleted Items, Sent Items etc.

Parameters
defaultFolderThe value of StandardIpmFolder enumeration.
Returns
A FolderInfo object that represents a standard IPM folder.

◆ MergeWith()

ASPOSE_EMAIL_SHARED_API void Aspose::Email::Storage::Pst::PersonalStorage::MergeWith ( System::ArrayPtr< System::String >  sourceFileNames)

Merges the pst storage with one or more other pst files. Thus, the combined files are sources.

Parameters
sourceFileNamesThe source file names.
Exceptions
ArgumentNullException"Throws when the filename collection is null."
ArgumentException"Throws when the filename in collection is null or empty."

◆ MoveItem() [1/2]

ASPOSE_EMAIL_SHARED_API void Aspose::Email::Storage::Pst::PersonalStorage::MoveItem ( System::SharedPtr< FolderInfo >  folder,
System::SharedPtr< FolderInfo >  newFolder 
)

Moves a specified folder to a new parent folder within the current pst.

Parameters
folderThe folder to move.
newFolderThe new parent folder.

◆ MoveItem() [2/2]

ASPOSE_EMAIL_SHARED_API void Aspose::Email::Storage::Pst::PersonalStorage::MoveItem ( System::SharedPtr< MessageInfo >  message,
System::SharedPtr< FolderInfo >  newFolder 
)

Moves a specified message to a new folder within the current pst.

Parameters
messageThe message to move.
newFolderThe new folder for the message.

◆ SaveAs()

ASPOSE_EMAIL_SHARED_API void Aspose::Email::Storage::Pst::PersonalStorage::SaveAs ( System::String  fileName,
FileFormat  format 
)

Saves the current object to a specified file format in a different file.

Parameters
fileNameThe name of the file to be saved.
formatThe FileFormat is to be used when saving a file.

◆ SaveMessageToStream()

ASPOSE_EMAIL_SHARED_API void Aspose::Email::Storage::Pst::PersonalStorage::SaveMessageToStream ( System::String  entryId,
System::SharedPtr< System::IO::Stream >  stream 
)

Saves the message, with specified entryID, to a stream.

Parameters
entryIdThe entry id.
streamThe stream for writing.

◆ SplitInto() [1/2]

ASPOSE_EMAIL_SHARED_API void Aspose::Email::Storage::Pst::PersonalStorage::SplitInto ( int64_t  chunkSize,
System::String  path 
)

Splits the pst storage into less sized parts.

Parameters
chunkSizeThe approximate size of a chunk in bytes.
pathThe folder path where chunks will be created.
Exceptions
ArgumentExceptionThrows when the path parameter is null or empty.
ArgumentExceptionThrows when the chunk size is less then the minimum size of pst file.

◆ SplitInto() [2/2]

ASPOSE_EMAIL_SHARED_API void Aspose::Email::Storage::Pst::PersonalStorage::SplitInto ( System::SharedPtr< System::Collections::Generic::IList< System::SharedPtr< Aspose::Email::Tools::Search::MailQuery >>>  criteria,
System::String  path 
)

Splits the pst storage based on criteria.

Parameters
criteriaThe collection of MailQuery that represents criteria of pst splitting.
pathThe folder path where chunks will be created.
Exceptions
ArgumentExceptionThrows when the path parameter is null or empty.

Friends And Related Function Documentation

◆ Aspose::Email::Storage::Pst::ChunkInfo

friend class Aspose::Email::Storage::Pst::ChunkInfo
friend

Member Data Documentation

◆ ItemMoved

System::Event<void(System::SharedPtr<System::Object>, System::SharedPtr<ItemMovedEventArgs>)> Aspose::Email::Storage::Pst::PersonalStorage::ItemMoved

Occurs when an item is moved to the another folder.

◆ pstDoer

System::SharedPtr<PstDoer> Aspose::Email::Storage::Pst::PersonalStorage::pstDoer

◆ StorageProcessed

System::Event<void(System::SharedPtr<System::Object>, System::SharedPtr<StorageProcessedEventArgs>)> Aspose::Email::Storage::Pst::PersonalStorage::StorageProcessed

Occurs in splitting and merging operations when a new chunk of pst is created or the next file is processed and is to be merged.