/*========================================================*/ public static FstFile ParseServerFile ( IrbisConnection client, string fileName ) { FstFile result = new FstFile(); FileSpecification specification = new FileSpecification ( IrbisPath.MasterFile, fileName ); string content = client.ReadTextFile(specification); content = content.Replace("\r", string.Empty); foreach (string textLine in content.Split ( new[] { '\n' }, StringSplitOptions.RemoveEmptyEntries )) { FstLine fstLine = FstLine.ParseLine(textLine); if (fstLine != null) { result.Lines.Add(fstLine); } } return(result); }
/*========================================================*/ public static FstFile ParseLocalFile ( string fileName ) { FstFile result = new FstFile(); using (StreamReader reader = new StreamReader ( fileName, Encoding.Default )) { string textLine; while ((textLine = reader.ReadLine()) != null) { FstLine fstLine = FstLine.ParseLine(textLine); if (fstLine != null) { result.Lines.Add(fstLine); } } } return(result); }