ReadLine() public method

public ReadLine ( char buffer, int index, int count ) : int
buffer char
index int
count int
return int
Example #1
0
		private void Parse (IRunner runner)
		{
			char [] buffer = new char [4096];
			while (files.Count > 0) {
				string fileName = files.Pop ();
				using (StreamLineReader sr = new StreamLineReader (fileName)) {
					while (!sr.EndOfStream) {
						int length = sr.ReadLine (buffer, 0, buffer.Length);
                        ProcessLine(runner, buffer, length);
					}
				}
			}
			Resolve ();
			TearDown ();
		}
		private static HashSet<string> Read (StreamLineReader reader)
		{
			HashSet<string> set = new HashSet<string> ();
			while (!reader.EndOfStream) {
				int length = reader.ReadLine (buffer, 0, buffer.Length);
				set.Add (new string (buffer, 0, length));
			}
			return set;
		}
		private static Dictionary<string, string> ReadWithComments (StreamLineReader reader)
		{
			Dictionary<string, string> dict = new Dictionary<string, string> ();
			while (!reader.EndOfStream) {
				int length = reader.ReadLine (buffer, 0, buffer.Length);
				int pos = Array.IndexOf (buffer, '-');
				string key = new string (buffer, 0, pos);
				string comment = (buffer [length - 1] == '-') ? null :
					new string (buffer, pos + 1, length - pos - 1);
				dict.Add (key, comment);
			}
			return dict;
		}