Export: Refactor interfaces and classes

This commit is contained in:
2023-09-07 00:44:28 +02:00
parent be734b880f
commit f9d95a48f2
8 changed files with 163 additions and 36 deletions

View File

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Elwig.Helpers.Export {
public interface IExporter<T> : IDisposable, IAsyncDisposable {
/// <summary>
/// The default file extension of the exported files to be used (whithout a preceding ".")
/// </summary>
static string FileExtension { get; }
/// <summary>
/// Export the given data to the given file.
/// </summary>
/// <param name="data">The data to be exported</param>
void Export(IEnumerable<T> data);
/// <summary>
/// Export the given data to the given file.
/// </summary>
/// <param name="data">The data to be exported</param>
Task ExportAsync(IEnumerable<T> data);
}
}