blob: bf857b536cd0ad2ce21ccfebf5c07a122250fcff (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
// 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.Globalization;
using System.IO;
using CsvHelper.Configuration;
namespace CsvHelper
{
/// <summary>
/// Defines methods used to create
/// CsvHelper classes.
/// </summary>
public interface IFactory
{
/// <summary>
/// Creates an <see cref="IParser"/>.
/// </summary>
/// <param name="reader">The text reader to use for the csv parser.</param>
/// <param name="configuration">The configuration to use for the csv parser.</param>
/// <returns>The created parser.</returns>
IParser CreateParser(TextReader reader, Configuration.CsvConfiguration configuration);
/// <summary>
/// Creates an <see cref="IParser" />.
/// </summary>
/// <param name="reader">The text reader to use for the csv parser.</param>
/// <param name="cultureInfo">The culture information.</param>
/// <returns>
/// The created parser.
/// </returns>
IParser CreateParser(TextReader reader, CultureInfo cultureInfo);
/// <summary>
/// Creates an <see cref="IReader"/>.
/// </summary>
/// <param name="reader">The text reader to use for the csv reader.</param>
/// <param name="configuration">The configuration to use for the reader.</param>
/// <returns>The created reader.</returns>
IReader CreateReader(TextReader reader, Configuration.CsvConfiguration configuration);
/// <summary>
/// Creates an <see cref="IReader" />.
/// </summary>
/// <param name="reader">The text reader to use for the csv reader.</param>
/// <param name="cultureInfo">The culture information.</param>
/// <returns>
/// The created reader.
/// </returns>
IReader CreateReader(TextReader reader, CultureInfo cultureInfo);
/// <summary>
/// Creates an <see cref="IReader"/>.
/// </summary>
/// <param name="parser">The parser used to create the reader.</param>
/// <returns>The created reader.</returns>
IReader CreateReader(IParser parser);
/// <summary>
/// Creates an <see cref="IWriter"/>.
/// </summary>
/// <param name="writer">The text writer to use for the csv writer.</param>
/// <param name="configuration">The configuration to use for the writer.</param>
/// <returns>The created writer.</returns>
IWriter CreateWriter(TextWriter writer, Configuration.CsvConfiguration configuration);
/// <summary>
/// Creates an <see cref="IWriter" />.
/// </summary>
/// <param name="writer">The text writer to use for the csv writer.</param>
/// <param name="cultureInfo">The culture information.</param>
/// <returns>
/// The created writer.
/// </returns>
IWriter CreateWriter(TextWriter writer, CultureInfo cultureInfo);
/// <summary>
/// Provides a fluent interface for dynamically creating <see cref="ClassMap{T}"/>s
/// </summary>
/// <typeparam name="T">Type of class to map</typeparam>
/// <returns>Next available options</returns>
IHasMap<T> CreateClassMapBuilder<T>();
}
}
|