Aspose::Email::Storage::Mbox::MboxStorageWriter Class Referenceabstract

A base class for any mbox-based mail storage writer. More...

Inherits IDisposable.

Inherited by Aspose::Email::Storage::Mbox::MboxrdStorageWriter.

Public Member Functions

System::SharedPtr< System::IO::Stream > get_BaseStream () const
 Gets the base stream. More...
 
virtual System::String WriteMessage (System::SharedPtr< MailMessage > message)=0
 Writes the message to underlying storage stream. More...
 
virtual System::String WriteMessage (System::SharedPtr< MailMessage > message, System::String &fromMarker)=0
 Writes the message to underlying storage stream. More...
 
void Dispose () override
 Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. More...
 

Protected Member Functions

 MboxStorageWriter (System::SharedPtr< System::IO::Stream > stream, bool leaveOpen)
 Initializes a new instance of the MboxStorageWriter class. More...
 
 MboxStorageWriter (System::String fileName, bool leaveOpen)
 Initializes a new instance of the MboxStorageWriter class. More...
 
virtual void Dispose (bool disposing)
 Releases unmanaged and - optionally - managed resources More...
 

Friends

class Aspose::Email::Storage::Mbox::MboxrdStorageWriter
 

Detailed Description

A base class for any mbox-based mail storage writer.

Constructor & Destructor Documentation

◆ MboxStorageWriter() [1/2]

Aspose::Email::Storage::Mbox::MboxStorageWriter::MboxStorageWriter ( System::SharedPtr< System::IO::Stream >  stream,
bool  leaveOpen 
)
protected

Initializes a new instance of the MboxStorageWriter class.

Parameters
streamThe stream.
leaveOpenif set to true leaves the underlying stream open after disposing.
Exceptions
ArgumentNullExceptionIf given stream is null.

◆ MboxStorageWriter() [2/2]

Aspose::Email::Storage::Mbox::MboxStorageWriter::MboxStorageWriter ( System::String  fileName,
bool  leaveOpen 
)
protected

Initializes a new instance of the MboxStorageWriter class.

Parameters
fileNameName of the file.
leaveOpenif set to true leaves the underlying stream open after disposing.
Exceptions
ArgumentNullExceptionIf filename is null or empty.

Member Function Documentation

◆ Dispose() [1/2]

void Aspose::Email::Storage::Mbox::MboxStorageWriter::Dispose ( )
override

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

◆ Dispose() [2/2]

virtual void Aspose::Email::Storage::Mbox::MboxStorageWriter::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.

◆ get_BaseStream()

System::SharedPtr<System::IO::Stream> Aspose::Email::Storage::Mbox::MboxStorageWriter::get_BaseStream ( ) const

Gets the base stream.

The base stream.

◆ WriteMessage() [1/2]

virtual System::String Aspose::Email::Storage::Mbox::MboxStorageWriter::WriteMessage ( System::SharedPtr< MailMessage message)
pure virtual

Writes the message to underlying storage stream.

Parameters
messageThe message to write to.
Returns
The string identifier of added message.

Implemented in Aspose::Email::Storage::Mbox::MboxrdStorageWriter.

◆ WriteMessage() [2/2]

virtual System::String Aspose::Email::Storage::Mbox::MboxStorageWriter::WriteMessage ( System::SharedPtr< MailMessage message,
System::String &  fromMarker 
)
pure virtual

Writes the message to underlying storage stream.

Parameters
messageThe message to write to.
fromMarkerGets the From Marker while writing the MBox Storage file.
Returns
The string identifier of added message.

Implemented in Aspose::Email::Storage::Mbox::MboxrdStorageWriter.

Friends And Related Function Documentation

◆ Aspose::Email::Storage::Mbox::MboxrdStorageWriter