aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.CSV/CsvDefinition.cs
blob: 350c5ed8ea260c1530e6f4c4308ac50854b2ca64 (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
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Collections.Concurrent;
using System.Threading.Tasks;

namespace Tango.CSV
{
    /// <summary>
    /// Represents a <see cref="CsvFile"/> configuration.
    /// </summary>
    public class CsvDefinition
    {
        /// <summary>
        /// Gets or sets the header.
        /// </summary>
        public string Header { get; set; }

        /// <summary>
        /// Gets or sets the field separator.
        /// </summary>
        public char FieldSeparator { get; set; }

        /// <summary>
        /// Gets or sets the text qualifier.
        /// </summary>
        public char TextQualifier { get; set; }

        /// <summary>
        /// Gets or sets the columns.
        /// </summary>
        public IEnumerable<String> Columns { get; set; }

        /// <summary>
        /// Gets or sets the end of line.
        /// </summary>
        public string EndOfLine { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="CsvDefinition"/> class.
        /// </summary>
        public CsvDefinition()
        {
            if (CsvFile.DefaultCsvDefinition != null)
            {
                FieldSeparator = CsvFile.DefaultCsvDefinition.FieldSeparator;
                TextQualifier = CsvFile.DefaultCsvDefinition.TextQualifier;
                EndOfLine = CsvFile.DefaultCsvDefinition.EndOfLine;
            }
        }
    }
}