Hide implement class for user

This commit is contained in:
wei 2021-04-03 12:46:12 +08:00
parent 0d601dd0df
commit 5ae0319bba
4 changed files with 25 additions and 24 deletions

View File

@ -5,7 +5,8 @@ namespace MiniExcelLibs.Csv
{
public class CsvConfiguration : IConfiguration
{
public char Seperator { get; set; } = ',';
public char Seperator { get; set; } = ',';
public Func<Stream, StreamReader> GetStreamReaderFunc { get; set; } = (stream) => new StreamReader(stream);
}
}

View File

@ -3,31 +3,31 @@ using System.IO;
namespace MiniExcelLibs.Csv
{
public class CsvProvider : ExcelProviderBase
{
private IExcelReader _csvlReader;
private IExcelWriter _csvWriter;
public CsvProvider()
{
_csvWriter = new CsvWriter();
_csvlReader = new CsvReader();
}
internal class CsvProvider : ExcelProviderBase
{
private IExcelReader _csvlReader;
private IExcelWriter _csvWriter;
public CsvProvider()
{
_csvWriter = new CsvWriter();
_csvlReader = new CsvReader();
}
public override IEnumerable<IDictionary<string, object>> Query(Stream stream, bool UseHeaderRow = false)
{
return _csvlReader.Query(stream, UseHeaderRow);
}
public override IEnumerable<IDictionary<string, object>> Query(Stream stream, bool UseHeaderRow = false)
{
return _csvlReader.Query(stream, UseHeaderRow);
}
public override IEnumerable<T> Query<T>(Stream stream)
{
return _csvlReader.Query<T>(stream);
}
public override IEnumerable<T> Query<T>(Stream stream)
{
return _csvlReader.Query<T>(stream);
}
public override void SaveAs(Stream stream, object input)
{
_csvWriter.SaveAs(stream, input);
}
public override void SaveAs(Stream stream, object input)
{
_csvWriter.SaveAs(stream, input);
}
}
}

View File

@ -9,7 +9,7 @@ using System.Threading.Tasks;
namespace MiniExcelLibs.Csv
{
public class CsvReader : IExcelReader
internal class CsvReader : IExcelReader
{
public IEnumerable<IDictionary<string, object>> Query(Stream stream, bool useHeaderRow)
{

View File

@ -12,7 +12,7 @@ using System.Xml.Linq;
namespace MiniExcelLibs.OpenXml
{
public class ExcelOpenXmlProvider : ExcelProviderBase
internal class ExcelOpenXmlProvider : ExcelProviderBase
{
private IExcelReader _excelReader;
private IExcelWriter _excelWriter;