Exemple #1
0
        public MIOutput ParseOutput(string[] output)
        {
            var            outOfBandRecordList = new List <MIOutOfBandRecord>();
            MIResultRecord resultRecord        = null;
            int            i = 0;

            while (IsOutOfBandRecord(output[i]))
            {
                outOfBandRecordList.Add(ParseOutOfBandRecord(output[i]));
                i++;
            }

            if (IsResultRecord(output[i]))
            {
                resultRecord = ParseResultRecord(output[i]);
                i++;
            }

            if (!IsEnd(output[i]))
            {
                throw new MIParserException();
            }

            return(new MIOutput(outOfBandRecordList.ToArray(), resultRecord));
        }
Exemple #2
0
        public MIOutput ParseOutput(string[] output)
        {
            var            outOfBandRecordList = new List <MIOutOfBandRecord>();
            MIResultRecord resultRecord        = null;
            int            i = 0;

            while (IsOutOfBandRecord(output[i]))
            {
                outOfBandRecordList.Add(ParseOutOfBandRecord(output[i]));
                i++;
            }

            if (IsResultRecord(output[i]))
            {
                resultRecord = ParseResultRecord(output[i]);
                i++;
            }

            // we still could get async record after result (for example "=library-loaded" or "=thread-created")
            while (IsOutOfBandRecord(output[i]))
            {
                outOfBandRecordList.Add(ParseOutOfBandRecord(output[i]));
                i++;
            }

            if (!IsEnd(output[i]))
            {
                throw new MIParserException();
            }

            return(new MIOutput(outOfBandRecordList.ToArray(), resultRecord));
        }