Example #1
0
        /*========================================================*/

        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);
        }
Example #2
0
        /*========================================================*/

        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);
        }