Beispiel #1
0
        public RecordField DecodeField(MstDictionaryEntry entry)
        {
            string catenated = string.Format
                               (
                "{0}#{1}",
                entry.Tag,
                entry.Text
                               );

            RecordField result = RecordField.Parse(catenated);

            return(result);
        }
Beispiel #2
0
        public IrbisRecord MergeParse
        (
            string[] text,
            int skipLines
        )
        {
            if (skipLines > 0)
            {
                text = text.Skip(skipLines).ToArray();
            }

            if (text.Length > 2)
            {
                Regex regex = new Regex(@"^(-?\d+)\#(\d*)?");
                Match match = regex.Match(text[0]);
                Mfn = Math.Abs(int.Parse(match.Groups[1].Value));
                if (match.Groups[2].Length > 0)
                {
                    Status = (RecordStatus)int.Parse(match.Groups[2].Value);
                }
                match = regex.Match(text[1]);
                if (match.Groups[2].Length > 0)
                {
                    Version = int.Parse(match.Groups[2].Value);
                }
            }

            foreach (string line in text.Skip(2))
            {
                RecordField field = RecordField.Parse(line);
                if (field != null)
                {
                    Fields.Add(field);
                }
            }

            return(this);
        }