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

Inherits IDisposable.

Inherited by Aspose::Email::Storage::Mbox::MboxoStorageReader, and Aspose::Email::Storage::Mbox::MboxrdStorageReader.

Public Member Functions

System::SharedPtr< System::IO::Stream > get_BaseStream () const
 Gets the base stream. More...
 
int64_t get_CurrentDataSize () const
 Gets the number of bytes that is read by ReadNextMessage method. More...
 
System::SharedPtr< System::Collections::Generic::IEnumerable< System::SharedPtr< MailMessage > > > EnumerateMessages ()
 Exposes the enumerator, which supports an iteration of messages in storage. More...
 
System::SharedPtr< System::Collections::Generic::IEnumerable< System::SharedPtr< MboxMessageInfo > > > EnumerateMessageInfo ()
 Exposes the enumerator, which supports an iteration of messages in storage. More...
 
System::SharedPtr< MailMessageExtractMessage (System::String id, System::SharedPtr< EmlLoadOptions > options)
 Get the message from MBOX. More...
 
System::SharedPtr< System::Collections::Generic::IEnumerable< System::SharedPtr< MailMessage > > > EnumerateMessages (System::SharedPtr< EmlLoadOptions > options)
 Exposes the enumerator, which supports an iteration of messages in storage. More...
 
void SplitInto (int64_t chunkSize, System::String outputPath)
 Splits the mbox storage into less sized parts. More...
 
void SplitInto (int64_t chunkSize, System::String outputPath, System::String partFileNamePrefix)
 Splits the mbox storage into less sized parts. More...
 
virtual System::SharedPtr< MailMessageReadNextMessage ()=0
 Reads the next message from underlying storage stream. More...
 
virtual System::SharedPtr< MailMessageReadNextMessage (System::String &fromMarker)=0
 Reads the next message from underlying storage stream. More...
 
virtual System::SharedPtr< MailMessageReadNextMessage (System::SharedPtr< EmlLoadOptions > options)=0
 Reads the next message from underlying storage stream. More...
 
virtual System::SharedPtr< MailMessageReadNextMessage (System::String &fromMarker, System::SharedPtr< EmlLoadOptions > options)=0
 Reads the next message from underlying storage stream. More...
 
virtual System::SharedPtr< MboxMessageInfoNextMessage ()=0
 Gets the next message info. More...
 
virtual int32_t GetTotalItemsCount ()=0
 Returns the number of messages in a storage. More...
 
void Dispose () override
 Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. More...
 
VentureLicenseState GetVentureLicenseState ()
 

Static Public Member Functions

static System::SharedPtr< MboxStorageReaderCreateReader (System::SharedPtr< System::IO::Stream > stream, System::SharedPtr< MboxLoadOptions > options)
 Creates the instance of reader. More...
 
static System::SharedPtr< MboxStorageReaderCreateReader (System::String fileName, System::SharedPtr< MboxLoadOptions > options)
 Creates the instance of reader. More...
 
static bool ByteArrayStartsFromMarker (System::ArrayPtr< uint8_t > array, System::ArrayPtr< uint8_t > marker)
 Checks whether the array starts from given marker. More...
 
static bool ContainsAsctime (System::ArrayPtr< uint8_t > currentLine)
 Determines whether the specified line contains asctime string. More...
 
static System::ArrayPtr< uint8_t > ReadLine (System::SharedPtr< System::IO::Stream > stream)
 Reads the line from stream. More...
 

Public Attributes

int32_t msgCount
 
System::SharedPtr< System::Object > mVentureLicense
 
System::Event< void(System::SharedPtr< System::Object >, System::SharedPtr< MimeItemCopyEventArgs >)> EmlCopying
 Event that occurs before the MailMessage object copy process, within the SplitInto(long, string) method. More...
 
System::Event< void(System::SharedPtr< System::Object >, System::SharedPtr< MimeItemCopyEventArgs >)> EmlCopied
 Event that occurs after successful copy of a MailMessage object within the SplitInto(long, string) method. More...
 
System::Event< void(System::SharedPtr< System::Object >, System::SharedPtr< NewStorageEventArgs >)> MboxFileCreated
 Event that occurs when a new MBOX file is created during the SplitInto(long, string) method. More...
 
System::Event< void(System::SharedPtr< System::Object >, System::SharedPtr< NewStorageEventArgs >)> MboxFileFilled
 Event that occurs after filling an MBOX file with data within the SplitInto(long, string) method. More...
 

Static Public Attributes

static System::ArrayPtr< uint8_t > FromMarker
 "From " signature, indicates a start of the message. More...
 
static System::ArrayPtr< uint8_t > EmptyFromMarkerCRLF
 
static System::ArrayPtr< uint8_t > EmptyFromMarkerCR
 
static System::ArrayPtr< uint8_t > EmptyFromMarkerLF
 
static System::ArrayPtr< uint8_t > MboxoMarker
 The mbox format uses a single blank line followed by the string 'From ' (with a space) to delimit messages. In mboxo format sender's email address in message delimiter is replaced by the constant string '???@???', i.e. 'From ???@???' More...
 

Protected Member Functions

void set_CurrentDataSize (int64_t value)
 Gets the number of bytes that is read by ReadNextMessage method. More...
 
 MboxStorageReader (System::SharedPtr< System::IO::Stream > stream, System::SharedPtr< MboxLoadOptions > options)
 Initializes a new instance of the MboxStorageReader class. More...
 
 MboxStorageReader (System::String fileName, System::SharedPtr< MboxLoadOptions > options)
 Initializes a new instance of the MboxStorageReader class. More...
 
virtual void Dispose (bool disposing)
 Releases unmanaged and - optionally - managed resources More...
 
virtual ~MboxStorageReader ()
 

Protected Attributes

System::SharedPtr< System::Text::Encoding > preferredTextEncoding
 

Friends

class Aspose::Email::Storage::Mbox::MboxoStorageReader
 
class Aspose::Email::Storage::Mbox::MboxrdStorageReader
 

Detailed Description

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

Constructor & Destructor Documentation

◆ MboxStorageReader() [1/2]

Aspose::Email::Storage::Mbox::MboxStorageReader::MboxStorageReader ( System::SharedPtr< System::IO::Stream >  stream,
System::SharedPtr< MboxLoadOptions options 
)
protected

Initializes a new instance of the MboxStorageReader class.

Parameters
streamThe stream.
optionsadditional options when loading a Mbox storageMboxLoadOptions.
Exceptions
ArgumentNullExceptionIf given stream is null.

◆ MboxStorageReader() [2/2]

Aspose::Email::Storage::Mbox::MboxStorageReader::MboxStorageReader ( System::String  fileName,
System::SharedPtr< MboxLoadOptions options 
)
protected

Initializes a new instance of the MboxStorageReader class.

Parameters
fileNameName of the file.
optionsadditional options when loading a Mbox storageMboxLoadOptions.
Exceptions
ArgumentNullExceptionIf filename is null or empty.

◆ ~MboxStorageReader()

virtual Aspose::Email::Storage::Mbox::MboxStorageReader::~MboxStorageReader ( )
protectedvirtual

Member Function Documentation

◆ ByteArrayStartsFromMarker()

static bool Aspose::Email::Storage::Mbox::MboxStorageReader::ByteArrayStartsFromMarker ( System::ArrayPtr< uint8_t >  array,
System::ArrayPtr< uint8_t >  marker 
)
static

Checks whether the array starts from given marker.

Parameters
arrayThe array, can be null.
markerThe marker, can't be null.
Returns
Boolean value indicating the result of operation.

◆ ContainsAsctime()

static bool Aspose::Email::Storage::Mbox::MboxStorageReader::ContainsAsctime ( System::ArrayPtr< uint8_t >  currentLine)
static

Determines whether the specified line contains asctime string.

Parameters
currentLineThe current line.
Returns
true if the specified current line contains asctime; otherwise, false.

◆ CreateReader() [1/2]

static System::SharedPtr<MboxStorageReader> Aspose::Email::Storage::Mbox::MboxStorageReader::CreateReader ( System::SharedPtr< System::IO::Stream >  stream,
System::SharedPtr< MboxLoadOptions options 
)
static

Creates the instance of reader.

Parameters
streamThe stream.
optionsadditional options when loading a Mbox storageMboxLoadOptions.
Returns
Exceptions
ArgumentNullException

◆ CreateReader() [2/2]

static System::SharedPtr<MboxStorageReader> Aspose::Email::Storage::Mbox::MboxStorageReader::CreateReader ( System::String  fileName,
System::SharedPtr< MboxLoadOptions options 
)
static

Creates the instance of reader.

Parameters
fileName
optionsadditional options when loading a Mbox storageMboxLoadOptions.
Returns
Exceptions
ArgumentNullException

◆ Dispose() [1/2]

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

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

◆ Dispose() [2/2]

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

◆ EnumerateMessageInfo()

System::SharedPtr<System::Collections::Generic::IEnumerable<System::SharedPtr<MboxMessageInfo> > > Aspose::Email::Storage::Mbox::MboxStorageReader::EnumerateMessageInfo ( )

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

Returns
System::Collections::Generic::IEnumerable<T>, that represents an enumerator that iterates through a messages in storage.

◆ EnumerateMessages() [1/2]

System::SharedPtr<System::Collections::Generic::IEnumerable<System::SharedPtr<MailMessage> > > Aspose::Email::Storage::Mbox::MboxStorageReader::EnumerateMessages ( )

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

Returns
System::Collections::Generic::IEnumerable<T>, that represents an enumerator that iterates through a messages in storage.

◆ EnumerateMessages() [2/2]

System::SharedPtr<System::Collections::Generic::IEnumerable<System::SharedPtr<MailMessage> > > Aspose::Email::Storage::Mbox::MboxStorageReader::EnumerateMessages ( System::SharedPtr< EmlLoadOptions options)

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

Parameters
optionsSpecifies EmlLoadOptions when reading message from Mbox storage.
Returns
System::Collections::Generic::IEnumerable<T>, that represents an enumerator that iterates through a messages in storage.

◆ ExtractMessage()

System::SharedPtr<MailMessage> Aspose::Email::Storage::Mbox::MboxStorageReader::ExtractMessage ( System::String  id,
System::SharedPtr< EmlLoadOptions options 
)

Get the message from MBOX.

Parameters
idString representation of EntryId.
optionsSpecifies EmlLoadOptions when reading message from Mbox storage.
Returns
A MailMessage object.

◆ get_BaseStream()

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

Gets the base stream.

The base stream.

◆ get_CurrentDataSize()

int64_t Aspose::Email::Storage::Mbox::MboxStorageReader::get_CurrentDataSize ( ) const

Gets the number of bytes that is read by ReadNextMessage method.

◆ GetTotalItemsCount()

virtual int32_t Aspose::Email::Storage::Mbox::MboxStorageReader::GetTotalItemsCount ( )
pure virtual

Returns the number of messages in a storage.

Returns
Returns the number of messages in a storage.

Implemented in Aspose::Email::Storage::Mbox::MboxrdStorageReader, and Aspose::Email::Storage::Mbox::MboxoStorageReader.

◆ GetVentureLicenseState()

VentureLicenseState Aspose::Email::Storage::Mbox::MboxStorageReader::GetVentureLicenseState ( )

◆ NextMessage()

virtual System::SharedPtr<MboxMessageInfo> Aspose::Email::Storage::Mbox::MboxStorageReader::NextMessage ( )
pure virtual

Gets the next message info.

Returns
A MboxMessageInfo object if it can be read or null if no more messages are available.

Implemented in Aspose::Email::Storage::Mbox::MboxrdStorageReader, and Aspose::Email::Storage::Mbox::MboxoStorageReader.

◆ ReadLine()

static System::ArrayPtr<uint8_t> Aspose::Email::Storage::Mbox::MboxStorageReader::ReadLine ( System::SharedPtr< System::IO::Stream >  stream)
static

Reads the line from stream.

Parameters
streamThe stream.
Returns
The line read.

◆ ReadNextMessage() [1/4]

virtual System::SharedPtr<MailMessage> Aspose::Email::Storage::Mbox::MboxStorageReader::ReadNextMessage ( )
pure virtual

Reads the next message from underlying storage stream.

Returns
A MailMessage object if it can be read or null if no more messages are available.

Implemented in Aspose::Email::Storage::Mbox::MboxrdStorageReader, and Aspose::Email::Storage::Mbox::MboxoStorageReader.

◆ ReadNextMessage() [2/4]

virtual System::SharedPtr<MailMessage> Aspose::Email::Storage::Mbox::MboxStorageReader::ReadNextMessage ( System::SharedPtr< EmlLoadOptions options)
pure virtual

Reads the next message from underlying storage stream.

Parameters
optionsSpecifies EmlLoadOptions when reading message from Mbox storage.
Returns
A MailMessage object if it can be read or null if no more messages are available.

Implemented in Aspose::Email::Storage::Mbox::MboxrdStorageReader, and Aspose::Email::Storage::Mbox::MboxoStorageReader.

◆ ReadNextMessage() [3/4]

virtual System::SharedPtr<MailMessage> Aspose::Email::Storage::Mbox::MboxStorageReader::ReadNextMessage ( System::String &  fromMarker)
pure virtual

Reads the next message from underlying storage stream.

Parameters
fromMarkerGets the From Marker while parsing the MBox Storage file.
Returns
A MailMessage object if it can be read or null if no more messages are available.

Implemented in Aspose::Email::Storage::Mbox::MboxrdStorageReader, and Aspose::Email::Storage::Mbox::MboxoStorageReader.

◆ ReadNextMessage() [4/4]

virtual System::SharedPtr<MailMessage> Aspose::Email::Storage::Mbox::MboxStorageReader::ReadNextMessage ( System::String &  fromMarker,
System::SharedPtr< EmlLoadOptions options 
)
pure virtual

Reads the next message from underlying storage stream.

Parameters
fromMarkerGets the From Marker while parsing the MBox Storage file.
optionsSpecifies EmlLoadOptions when reading message from Mbox storage.
Returns
A MailMessage object if it can be read or null if no more messages are available.

Implemented in Aspose::Email::Storage::Mbox::MboxrdStorageReader, and Aspose::Email::Storage::Mbox::MboxoStorageReader.

◆ set_CurrentDataSize()

void Aspose::Email::Storage::Mbox::MboxStorageReader::set_CurrentDataSize ( int64_t  value)
protected

Gets the number of bytes that is read by ReadNextMessage method.

◆ SplitInto() [1/2]

void Aspose::Email::Storage::Mbox::MboxStorageReader::SplitInto ( int64_t  chunkSize,
System::String  outputPath 
)

Splits the mbox storage into less sized parts.

Parameters
chunkSizeThe approximate size of a chunk in bytes.
outputPathThe folder path where chunks will be created.
Exceptions
ArgumentExceptionThrows when the path parameter is null or empty.

◆ SplitInto() [2/2]

void Aspose::Email::Storage::Mbox::MboxStorageReader::SplitInto ( int64_t  chunkSize,
System::String  outputPath,
System::String  partFileNamePrefix 
)

Splits the mbox storage into less sized parts.

Parameters
chunkSizeThe approximate size of a chunk in bytes.
outputPathThe folder path where chunks will be created.
partFileNamePrefixThe prefix to be added to the filename of each part of pst.
Exceptions
ArgumentExceptionThrows when the path parameter is null or empty.

Friends And Related Function Documentation

◆ Aspose::Email::Storage::Mbox::MboxoStorageReader

◆ Aspose::Email::Storage::Mbox::MboxrdStorageReader

Member Data Documentation

◆ EmlCopied

System::Event<void(System::SharedPtr<System::Object>, System::SharedPtr<MimeItemCopyEventArgs>)> Aspose::Email::Storage::Mbox::MboxStorageReader::EmlCopied

Event that occurs after successful copy of a MailMessage object within the SplitInto(long, string) method.

◆ EmlCopying

System::Event<void(System::SharedPtr<System::Object>, System::SharedPtr<MimeItemCopyEventArgs>)> Aspose::Email::Storage::Mbox::MboxStorageReader::EmlCopying

Event that occurs before the MailMessage object copy process, within the SplitInto(long, string) method.

◆ EmptyFromMarkerCR

System::ArrayPtr<uint8_t> Aspose::Email::Storage::Mbox::MboxStorageReader::EmptyFromMarkerCR
static

◆ EmptyFromMarkerCRLF

System::ArrayPtr<uint8_t> Aspose::Email::Storage::Mbox::MboxStorageReader::EmptyFromMarkerCRLF
static

◆ EmptyFromMarkerLF

System::ArrayPtr<uint8_t> Aspose::Email::Storage::Mbox::MboxStorageReader::EmptyFromMarkerLF
static

◆ FromMarker

System::ArrayPtr<uint8_t> Aspose::Email::Storage::Mbox::MboxStorageReader::FromMarker
static

"From " signature, indicates a start of the message.

◆ MboxFileCreated

System::Event<void(System::SharedPtr<System::Object>, System::SharedPtr<NewStorageEventArgs>)> Aspose::Email::Storage::Mbox::MboxStorageReader::MboxFileCreated

Event that occurs when a new MBOX file is created during the SplitInto(long, string) method.

◆ MboxFileFilled

System::Event<void(System::SharedPtr<System::Object>, System::SharedPtr<NewStorageEventArgs>)> Aspose::Email::Storage::Mbox::MboxStorageReader::MboxFileFilled

Event that occurs after filling an MBOX file with data within the SplitInto(long, string) method.

◆ MboxoMarker

System::ArrayPtr<uint8_t> Aspose::Email::Storage::Mbox::MboxStorageReader::MboxoMarker
static

The mbox format uses a single blank line followed by the string 'From ' (with a space) to delimit messages. In mboxo format sender's email address in message delimiter is replaced by the constant string '???@???', i.e. 'From ???@???'

◆ msgCount

int32_t Aspose::Email::Storage::Mbox::MboxStorageReader::msgCount

◆ mVentureLicense

System::SharedPtr<System::Object> Aspose::Email::Storage::Mbox::MboxStorageReader::mVentureLicense

◆ preferredTextEncoding

System::SharedPtr<System::Text::Encoding> Aspose::Email::Storage::Mbox::MboxStorageReader::preferredTextEncoding
protected