From 2a1cd4fda8a4a8e649910d16b4dfa1ce7ae63543 Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Fri, 12 May 2023 09:24:40 +0800 Subject: *misc --- .../CsvHelper-master/src/CsvHelper/IWriter.cs | 86 ++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 ThirdParty/CsvHelper-master/src/CsvHelper/IWriter.cs (limited to 'ThirdParty/CsvHelper-master/src/CsvHelper/IWriter.cs') diff --git a/ThirdParty/CsvHelper-master/src/CsvHelper/IWriter.cs b/ThirdParty/CsvHelper-master/src/CsvHelper/IWriter.cs new file mode 100644 index 0000000..f181b0d --- /dev/null +++ b/ThirdParty/CsvHelper-master/src/CsvHelper/IWriter.cs @@ -0,0 +1,86 @@ +// Copyright 2009-2022 Josh Close +// This file is a part of CsvHelper and is dual licensed under MS-PL and Apache 2.0. +// See LICENSE.txt for details or visit http://www.opensource.org/licenses/ms-pl.html for MS-PL and http://opensource.org/licenses/Apache-2.0 for Apache 2.0. +// https://github.com/JoshClose/CsvHelper +using System; +using System.Collections; +using System.IO; +using System.Threading.Tasks; +using System.Collections.Generic; +using System.Threading; + +namespace CsvHelper +{ + /// + /// Defines methods used to write to a CSV file. + /// + public interface IWriter : IWriterRow, IDisposable +#if !NET45 && !NET47 && !NETSTANDARD2_0 + , IAsyncDisposable +#endif + { + /// + /// Flushes the internal buffer to the then + /// flushes the . + /// + void Flush(); + + /// + /// Flushes the internal buffer to the then + /// flushes the . + /// + Task FlushAsync(); + + /// + /// Ends writing of the current record and starts a new record. + /// This flushes the buffer to the but + /// does not flush the . + /// + void NextRecord(); + + /// + /// Ends writing of the current record and starts a new record. + /// This flushes the buffer to the but + /// does not flush the . + /// + Task NextRecordAsync(); + + /// + /// Writes the list of records to the CSV file. + /// + /// The records to write. + void WriteRecords(IEnumerable records); + + /// + /// Writes the list of records to the CSV file. + /// + /// Record type. + /// The records to write. + void WriteRecords(IEnumerable records); + + /// + /// Writes the list of records to the CSV file. + /// + /// The records to write. + /// The cancellation token to stop the writing. + Task WriteRecordsAsync(IEnumerable records, CancellationToken cancellationToken = default); + + /// + /// Writes the list of records to the CSV file. + /// + /// Record type. + /// The records to write. + /// The cancellation token to stop the writing. + Task WriteRecordsAsync(IEnumerable records, CancellationToken cancellationToken = default); + +#if !NET45 + /// + /// Writes the list of records to the CSV file. + /// + /// Record type. + /// The records to write. + /// The cancellation token to stop the writing. + Task WriteRecordsAsync(IAsyncEnumerable records, CancellationToken cancellationToken = default); +#endif + } +} -- cgit v1.1-26-g67d0