Skip to content

Commit deeb8b2

Browse files
author
Oren (electricessence)
committed
Fixing conflicts.
2 parents 68c5a17 + e6d2d1d commit deeb8b2

4 files changed

Lines changed: 31 additions & 3 deletions

File tree

CsvRow.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
6+
namespace Open.Text.CSV
7+
{
8+
public class CsvRow
9+
{
10+
public CsvRow(string[] headerRow)
11+
{
12+
_headerRow = headerRow ?? throw new ArgumentNullException("headerRow");
13+
}
14+
15+
string[] _headerRow;
16+
17+
public string[] HeaderRow => _headerRow.ToArray();
18+
19+
public string[] GetRow(IDictionary<string, object> values)
20+
{
21+
if(values==null) throw new ArgumentNullException("values");
22+
return _headerRow
23+
.Select(key => values.TryGetValue(key, out object value) ? CsvUtility.ExportValue(value) : null)
24+
.ToArray();
25+
}
26+
}
27+
}

CsvWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class CsvWriter : DisposableBase
1212

1313
public CsvWriter(TextWriter target)
1414
{
15-
target = Target;
15+
Target = target;
1616
}
1717

1818
protected override void OnDispose(bool calledExplicitly)

Open.Text.CSV.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
88
<Authors>electricessence</Authors>
99
<Company>electricessence</Company>
10-
<Description>A set of utilities for reading and writing CSV data in C#.
10+
<Description>A set of utilities for reading and writing CSV data.
1111

1212
Part of the "Open" set of libraries.</Description>
1313
<Copyright>https://github.com/electricessence/Open.Text.CSV/blob/master/LISCENSE.md</Copyright>
@@ -16,6 +16,7 @@ Part of the "Open" set of libraries.</Description>
1616
<RepositoryUrl>https://github.com/electricessence/Open.Text.CSV/</RepositoryUrl>
1717
<RepositoryType>git</RepositoryType>
1818
<PackageTags>csv, csharp, dotnetcore, textwriter, streamreader</PackageTags>
19+
<Version>1.0.1</Version>
1920
</PropertyGroup>
2021

2122
<ItemGroup>

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Open.Text.CSV
2-
A utility for parsing and saving CSV data in C#.
2+
A set of utilities for reading and writing CSV data in C#.

0 commit comments

Comments
 (0)