Esempio n. 1
0
 /// <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);
 }
Esempio n. 2
0
 /// <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);
     }
 }