DnsFilterParseResult Class

The outcome of parsing a filter list: the rules that were understood, and a diagnostic for every line that was not.

public sealed class DnsFilterParseResult

Remarks

Filter lists are third-party input. A list that silently produces far fewer rules than it has lines — because it was served as an HTML error page, or uses modifiers this library does not implement — is indistinguishable from a healthy one if only the rule count is inspected. Callers that load lists unattended should log or alarm on DnsFilterParseResult.Diagnostics.

Properties

NameDescription
DiagnosticsGets a diagnostic for each line that did not produce a rule. Empty when the whole list was understood.
FormatGets the format the list was parsed as. Useful when DnsFilterListFormat.AutoDetect was requested.
RulesGets the rules parsed from the list.

Gets a diagnostic for each line that did not produce a rule. Empty when the whole list was understood.

public IReadOnlyList<DnsFilterParseDiagnostic> Diagnostics { get; }

Gets the format the list was parsed as. Useful when DnsFilterListFormat.AutoDetect was requested.

public DnsFilterListFormat Format { get; }

Property value

DnsFilterListFormat

Gets the rules parsed from the list.

public IReadOnlyList<DnsFilterRule> Rules { get; }