public override void Read(ReadArgs args) { args.SetValues(); args.CurrentSeqNo = ExpectNextSeqNo(args); int readChar = args.ReadOne(); if (readChar == iRefPrefix) { args.State = ReaderInstance.Singleton; } else if (readChar == iArray) { readChar = args.ReadOne(); if (readChar != iFieldSep) { throw Error.Unexpected(ErrorCode.UnexpectedChars, FieldSeparator, readChar); } ArrayRecord rec = new ArrayRecord(args.CurrentSeqNo); args.SetupRecord(rec); args.Read.Read(rec); args.State = ReaderField.Singleton; } else if (readChar == iStringEncl) { args.State = ReaderTypeDef.Singleton; } else { throw new Error(ErrorCode.UnknownRecordType).AddData(ErrorDataKeys.Actual, readChar); } }
public override void Read(ReadArgs args) { // sequence no, opening quote of type name has been read, TypeDefRecord rec = new TypeDefRecord(args.CurrentSeqNo, base.ReadStringStrict(args, false), ReadMembers(args)); args.SetupRecord(rec); args.Read.Read(rec); //ReadMembers(args, rec); }
public override void Read(ReadArgs args) { Record refRec = base.ReadRef(args, false); if (refRec.RecType != RecordType.TypeDef) { throw Error.Unexpected(ErrorCode.UnexpectedRecordType, RecordType.TypeDef, refRec.RecType); } TypeDefRecord refType = refRec as TypeDefRecord; InstanceRecord rec = new InstanceRecord(args.CurrentSeqNo, refType); args.SetupRecord(rec); args.Read.Read(rec); // base.ReadRef must have already set the next state }