/// <summary> /// Creates a <see cref="NmeaLineToAisStreamAdapter"/>. /// </summary> /// <param name="messageProcessor"> /// The message process to which complete AIS messages are to be passed. /// </param> /// <param name="options">Configures parser behaviour.</param> public NmeaLineToAisStreamAdapter( INmeaAisMessageStreamProcessor messageProcessor, NmeaParserOptions options) { this.messageProcessor = messageProcessor; this.options = options; }
/// <summary> /// Process the contents of a file one AIS message at a time. /// </summary> /// <param name="path">Path of the file to process.</param> /// <param name="processor">Handler for the AIS messages.</param> /// <param name="options">Configures parser behaviour.</param> /// <returns>A task that completes when the stream has been processed.</returns> /// <remarks> /// This reassembles AIS messages that have been split over multiple NMEA lines. /// </remarks> public static async Task ParseFileAsync( string path, INmeaAisMessageStreamProcessor processor, NmeaParserOptions options) { using var adapter = new NmeaLineToAisStreamAdapter(processor, options); await ParseFileAsync(path, adapter, options).ConfigureAwait(false); }
/// <summary> /// Process the contents of a file one AIS message at a time. /// </summary> /// <param name="path">Path of the file to process.</param> /// <param name="processor">Handler for the AIS messages.</param> /// <returns>A task that completes when the stream has been processed.</returns> /// <remarks> /// This reassembles AIS messages that have been split over multiple NMEA lines. /// </remarks> public static async Task ParseFileAsync( string path, INmeaAisMessageStreamProcessor processor) { using (var adapter = new NmeaLineToAisStreamAdapter(processor)) { await ParseFileAsync(path, adapter).ConfigureAwait(false); } }
/// <summary> /// Creates a <see cref="NmeaLineToAisStreamAdapter"/>. /// </summary> /// <param name="messageProcessor"> /// The message process to which complete AIS messages are to be passed. /// </param> public NmeaLineToAisStreamAdapter(INmeaAisMessageStreamProcessor messageProcessor) : this(messageProcessor, new NmeaParserOptions()) { }
/// <summary> /// Process the contents of a file one AIS message at a time. /// </summary> /// <param name="path">Path of the file to process.</param> /// <param name="processor">Handler for the AIS messages.</param> /// <returns>A task that completes when the stream has been processed.</returns> /// <remarks> /// This reassembles AIS messages that have been split over multiple NMEA lines. /// </remarks> public static Task ParseFileAsync( string path, INmeaAisMessageStreamProcessor processor) { return(ParseFileAsync(path, processor, new NmeaParserOptions())); }
/// <summary> /// Creates a <see cref="NmeaLineToAisStreamAdapter"/>. /// </summary> /// <param name="messageProcessor"> /// The message process to which complete AIS messages are to be passed. /// </param> public NmeaLineToAisStreamAdapter(INmeaAisMessageStreamProcessor messageProcessor) { this.messageProcessor = messageProcessor; }