Aspose::Email::Storage::Olm::OlmStorage Class Reference

Represents Outlook for Mac storage (.OLM) file. More...

Inherits IDisposable.

Public Member Functions

System::SharedPtr< System::Collections::Generic::ListExt< System::SharedPtr< OlmFolder > > > get_FolderHierarchy () const
 Gets the folder hierarchy. More...
 
 OlmStorage (Aspose::Email::Exceptions::TraversalExceptionsCallback callback)
 Initializes a new instance of the OlmStorage class. Allows setting a callback method for handling exceptions that occur during OLM storage traversal. More...
 
 OlmStorage (System::String fileName)
 Initializes a new instance of the OlmStorage class. More...
 
 OlmStorage (System::SharedPtr< System::IO::Stream > stream)
 Initializes a new instance of the OlmStorage class. More...
 
bool Load (System::SharedPtr< System::IO::Stream > stream)
 Load OLM storage from stream. This method is used when a OlmStorage object is created using constructor with the TraversalExceptionsCallback parameter. More...
 
bool Load (System::String fileName)
 Load OLM storage from file. This method is used when a OlmStorage object is created using constructor with the TraversalExceptionsCallback parameter. More...
 
System::SharedPtr< System::Collections::Generic::ListExt< System::SharedPtr< OlmFolder > > > GetFolders ()
 Gets collection of folders. More...
 
System::SharedPtr< OlmFolderGetFolder (System::String name, bool ignoreCase)
 Gets the folder by name. More...
 
System::SharedPtr< Aspose::Email::Mapi::MapiMessageExtractMapiMessage (System::String id)
 Get the message from OLM. More...
 
System::SharedPtr< Aspose::Email::Mapi::MapiMessageExtractMapiMessage (System::SharedPtr< OlmMessageInfo > messageInfo)
 Get the message from OLM storage. More...
 
int32_t GetTotalItemsCount ()
 Gets the total items count. Returns the total number of message items contained in the OLM. More...
 
System::SharedPtr< System::Collections::Generic::IEnumerable< System::SharedPtr< Aspose::Email::Mapi::MapiMessage > > > EnumerateMessages (System::SharedPtr< OlmFolder > folder)
 Exposes the enumerator, which supports an iteration of messages in folder. More...
 
void Dispose () override
 Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. More...
 
void SetVentureLicense (System::SharedPtr< VentureLicense > ventureLicense)
 

Static Public Member Functions

static System::SharedPtr< OlmStorageFromFile (System::String fileName)
 Load OLM storage from file. More...
 
static System::SharedPtr< OlmStorageFromStream (System::SharedPtr< System::IO::Stream > stream)
 Load OLM from stream. More...
 

Protected Member Functions

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

Detailed Description

Represents Outlook for Mac storage (.OLM) file.

Constructor & Destructor Documentation

◆ OlmStorage() [1/3]

Aspose::Email::Storage::Olm::OlmStorage::OlmStorage ( Aspose::Email::Exceptions::TraversalExceptionsCallback  callback)

Initializes a new instance of the OlmStorage class. Allows setting a callback method for handling exceptions that occur during OLM storage traversal.

Parameters
callbackThe exception callback.

◆ OlmStorage() [2/3]

Aspose::Email::Storage::Olm::OlmStorage::OlmStorage ( System::String  fileName)

Initializes a new instance of the OlmStorage class.

Parameters
fileNameOLM file name.
Returns
Returns an OlmStorage instance which is loaded from the specified file.
Exceptions
ArgumentNullExceptionthrows if file name is null or empty

◆ OlmStorage() [3/3]

Aspose::Email::Storage::Olm::OlmStorage::OlmStorage ( System::SharedPtr< System::IO::Stream >  stream)

Initializes a new instance of the OlmStorage class.

Parameters
streamSource stream System::IO::Stream with OLM storage data.
Returns
Returns an OlmStorage instance which is loaded from the specified stream.
Exceptions
ArgumentNullExceptionthrows if stream is null

Member Function Documentation

◆ Dispose() [1/2]

void Aspose::Email::Storage::Olm::OlmStorage::Dispose ( )
override

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

◆ Dispose() [2/2]

virtual void Aspose::Email::Storage::Olm::OlmStorage::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.

◆ EnumerateMessages()

System::SharedPtr<System::Collections::Generic::IEnumerable<System::SharedPtr<Aspose::Email::Mapi::MapiMessage> > > Aspose::Email::Storage::Olm::OlmStorage::EnumerateMessages ( System::SharedPtr< OlmFolder folder)

Exposes the enumerator, which supports an iteration of messages in folder.

Parameters
folderOlmFolder that represents information about folder in OLM storage.
Returns
System::Collections::Generic::IEnumerable<T>, that represents an enumerator that iterates through a messages in folder.
Exceptions
ArgumentNullExceptionthrows if folder is null

◆ ExtractMapiMessage() [1/2]

System::SharedPtr<Aspose::Email::Mapi::MapiMessage> Aspose::Email::Storage::Olm::OlmStorage::ExtractMapiMessage ( System::SharedPtr< OlmMessageInfo messageInfo)

Get the message from OLM storage.

Parameters
messageInfoAn OlmMessageInfo object that represents information about message.
Returns
A MapiMessage object.

◆ ExtractMapiMessage() [2/2]

System::SharedPtr<Aspose::Email::Mapi::MapiMessage> Aspose::Email::Storage::Olm::OlmStorage::ExtractMapiMessage ( System::String  id)

Get the message from OLM.

Parameters
idString representation of EntryId.
Returns
A MapiMessage object.

◆ FromFile()

static System::SharedPtr<OlmStorage> Aspose::Email::Storage::Olm::OlmStorage::FromFile ( System::String  fileName)
static

Load OLM storage from file.

Parameters
fileNameName of .olm file.
Returns
An OlmStorage object that represents the current OLM file.

◆ FromStream()

static System::SharedPtr<OlmStorage> Aspose::Email::Storage::Olm::OlmStorage::FromStream ( System::SharedPtr< System::IO::Stream >  stream)
static

Load OLM from stream.

Parameters
streamThe System.IO.Stream.
Returns
An OlmStorage object that represents the current OLM storage.

◆ get_FolderHierarchy()

System::SharedPtr<System::Collections::Generic::ListExt<System::SharedPtr<OlmFolder> > > Aspose::Email::Storage::Olm::OlmStorage::get_FolderHierarchy ( ) const

Gets the folder hierarchy.

The folder hierarchy.

◆ GetFolder()

System::SharedPtr<OlmFolder> Aspose::Email::Storage::Olm::OlmStorage::GetFolder ( System::String  name,
bool  ignoreCase 
)

Gets the folder by name.

Parameters
nameName of folder.
ignoreCaseA value that indicates whether the name to match is case insensitive.
Returns
An OlmFolder object.

◆ GetFolders()

System::SharedPtr<System::Collections::Generic::ListExt<System::SharedPtr<OlmFolder> > > Aspose::Email::Storage::Olm::OlmStorage::GetFolders ( )

Gets collection of folders.

Returns
The collection of folders that belong to the storage, i.e. the sub-folders of the current OLMStorage object.

◆ GetTotalItemsCount()

int32_t Aspose::Email::Storage::Olm::OlmStorage::GetTotalItemsCount ( )

Gets the total items count. Returns the total number of message items contained in the OLM.

Returns
Total message items count.

◆ Load() [1/2]

bool Aspose::Email::Storage::Olm::OlmStorage::Load ( System::SharedPtr< System::IO::Stream >  stream)

Load OLM storage from stream. This method is used when a OlmStorage object is created using constructor with the TraversalExceptionsCallback parameter.

Parameters
streamThe stream.
Returns
'true' if the file has been loaded successfully and further traversal is possible; otherwise, false.

◆ Load() [2/2]

bool Aspose::Email::Storage::Olm::OlmStorage::Load ( System::String  fileName)

Load OLM storage from file. This method is used when a OlmStorage object is created using constructor with the TraversalExceptionsCallback parameter.

Parameters
fileNameThe file name.
Returns
'true' if the file has been loaded successfully and further traversal is possible; otherwise, false.

◆ SetVentureLicense()

void Aspose::Email::Storage::Olm::OlmStorage::SetVentureLicense ( System::SharedPtr< VentureLicense >  ventureLicense)