You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/LogSplit/Parser.cs
+13-3Lines changed: 13 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,29 @@
1
1
usingSystem;
2
2
usingSystem.Collections.Generic;
3
-
usingSystem.Linq;
4
3
5
4
namespaceLogSplit
6
5
{
6
+
/// <summary>
7
+
/// A parser that separates a string based on the pattern provided
8
+
/// </summary>
7
9
publicclassParser
8
10
{
9
11
privatereadonlystring_pattern;
10
12
13
+
/// <summary>
14
+
/// Creates a new parser that uses the pattern to split a string
15
+
/// </summary>
16
+
/// <param name="pattern"></param>
11
17
publicParser(stringpattern)
12
18
{
13
19
_pattern=pattern;
14
20
}
15
21
22
+
/// <summary>
23
+
/// Parse the string based on the pattern
24
+
/// </summary>
25
+
/// <param name="value"></param>
26
+
/// <returns></returns>
16
27
publicParserResultParse(stringvalue)
17
28
{
18
29
varsplits=SplitPattern(_pattern);
@@ -46,13 +57,12 @@ public ParserResult Parse(string value)
46
57
47
58
if(nextSplit<=0)
48
59
{
49
-
//errors.Add($"Could not split value due to invalid pattern\n - Value: \"{value}\"\n - Invalid delimeter: \"{scan.Separator}\".\n - Preceding pattern: \"{scan.Pattern.Pattern}\"");
0 commit comments