public static LrpQuoteEntry[] ReadQuoteEntryArray(this TextStream stream, string name = null) { if (name != null) { stream.ValidateVerbatimText(name); stream.ValidateVerbatimText(" = "); } stream.ValidateVerbatimText('['); var count = stream.ReadInt32(); stream.ValidateVerbatimText("]{"); var result = new LrpQuoteEntry[count]; if (count > 0) { var _value = stream.ReadQuoteEntry(null); result[0] = _value; stream.ValidateVerbatimText(";"); } for (int index = 1; index < count; ++index) { stream.ValidateVerbatimText(" "); var _value = stream.ReadQuoteEntry(null); result[index] = _value; stream.ValidateVerbatimText(";"); } stream.ValidateVerbatimText('}'); return(result); }
public static LrpQuote ReadQuote(this TextStream stream, string name = null) { if (null != name) { stream.ValidateVerbatimText(name); stream.ValidateVerbatimText(" = "); } var result = new LrpQuote(); stream.ValidateVerbatimText('{'); result.Symbol = stream.ReadAString("Symbol"); stream.ValidateVerbatimText(';'); result.CreatingTime = stream.ReadTime("CreatingTime"); stream.ValidateVerbatimText(';'); result.Bids = stream.ReadQuoteEntryArray("Bids"); stream.ValidateVerbatimText(';'); result.Asks = stream.ReadQuoteEntryArray("Asks"); stream.ValidateVerbatimText(';'); result.Id = stream.ReadAString("Id"); stream.ValidateVerbatimText(';'); stream.ValidateVerbatimText('}'); return(result); }
public static LrpQuoteEntry ReadQuoteEntry(this TextStream stream, string name = null) { if (name != null) { stream.ValidateVerbatimText(name); stream.ValidateVerbatimText(" = "); } var result = new LrpQuoteEntry(); stream.ValidateVerbatimText('{'); result.Price = stream.ReadDouble("Price"); stream.ValidateVerbatimText(';'); result.Volume = stream.ReadDouble("Volume"); stream.ValidateVerbatimText(';'); stream.ValidateVerbatimText('}'); return(result); }