4using System.Threading.Tasks;
36 private static readonly
string[] contentTypes =
new string[] {
ContentType };
71 if (
string.Compare(FileExtension,
"dsn",
true) == 0)
94 FileExtension =
"dsn";
98 FileExtension =
string.Empty;
114 KeyValuePair<string, string>[] Fields, Uri BaseUri,
ICodecProgress Progress)
117 List<string[]> Sections =
new List<string[]>();
118 List<string> Section =
new List<string>();
120 foreach (
string Row
in Dsn.Replace(
"\r\n",
"\n").Replace(
"\r",
"\n").Split(
'\n'))
122 if (
string.IsNullOrEmpty(Row))
124 if (Section.Count > 0)
126 Sections.Add(Section.ToArray());
132 if (Row[0] <=
' ' && Section.Count > 0)
133 Section[Section.Count - 1] += Row;
139 if (Section.Count > 0)
141 Sections.Add(Section.ToArray());
147 int i, c = Sections.Count;
159 for (i = 1; i < c; i++)
Contains information about a response to a content request.
Decodes Delivery Status information, as defined in RFC 3464:
DeliveryStatusDecoder()
Decodes Delivery Status information, as defined in RFC 3464:
Task< ContentResponse > DecodeAsync(string ContentType, byte[] Data, Encoding Encoding, KeyValuePair< string, string >[] Fields, Uri BaseUri, ICodecProgress Progress)
Decodes an object.
bool TryGetContentType(string FileExtension, out string ContentType)
Tries to get the content type of an item, given its file extension.
string[] FileExtensions
Supported file extensions.
bool Decodes(string ContentType, out Grade Grade)
If the decoder decodes an object with a given content type.
const string ContentType
message/delivery-status
bool TryGetFileExtension(string ContentType, out string FileExtension)
Tries to get the file extension of an item, given its Content-Type.
string[] ContentTypes
Supported content types.
Delivery Status information, as defined in RFC 3464:
Information fields for the message.
Information fields for one recipient.
Static class managing binary representations of strings.
static string GetString(byte[] Data, int Offset, int Count, Encoding DefaultEncoding)
Gets a string from its binary representation, taking any Byte Order Mark (BOM) into account.
Interface for reporting progress about an encoding or decoding.
Basic interface for Internet Content decoders. A class implementing this interface and having a defau...