@@ -8,6 +8,18 @@ namespace Nager.EmailAuthentication
8
8
/// </summary>
9
9
public static class DmarcRecordParser
10
10
{
11
+ /// <summary>
12
+ /// Attempts to parse a raw DMARC record string into a <see cref="DmarcRecord"/> object.
13
+ /// </summary>
14
+ /// <param name="dmarcRaw">The raw DMARC record string to be parsed.</param>
15
+ /// <param name="dmarcRecord">
16
+ /// When this method returns, contains the parsed <see cref="DmarcRecord"/> if the parsing succeeded;
17
+ /// otherwise, <c>null</c>.
18
+ /// </param>
19
+ /// <returns>
20
+ /// <c>true</c> if the parsing was successful (i.e., all required fields are present and valid);
21
+ /// otherwise, <c>false</c>.
22
+ /// </returns>
11
23
public static bool TryParse (
12
24
string ? dmarcRaw ,
13
25
[ NotNullWhen ( true ) ] out DmarcRecord ? dmarcRecord )
@@ -21,6 +33,23 @@ public static bool TryParse(
21
33
return TryParse ( dataFragment , out dmarcRecord ) ;
22
34
}
23
35
36
+ /// <summary>
37
+ /// Attempts to parse a raw DMARC record string into a <see cref="DmarcRecord"/> object while also
38
+ /// returning additional parsing details.
39
+ /// </summary>
40
+ /// <param name="dmarcRaw">The raw DMARC record string to be parsed.</param>
41
+ /// <param name="dmarcRecord">
42
+ /// When this method returns, contains the parsed <see cref="DmarcRecord"/> if the parsing succeeded;
43
+ /// otherwise, <c>null</c>.
44
+ /// </param>
45
+ /// <param name="parsingResults">
46
+ /// When this method returns, contains an array of <see cref="ParsingResult"/> objects with additional details
47
+ /// (such as warnings or informational messages) regarding the parsing process. This value may be <c>null</c>
48
+ /// if the parsing did not occur.
49
+ /// </param>
50
+ /// <returns>
51
+ /// <c>true</c> if the parsing was successful; otherwise, <c>false</c>.
52
+ /// </returns>
24
53
public static bool TryParse (
25
54
string ? dmarcRaw ,
26
55
[ NotNullWhen ( true ) ] out DmarcRecord ? dmarcRecord ,
@@ -35,6 +64,20 @@ public static bool TryParse(
35
64
return TryParse ( dataFragment , out dmarcRecord ) ;
36
65
}
37
66
67
+ /// <summary>
68
+ /// Attempts to convert a <see cref="DmarcRecordDataFragment"/> into a fully validated
69
+ /// <see cref="DmarcRecord"/> by parsing and validating all required DMARC fields.
70
+ /// </summary>
71
+ /// <param name="dmarcDataFragment">
72
+ /// The <see cref="DmarcRecordDataFragment"/> containing individual DMARC parameter strings to be parsed.
73
+ /// </param>
74
+ /// <param name="dmarcRecord">
75
+ /// When this method returns, contains the parsed and validated <see cref="DmarcRecord"/> if successful;
76
+ /// otherwise, <c>null</c>.
77
+ /// </param>
78
+ /// <returns>
79
+ /// <c>true</c> if the conversion and validation were successful; otherwise, <c>false</c>.
80
+ /// </returns>
38
81
public static bool TryParse (
39
82
DmarcRecordDataFragment dmarcDataFragment ,
40
83
[ NotNullWhen ( true ) ] out DmarcRecord ? dmarcRecord )
0 commit comments