MorkDocument Class
A Mork database: the text format of the summaries of the folders of Thunderbird (.msf) and of its old address books (.mab). It has tables of rows, and cells by column name; the dictionaries, the transactions (groups) and the updates of the file are applied when it is read.
public sealed class MorkDocumentExample
var document = MorkDocument.Load(path);
var table = document.FindTable("ns:msg:db:table:kind:msgs")!;
Assert.Equal("First", table.Rows[0]["subject"]);
Assert.Equal("Café", table.Rows[1]["subject"]);Constructors
| Name | Description |
|---|---|
| MorkDocument() |
MorkDocument()
MorkDocument.cspublic MorkDocument()No documentation is available.
Properties
| Name | Description |
|---|---|
| Rows | Gets the rows, in the tables or not, in the order of the file. |
| Tables | Gets the tables, in the order of the file. |
Rows
MorkDocument.csGets the rows, in the tables or not, in the order of the file.
public IReadOnlyList<MorkRow> Rows { get; }Property value
Tables
MorkDocument.csGets the tables, in the order of the file.
public IReadOnlyList<MorkTable> Tables { get; }Property value
Methods
| Name | Description |
|---|---|
| FindTable(string) | Returns the first table of a kind. |
| GetOrAddRow(string, string) | Returns a row, and creates it when the database does not have it. |
| GetOrAddTable(string, string, string?) | Returns a table, and creates it when the database does not have it. |
| Load(Stream) | Reads a Mork database from a stream, until its end. |
| Load(ReadOnlySpan<byte>) | Reads a Mork database. |
| Load(string) | Reads a Mork database, such as an .msf file. |
| Save(Stream) | Writes the database: a dictionary of the names of the columns and of the scopes, then the tables and the rows that are in no table. |
| Save(string) | Writes the database in a file. |
FindTable(string)
MorkDocument.csReturns the first table of a kind.
Parameters
kindstring- The kind, such as
ns:msg:db:table:kind:msgs.
Returns
MorkTable? The table, or null when the database has none of this kind.
GetOrAddRow(string, string)
MorkDocument.csGetOrAddTable(string, string, string?)
MorkDocument.csReturns a table, and creates it when the database does not have it.
Load overloads
Load(Stream)
MorkDocument.csReads a Mork database from a stream, until its end.
public static MorkDocument Load(Stream stream)Parameters
streamStream- The stream.
Returns
MorkDocument The database.
Exceptions
InvalidEmailDataException- The content is not a Mork database.
EmailResourceLimitException- The content is larger than 512 MB.
Load(ReadOnlySpan<byte>)
MorkDocument.csReads a Mork database.
public static MorkDocument Load(ReadOnlySpan<byte> data)Parameters
dataReadOnlySpan<byte>- The content of the file.
Returns
MorkDocument The database.
Exceptions
InvalidEmailDataException- The content is not a Mork database.
Load(string)
MorkDocument.csReads a Mork database, such as an .msf file.
public static MorkDocument Load(string path)Parameters
pathstring- The path of the file.
Returns
MorkDocument The database.
Exceptions
InvalidEmailDataException- The content is not a Mork database.
EmailResourceLimitException- The content is larger than 512 MB.