Represents an MBOX file and provides methods for reading and extracting messages. The MBOX file format is used for storing a collection of email messages. 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< MailMessage > > > | EnumerateMessages (System::SharedPtr< Tools::Search::MailQuery > query) |
| Enumerates the mail messages that match the specified query. More... | |
| System::SharedPtr< System::Collections::Generic::IEnumerable< System::SharedPtr< MailMessage > > > | EnumerateMessages (int32_t startIndex, int32_t count) |
| Enumerates a specified number of mail messages, starting from the given index. 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< System::Collections::Generic::IEnumerable< System::SharedPtr< MboxMessageInfo > > > | EnumerateMessageInfo (System::SharedPtr< Tools::Search::MailQuery > query) |
| Enumerates the message information that matches the specified query. More... | |
| System::SharedPtr< System::Collections::Generic::IEnumerable< System::SharedPtr< MboxMessageInfo > > > | EnumerateMessageInfo (int32_t startIndex, int32_t count) |
| Enumerates a specified number of message information entries, starting from the given index. More... | |
| System::SharedPtr< MailMessage > | ExtractMessage (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... | |
| System::SharedPtr< System::Collections::Generic::IEnumerable< System::SharedPtr< MailMessage > > > | EnumerateMessages (System::SharedPtr< EmlLoadOptions > options, System::SharedPtr< Tools::Search::MailQuery > query) |
| Enumerates the mail messages that match the specified query, using the provided load options. More... | |
| System::SharedPtr< System::Collections::Generic::IEnumerable< System::SharedPtr< MailMessage > > > | EnumerateMessages (System::SharedPtr< EmlLoadOptions > options, int32_t startIndex, int32_t count) |
| Enumerates a specified number of mail messages, starting from the given index, using the provided load options. 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... | |
| void | Cancel () |
| This method used to interrupt a split operation. More... | |
| virtual System::SharedPtr< MailMessage > | ReadNextMessage ()=0 |
| Reads the next message from underlying storage stream. More... | |
| virtual System::SharedPtr< MailMessage > | ReadNextMessage (System::String &fromMarker)=0 |
| Reads the next message from underlying storage stream. More... | |
| virtual System::SharedPtr< MailMessage > | ReadNextMessage (System::SharedPtr< EmlLoadOptions > options)=0 |
| Reads the next message from underlying storage stream. More... | |
| virtual System::SharedPtr< MailMessage > | ReadNextMessage (System::String &fromMarker, System::SharedPtr< EmlLoadOptions > options)=0 |
| Reads the next message from underlying storage stream. More... | |
| virtual System::SharedPtr< MboxMessageInfo > | NextMessage ()=0 |
| Gets the next message info. More... | |
| virtual int32_t | GetTotalItemsCount ()=0 |
| Returns the number of messages in a storage. More... | |
| virtual void | SetPositionByIndex (int32_t index)=0 |
| virtual System::SharedPtr< MailMessage > | ReadNextMessage (System::SharedPtr< EmlLoadOptions > options, int32_t count)=0 |
| virtual System::SharedPtr< MboxMessageInfo > | NextMessage (int32_t count)=0 |
| 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< MboxStorageReader > | CreateReader (System::SharedPtr< System::IO::Stream > stream, System::SharedPtr< MboxLoadOptions > options) |
| Creates the instance of reader. More... | |
| static System::SharedPtr< MboxStorageReader > | CreateReader (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... | |
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 | MboxoStorageReader |
| class | MboxrdStorageReader |
Represents an MBOX file and provides methods for reading and extracting messages. The MBOX file format is used for storing a collection of email messages.
The following code provided is intended for processing email messages stored in an MBOX file using the MboxStorageReader class.
[C#]
[Visual Basic]
|
protected |
Initializes a new instance of the MboxStorageReader class.
| stream | The stream. |
| options | additional options when loading a Mbox storageMboxLoadOptions. |
| ArgumentNullException | If given stream is null. |
|
protected |
Initializes a new instance of the MboxStorageReader class.
| fileName | Name of the file. |
| options | additional options when loading a Mbox storageMboxLoadOptions. |
| ArgumentNullException | If filename is null or empty. |
|
protectedvirtual |
|
static |
Checks whether the array starts from given marker.
| array | The array, can be null. |
| marker | The marker, can't be null. |
| void Aspose::Email::Storage::Mbox::MboxStorageReader::Cancel | ( | ) |
This method used to interrupt a split operation.
|
static |
Determines whether the specified line contains asctime string.
| currentLine | The current line. |
true if the specified current line contains asctime; otherwise, false.
|
static |
Creates the instance of reader.
| stream | The stream. |
| options | additional options when loading a Mbox storageMboxLoadOptions. |
| ArgumentNullException |
|
static |
Creates the instance of reader.
| fileName | |
| options | additional options when loading a Mbox storageMboxLoadOptions. |
| ArgumentNullException |
|
override |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
|
protectedvirtual |
Releases unmanaged and - optionally - managed resources
| disposing | true to release both managed and unmanaged resources; false to release only unmanaged resources. |
| 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.
| System::SharedPtr<System::Collections::Generic::IEnumerable<System::SharedPtr<MboxMessageInfo> > > Aspose::Email::Storage::Mbox::MboxStorageReader::EnumerateMessageInfo | ( | int32_t | startIndex, |
| int32_t | count | ||
| ) |
Enumerates a specified number of message information entries, starting from the given index.
| startIndex | The zero-based index of the first message to retrieve. If startIndex is greater than or equal to the total number of items, an ArgumentOutOfRangeException is thrown. |
| count | The maximum number of message information entries to retrieve. If set to -1, all messages from the start index will be read. |
| ArgumentOutOfRangeException | Thrown when startIndex is greater than or equal to the total number of available messages. |
| System::SharedPtr<System::Collections::Generic::IEnumerable<System::SharedPtr<MboxMessageInfo> > > Aspose::Email::Storage::Mbox::MboxStorageReader::EnumerateMessageInfo | ( | System::SharedPtr< Tools::Search::MailQuery > | query | ) |
Enumerates the message information that matches the specified query.
| query | The MailQuery used to filter messages. |
| 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.
| System::SharedPtr<System::Collections::Generic::IEnumerable<System::SharedPtr<MailMessage> > > Aspose::Email::Storage::Mbox::MboxStorageReader::EnumerateMessages | ( | int32_t | startIndex, |
| int32_t | count | ||
| ) |
Enumerates a specified number of mail messages, starting from the given index.
| startIndex | The zero-based index of the first message to retrieve. If startIndex is greater than or equal to the total number of items, an ArgumentOutOfRangeException is thrown. |
| count | The maximum number of messages to retrieve. If set to -1, all messages from the start index will be read. |
| ArgumentOutOfRangeException | Thrown when startIndex is greater than or equal to the total number of available messages. |
| 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.
| options | Specifies EmlLoadOptions when reading message from Mbox storage. |
| System::SharedPtr<System::Collections::Generic::IEnumerable<System::SharedPtr<MailMessage> > > Aspose::Email::Storage::Mbox::MboxStorageReader::EnumerateMessages | ( | System::SharedPtr< EmlLoadOptions > | options, |
| int32_t | startIndex, | ||
| int32_t | count | ||
| ) |
Enumerates a specified number of mail messages, starting from the given index, using the provided load options.
| options | The EmlLoadOptions specifying how EML files should be loaded. |
| startIndex | The zero-based index of the first message to retrieve. If startIndex is greater than or equal to the total number of items, an ArgumentOutOfRangeException is thrown. |
| count | The maximum number of messages to retrieve. If set to -1, all messages from the start index will be read. |
| ArgumentOutOfRangeException | Thrown when startIndex is greater than or equal to the total number of available messages. |
| System::SharedPtr<System::Collections::Generic::IEnumerable<System::SharedPtr<MailMessage> > > Aspose::Email::Storage::Mbox::MboxStorageReader::EnumerateMessages | ( | System::SharedPtr< EmlLoadOptions > | options, |
| System::SharedPtr< Tools::Search::MailQuery > | query | ||
| ) |
Enumerates the mail messages that match the specified query, using the provided load options.
| options | The EmlLoadOptions specifying how EML should be read. |
| query | The MailQuery used to filter messages. |
| System::SharedPtr<System::Collections::Generic::IEnumerable<System::SharedPtr<MailMessage> > > Aspose::Email::Storage::Mbox::MboxStorageReader::EnumerateMessages | ( | System::SharedPtr< Tools::Search::MailQuery > | query | ) |
Enumerates the mail messages that match the specified query.
| query | The MailQuery used to filter messages. |
| System::SharedPtr<MailMessage> Aspose::Email::Storage::Mbox::MboxStorageReader::ExtractMessage | ( | System::String | id, |
| System::SharedPtr< EmlLoadOptions > | options | ||
| ) |
Get the message from MBOX.
| id | String representation of EntryId. |
| options | Specifies EmlLoadOptions when reading message from Mbox storage. |
| System::SharedPtr<System::IO::Stream> Aspose::Email::Storage::Mbox::MboxStorageReader::get_BaseStream | ( | ) | const |
Gets the base stream.
The base stream.
| int64_t Aspose::Email::Storage::Mbox::MboxStorageReader::get_CurrentDataSize | ( | ) | const |
Gets the number of bytes that is read by ReadNextMessage method.
|
pure virtual |
Returns the number of messages in a storage.
Implemented in Aspose::Email::Storage::Mbox::MboxrdStorageReader, and Aspose::Email::Storage::Mbox::MboxoStorageReader.
| VentureLicenseState Aspose::Email::Storage::Mbox::MboxStorageReader::GetVentureLicenseState | ( | ) |
|
pure virtual |
Gets the next message info.
Implemented in Aspose::Email::Storage::Mbox::MboxrdStorageReader, and Aspose::Email::Storage::Mbox::MboxoStorageReader.
|
pure virtual |
|
static |
Reads the line from stream.
| stream | The stream. |
|
pure virtual |
Reads the next message from underlying storage stream.
Implemented in Aspose::Email::Storage::Mbox::MboxrdStorageReader, and Aspose::Email::Storage::Mbox::MboxoStorageReader.
|
pure virtual |
Reads the next message from underlying storage stream.
| options | Specifies EmlLoadOptions when reading message from Mbox storage. |
Implemented in Aspose::Email::Storage::Mbox::MboxrdStorageReader, and Aspose::Email::Storage::Mbox::MboxoStorageReader.
|
pure virtual |
|
pure virtual |
Reads the next message from underlying storage stream.
| fromMarker | Gets the From Marker while parsing the MBox Storage file. |
Implemented in Aspose::Email::Storage::Mbox::MboxrdStorageReader, and Aspose::Email::Storage::Mbox::MboxoStorageReader.
|
pure virtual |
Reads the next message from underlying storage stream.
| fromMarker | Gets the From Marker while parsing the MBox Storage file. |
| options | Specifies EmlLoadOptions when reading message from Mbox storage. |
Implemented in Aspose::Email::Storage::Mbox::MboxrdStorageReader, and Aspose::Email::Storage::Mbox::MboxoStorageReader.
|
protected |
Gets the number of bytes that is read by ReadNextMessage method.
|
pure virtual |
| void Aspose::Email::Storage::Mbox::MboxStorageReader::SplitInto | ( | int64_t | chunkSize, |
| System::String | outputPath | ||
| ) |
Splits the mbox storage into less sized parts.
| chunkSize | The approximate size of a chunk in bytes. |
| outputPath | The folder path where chunks will be created. |
| ArgumentException | Throws when the path parameter is null or empty. |
| void Aspose::Email::Storage::Mbox::MboxStorageReader::SplitInto | ( | int64_t | chunkSize, |
| System::String | outputPath, | ||
| System::String | partFileNamePrefix | ||
| ) |
Splits the mbox storage into less sized parts.
| chunkSize | The approximate size of a chunk in bytes. | ||
| outputPath | The folder path where chunks will be created. | ||
| partFileNamePrefix | The prefix to be added to the filename of each part of pst.
|
|
friend |
|
friend |
| System::Event<void(System::SharedPtr<System::Object>, System::SharedPtr<Aspose::Email::Storage::MimeItemCopyEventArgs>)> Aspose::Email::Storage::Mbox::MboxStorageReader::EmlCopied |
Event that occurs after successful copy of a MailMessage object within the SplitInto(long, string) method.
| System::Event<void(System::SharedPtr<System::Object>, System::SharedPtr<Aspose::Email::Storage::MimeItemCopyEventArgs>)> Aspose::Email::Storage::Mbox::MboxStorageReader::EmlCopying |
Event that occurs before the MailMessage object copy process, within the SplitInto(long, string) method.
|
static |
|
static |
|
static |
|
static |
"From " signature, indicates a start of the message.
| System::Event<void(System::SharedPtr<System::Object>, System::SharedPtr<Aspose::Email::Storage::NewStorageEventArgs>)> Aspose::Email::Storage::Mbox::MboxStorageReader::MboxFileCreated |
Event that occurs when a new MBOX file is created during the SplitInto(long, string) method.
| System::Event<void(System::SharedPtr<System::Object>, System::SharedPtr<Aspose::Email::Storage::NewStorageEventArgs>)> Aspose::Email::Storage::Mbox::MboxStorageReader::MboxFileFilled |
Event that occurs after filling an MBOX file with data within the SplitInto(long, string) method.
|
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 ???@???'
| int32_t Aspose::Email::Storage::Mbox::MboxStorageReader::msgCount |
| System::SharedPtr<System::Object> Aspose::Email::Storage::Mbox::MboxStorageReader::mVentureLicense |
|
protected |