forked from subtract1/GoodMerge2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLineParser.cs
More file actions
36 lines (32 loc) · 908 Bytes
/
Copy pathLineParser.cs
File metadata and controls
36 lines (32 loc) · 908 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.IO;
namespace GoodMerge {
public class LineParser {
#region <Variables>
private StreamReader file;
private bool open;
private string curLine;
#endregion
public LineParser(string name) {
try {
file = new StreamReader(name);
open = true;
}
catch { open = false; }
}
~LineParser() {
if (open) {
try { file.Close(); }
catch { }
}
}
public string GetNextLine() {
if (!open) return null;
do {
try { curLine = file.ReadLine(); }
catch { return null; }
} while (curLine!=null && (curLine.StartsWith(";") || curLine.Equals("")));
return curLine;
}
}
}