Skip to content

Commit b2880b8

Browse files
committed
xml docs + nuget stuff
1 parent 09e71ed commit b2880b8

18 files changed

+419
-48
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -229,3 +229,6 @@ $RECYCLE.BIN/
229229

230230
# Windows shortcuts
231231
*.lnk
232+
233+
lib
234+
tools/NuGet.exe

res/logo-16.png

335 Bytes
Loading

res/logo-200.png

2.88 KB
Loading

res/logo-2000.png

41.9 KB
Loading

res/logo-32.png

551 Bytes
Loading

res/logo-64.png

1.01 KB
Loading

res/logo.svg

+88
Loading

src/SrkCsv/Cell.cs

+30-2
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,54 @@ namespace SrkCsv
77
using System.Text;
88
using System.Threading.Tasks;
99

10+
/// <summary>
11+
/// Cell information and data.
12+
/// </summary>
13+
/// <typeparam name="T"></typeparam>
1014
public class Cell<T>
1115
{
1216
private bool isDisposed;
1317

18+
/// <summary>
19+
/// Initializes a new instance of the <see cref="Cell{T}"/> class.
20+
/// </summary>
1421
public Cell()
1522
{
1623
}
1724

25+
/// <summary>
26+
/// Gets or sets the row.
27+
/// </summary>
1828
public Row<T> Row { get; set; }
29+
30+
/// <summary>
31+
/// Gets or sets the column.
32+
/// </summary>
1933
public Column<T> Column { get; set; }
34+
35+
/// <summary>
36+
/// Gets or sets the value.
37+
/// </summary>
2038
public string Value { get; set; }
2139

40+
/// <summary>
41+
/// Gets or sets the target object.
42+
/// </summary>
43+
public T Target { get; set; }
44+
45+
/// <summary>
46+
/// Releases unmanaged and - optionally - managed resources.
47+
/// </summary>
2248
public void Dispose()
2349
{
2450
this.Dispose(true);
2551
GC.SuppressFinalize(this);
2652
}
2753

54+
/// <summary>
55+
/// Releases unmanaged and - optionally - managed resources.
56+
/// </summary>
57+
/// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
2858
protected virtual void Dispose(bool disposing)
2959
{
3060
if (!this.isDisposed)
@@ -43,7 +73,5 @@ internal object GetTarget()
4373
{
4474
return null;
4575
}
46-
47-
public T Target { get; set; }
4876
}
4977
}

src/SrkCsv/Column.cs

+15-31
Original file line numberDiff line numberDiff line change
@@ -7,49 +7,33 @@ namespace SrkCsv
77
using System.Text;
88
using System.Threading.Tasks;
99

10+
/// <summary>
11+
/// Column information.
12+
/// </summary>
13+
/// <typeparam name="T"></typeparam>
1014
public class Column<T>
1115
{
12-
private Action<Cell<T>> parser;
13-
16+
/// <summary>
17+
/// Initializes a new instance of the <see cref="Column{T}"/> class.
18+
/// </summary>
19+
/// <param name="index">The index.</param>
20+
/// <param name="col">The col.</param>
1421
public Column(int index, string col)
1522
{
1623
this.Index = index;
1724
this.Name = col;
18-
19-
////this.CreateParser();
2025
}
2126

27+
/// <summary>
28+
/// Gets or sets the column index.
29+
/// </summary>
2230
public int Index { get; set; }
2331

32+
/// <summary>
33+
/// Gets or sets the name.
34+
/// </summary>
2435
public string Name { get; set; }
2536

2637
internal Predicate<Cell<T>> Transform { get; set; }
27-
28-
////public static IList<ColumnParser> Parsers
29-
////{
30-
//// get { return parsers.Select(p => new ColumnParser { Name = p.Key, }).ToArray(); }
31-
////}
32-
33-
////public void Parse(Cell<T> cell)
34-
////{
35-
//// if (this.parser != null)
36-
//// {
37-
//// this.parser(cell);
38-
//// }
39-
////}
40-
41-
////private static void AddParser(ColumnParser parser)
42-
////{
43-
//// parsers.Add(parser.Name.ToLowerInvariant(), parser);
44-
////}
45-
46-
////private void CreateParser()
47-
////{
48-
//// var lowerName = this.Name.ToLowerInvariant();
49-
//// if (parsers.ContainsKey(lowerName))
50-
//// this.parser = parsers[lowerName].Action;
51-
//// else
52-
//// throw new InvalidOperationException("Unrecognized column '" + this.Name + "' ");
53-
////}
5438
}
5539
}

src/SrkCsv/CsvParseException.cs

+31-1
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,68 @@ namespace SrkCsv
66
using System.Linq;
77
using System.Runtime.Serialization;
88
using System.Text;
9-
using System.Threading.Tasks;
109

10+
/// <summary>
11+
/// Exception that occur during parsing operations.
12+
/// </summary>
1113
[Serializable]
1214
public class CsvParseException : Exception
1315
{
1416
private readonly string[] errors;
1517

18+
/// <summary>
19+
/// Initializes a new instance of the <see cref="CsvParseException"/> class.
20+
/// </summary>
1621
public CsvParseException()
1722
{
1823
}
1924

25+
/// <summary>
26+
/// Initializes a new instance of the <see cref="CsvParseException"/> class.
27+
/// </summary>
28+
/// <param name="message">The message that describes the error.</param>
2029
public CsvParseException(string message)
2130
: base(message)
2231
{
2332
}
2433

34+
/// <summary>
35+
/// Initializes a new instance of the <see cref="CsvParseException"/> class.
36+
/// </summary>
37+
/// <param name="message">The message.</param>
38+
/// <param name="inner">The inner.</param>
2539
public CsvParseException(string message, Exception inner)
2640
: base(message, inner)
2741
{
2842
}
2943

44+
/// <summary>
45+
/// Initializes a new instance of the <see cref="CsvParseException"/> class.
46+
/// </summary>
47+
/// <param name="message">The message.</param>
48+
/// <param name="errors">The errors.</param>
3049
public CsvParseException(string message, IEnumerable<string> errors)
3150
: this(message)
3251
{
3352
this.errors = errors.ToArray();
3453
}
3554

55+
/// <summary>
56+
/// Initializes a new instance of the <see cref="CsvParseException"/> class.
57+
/// </summary>
58+
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
59+
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param>
3660
protected CsvParseException(SerializationInfo info, StreamingContext context)
3761
: base(info, context)
3862
{
3963
}
4064

65+
/// <summary>
66+
/// Gets the errors.
67+
/// </summary>
68+
/// <value>
69+
/// The errors.
70+
/// </value>
4171
public IList<string> Errors
4272
{
4373
get { return this.errors; }

src/SrkCsv/CsvReader.cs

+29
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ namespace SrkCsv
1111
using System.Text;
1212
using System.Threading.Tasks;
1313

14+
/// <summary>
15+
/// Basic CSV reader.
16+
/// </summary>
1417
public class CsvReader : CsvReader<Nothing>
1518
{
1619
public CsvReader()
@@ -24,30 +27,56 @@ public CsvReader(Table table)
2427
}
2528
}
2629

30+
/// <summary>
31+
/// CSV reader with support for a target object type.
32+
/// </summary>
33+
/// <typeparam name="T">the target object type</typeparam>
2734
public class CsvReader<T>
2835
{
2936
private readonly Table<T> table;
3037
private CultureInfo culture = CultureInfo.InvariantCulture;
3138

39+
/// <summary>
40+
/// Initializes a new instance of the <see cref="CsvReader{T}"/> class.
41+
/// </summary>
3242
public CsvReader()
3343
{
3444
}
3545

46+
/// <summary>
47+
/// Initializes a new instance of the <see cref="CsvReader{T}"/> class.
48+
/// </summary>
49+
/// <param name="table">The table.</param>
3650
public CsvReader(Table<T> table)
3751
{
3852
this.table = table;
3953
}
4054

55+
/// <summary>
56+
/// Gets or sets the cell separator.
57+
/// </summary>
58+
/// <value>
4159
public char CellSeparator { get; set; }
4260

61+
/// <summary>
62+
/// Gets or sets a value indicating whether [has header line].
63+
/// </summary>
4364
public bool HasHeaderLine { get; set; }
4465

66+
/// <summary>
67+
/// Gets or sets the culture.
68+
/// </summary>
4569
public CultureInfo Culture
4670
{
4771
get { return this.culture; }
4872
set { this.culture = value; }
4973
}
5074

75+
/// <summary>
76+
/// Reads to end.
77+
/// </summary>
78+
/// <param name="reader">The reader.</param>
79+
/// <returns></returns>
5180
public Table<T> ReadToEnd(StringReader reader)
5281
{
5382
var data = new List<List<string>>();

src/SrkCsv/CsvSeparator.cs

+6
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@ namespace SrkCsv
33
{
44
using System;
55

6+
/// <summary>
7+
/// Special separators.
8+
/// </summary>
69
public static class CsvSeparator
710
{
11+
/// <summary>
12+
/// Special separator: instructs to detect separator from the first lines in the file.
13+
/// </summary>
814
public const char AutoDetect = '\0';
915
}
1016
}

src/SrkCsv/Internals/Nothing.cs

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ namespace SrkCsv.Internals
33
{
44
using System;
55

6+
/// <summary>
7+
/// Used for non-generic CsvReader.
8+
/// </summary>
69
public class Nothing
710
{
811
}

0 commit comments

Comments
 (0)