Skip to content

Commit

Permalink
Cleaned up warnings. Bumped version.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshClose committed Oct 4, 2016
1 parent 179c1a8 commit abe1a6f
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 29 deletions.
11 changes: 11 additions & 0 deletions src/CsvHelper/Compatibility/NET_2_0/Delegates.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,18 @@
// 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.
// http://csvhelper.com
#if NET_2_0

namespace System
{
/// <summary>
/// Encapsulates a method that has two parameters and does not return a value.
/// </summary>
/// <typeparam name="T1">The type of the first parameter of the method that this delegate encapsulates.This type parameter is contravariant. That is, you can use either the type you specified or any type that is less derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics.</typeparam>
/// <typeparam name="T2">The type of the second parameter of the method that this delegate encapsulates.</typeparam>
/// <param name="arg1">The first parameter of the method that this delegate encapsulates.</param>
/// <param name="arg2">The second parameter of the method that this delegate encapsulates.</param>
public delegate void Action<in T1, in T2>( T1 arg1, T2 arg2 );

/// <summary>
/// Encapsulates a method that has one parameter and returns a value of the type specified by the TResult parameter.
/// </summary>
Expand All @@ -14,4 +24,5 @@ namespace System
/// <returns>The return value of the method that this delegate encapsulates.</returns>
public delegate TResult Func<in T, out TResult>( T arg );
}

#endif
37 changes: 17 additions & 20 deletions src/CsvHelper/Configuration/CsvConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace CsvHelper.Configuration
/// <summary>
/// Configuration used for reading and writing CSV data.
/// </summary>
public class CsvConfiguration : ICsvReaderConfiguration, ICsvParserConfiguration, ICsvWriterConfiguration, ICsvSerializerConfiguration
public class CsvConfiguration : ICsvReaderConfiguration, ICsvWriterConfiguration
{
private string delimiter = ",";
private char quote = '"';
Expand Down Expand Up @@ -346,6 +346,21 @@ public CsvConfiguration()
BuildRequiredQuoteChars();
}

/// <summary>
/// Gets or sets a value indicating whether
/// exceptions that occur duruing reading
/// should be ignored. True to ignore exceptions,
/// otherwise false. Default is false.
/// </summary>
public virtual bool IgnoreReadingExceptions { get; set; }

/// <summary>
/// Gets or sets the callback that is called when a reading
/// exception occurs. This will only happen when
/// <see cref="IgnoreReadingExceptions"/> is true.
/// </summary>
public virtual Action<CsvHelperException, ICsvReader> ReadingExceptionCallback { get; set; }

/// <summary>
/// Builds the values for the RequiredQuoteChars property.
/// </summary>
Expand All @@ -355,32 +370,14 @@ private void BuildRequiredQuoteChars()
new[] { '\r', '\n' } :
new[] { '\r', '\n', delimiter[0] };
}

#if !NET_2_0

/// <summary>
/// The configured <see cref="CsvClassMap"/>s.
/// </summary>
public virtual CsvClassMapCollection Maps => maps;

/// <summary>
/// Gets or sets a value indicating whether
/// exceptions that occur duruing reading
/// should be ignored. True to ignore exceptions,
/// otherwise false. Default is false.
/// This is only applicable when during
/// <see cref="ICsvReader.GetRecords{T}"/>.
/// </summary>
public virtual bool IgnoreReadingExceptions { get; set; }

/// <summary>
/// Gets or sets the callback that is called when a reading
/// exception occurs. This will only happen when
/// <see cref="IgnoreReadingExceptions"/> is true, and when
/// calling <see cref="ICsvReader.GetRecords{T}"/>.
/// </summary>
public virtual Action<CsvHelperException, ICsvReader> ReadingExceptionCallback { get; set; }

/// <summary>
/// Gets or sets a value indicating that during writing if a new
/// object should be created when a reference property is null.
Expand Down
3 changes: 3 additions & 0 deletions src/CsvHelper/Configuration/ICsvParserConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

namespace CsvHelper.Configuration
{
/// <summary>
/// Configuration used for the <see cref="ICsvParser"/>.
/// </summary>
public interface ICsvParserConfiguration
{
/// <summary>
Expand Down
12 changes: 6 additions & 6 deletions src/CsvHelper/Configuration/ICsvReaderConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

namespace CsvHelper.Configuration
{
/// <summary>
/// Configuration used for the <see cref="ICsvReader"/>.
/// </summary>
public interface ICsvReaderConfiguration : ICsvParserConfiguration
{
/// <summary>
Expand Down Expand Up @@ -87,26 +90,23 @@ public interface ICsvReaderConfiguration : ICsvParserConfiguration
/// </value>
bool DetectColumnCountChanges { get; set; }

#if !NET_2_0

/// <summary>
/// Gets or sets a value indicating whether
/// exceptions that occur duruing reading
/// should be ignored. True to ignore exceptions,
/// otherwise false. Default is false.
/// This is only applicable when during
/// <see cref="ICsvReader.GetRecords{T}"/>.
/// </summary>
bool IgnoreReadingExceptions { get; set; }

/// <summary>
/// Gets or sets the callback that is called when a reading
/// exception occurs. This will only happen when
/// <see cref="IgnoreReadingExceptions"/> is true, and when
/// calling <see cref="ICsvReader.GetRecords{T}"/>.
/// <see cref="IgnoreReadingExceptions"/> is true.
/// </summary>
Action<CsvHelperException, ICsvReader> ReadingExceptionCallback { get; set; }

#if !NET_2_0

/// <summary>
/// The configured <see cref="CsvClassMap"/>s.
/// </summary>
Expand Down
3 changes: 3 additions & 0 deletions src/CsvHelper/Configuration/ICsvSerializerConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
namespace CsvHelper.Configuration
{
/// <summary>
/// Configuration used for the <see cref="ICsvSerializer"/>.
/// </summary>
public interface ICsvSerializerConfiguration
{
/// <summary>
Expand Down
3 changes: 3 additions & 0 deletions src/CsvHelper/Configuration/ICsvWriterConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

namespace CsvHelper.Configuration
{
/// <summary>
/// Configuration used for the <see cref="ICsvWriter"/>.
/// </summary>
public interface ICsvWriterConfiguration : ICsvSerializerConfiguration
{
/// <summary>
Expand Down
2 changes: 0 additions & 2 deletions src/CsvHelper/CsvReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,7 @@ public virtual bool Read()

if( configuration.IgnoreReadingExceptions )
{
#if !NET_2_0
configuration.ReadingExceptionCallback?.Invoke( csvException, this );
#endif
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/CsvHelper/project.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "CsvHelper",
"version": "3.0.0-beta6",
"version": "3.0.0-beta7",
"authors": [ "Josh Close" ],
"copyright": "Copyright � 2009-2016 Josh Close and Contributors",
"description": "A library for reading and writing CSV files. Extremely fast, flexible, and easy to use. Supports reading and writing of custom class objects.",
Expand Down

0 comments on commit abe1a6f

Please sign in to comment.