Example #1
0
        public static Nav Parse(string pathToDb)
        {
            var pathToFile = Path.Combine(pathToDb, "NAV.txt");
            var lines      = File.ReadAllLines(pathToFile);

            var nav = new Nav();

            foreach (var line in lines)
            {
                using (var reader = new StringReader(line))
                {
                    var recordTypeBuffer = new char[4];
                    reader.Read(recordTypeBuffer);
                    var recordType = new string(recordTypeBuffer);

                    switch (recordType)
                    {
                    case "NAV1":
                        var nav1Record = RecordParser.Parse <Nav1Record>(reader);
                        nav.Nav1Records.Add(nav1Record);
                        break;
                    }
                }
            }

            return(nav);
        }
Example #2
0
        public static Arb Parse(string pathToDb)
        {
            var pathToFile = Path.Combine(pathToDb, "ARB.txt");
            var lines      = File.ReadAllLines(pathToFile);

            var arb = new Arb();

            foreach (var line in lines)
            {
                using (var reader = new StringReader(line))
                {
                    var arb1 = RecordParser.Parse <Arb1Record>(reader);
                    arb.Arb1Record.Add(arb1);
                }
            }

            return(arb);
        }
Example #3
0
        public static Fss Parse(string pathToDb)
        {
            var pathToFile = Path.Combine(pathToDb, "FSS.txt");
            var lines      = File.ReadAllLines(pathToFile);

            var fss = new Fss();

            foreach (var line in lines)
            {
                using (var reader = new StringReader(line))
                {
                    var fssRecord = RecordParser.Parse <FssRecord>(reader);
                    fss.FssRecords.Add(fssRecord);
                }
            }

            return(fss);
        }
Example #4
0
        public static Com Parse(string pathToDb)
        {
            var pathToFile = Path.Combine(pathToDb, "COM.txt");
            var lines      = File.ReadAllLines(pathToFile);

            var com = new Com();

            foreach (var line in lines)
            {
                using (var reader = new StringReader(line))
                {
                    var fssRecord = RecordParser.Parse <ComRecord>(reader);
                    com.ComRecords.Add(fssRecord);
                }
            }

            return(com);
        }
Example #5
0
        public static Aff Parse(string pathToDb)
        {
            var pathToFile = Path.Combine(pathToDb, "AFF.txt");
            var lines      = File.ReadAllLines(pathToFile);

            var aff = new Aff();

            foreach (var line in lines)
            {
                using (var reader = new StringReader(line))
                {
                    var recordTypeBuffer = new char[4];
                    reader.Read(recordTypeBuffer);
                    var recordType = new string(recordTypeBuffer);

                    switch (recordType)
                    {
                    case "AFF1":
                        var aff1 = RecordParser.Parse <Aff1Record>(reader);
                        aff.Aff1Records.Add(aff1);
                        break;

                    case "AFF2":
                        var aff2 = RecordParser.Parse <Aff2Record>(reader);
                        aff.Aff2Records.Add(aff2);
                        break;

                    case "AFF3":
                        var aff3 = RecordParser.Parse <Aff3Record>(reader);
                        aff.Aff3Records.Add(aff3);
                        break;

                    case "AFF4":
                        var aff4 = RecordParser.Parse <Aff4Record>(reader);
                        aff.Aff4Records.Add(aff4);
                        break;
                    }
                }
            }

            return(aff);
        }