Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
next-version: 1.0.0
next-version: 1.0.1
tag-prefix: '[vV]'
mode: ContinuousDeployment
branches:
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# <img src="https://github.com/CodeShayk/parsley.net/blob/master/Images/ninja-icon-16.png" alt="ninja" style="width:30px;"/> Parsley.Net v1.0.0
# <img src="https://github.com/CodeShayk/parsley.net/blob/master/Images/ninja-icon-16.png" alt="ninja" style="width:30px;"/> Parsley.Net v1.0.1
[![NuGet version](https://badge.fury.io/nu/Parsley.Net.svg)](https://badge.fury.io/nu/Parsley.Net) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/CodeShayk/Parsley.Net/blob/master/LICENSE.md)
[![GitHub Release](https://img.shields.io/github/v/release/CodeShayk/Parsley.Net?logo=github&sort=semver)](https://github.com/CodeShayk/Parsley.Net/releases/latest)
[![master-build](https://github.com/CodeShayk/parsley.net/actions/workflows/Master-Build.yml/badge.svg)](https://github.com/CodeShayk/parsley.net/actions/workflows/Master-Build.yml)
[![master-codeql](https://github.com/CodeShayk/parsley.net/actions/workflows/Master-CodeQL.yml/badge.svg)](https://github.com/CodeShayk/parsley.net/actions/workflows/Master-CodeQL.yml)
[![.Net 9.0](https://img.shields.io/badge/.Net-9.0-blue)](https://dotnet.microsoft.com/en-us/download/dotnet/9.0)
[![.Net Framework 4.6.4](https://img.shields.io/badge/.Net-4.6.2-blue)](https://dotnet.microsoft.com/en-us/download/dotnet-framework/net46)
[![.Net Standard 2.0](https://img.shields.io/badge/.NetStandard-2.0-blue)](https://github.com/dotnet/standard/blob/v2.0.0/docs/versions/netstandard2.0.md)

## Introduction
### What is Parsley.Net?
Expand Down
2 changes: 2 additions & 0 deletions src/Parsley/ColumnAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
using System;

namespace parsley
{
public class ColumnAttribute : Attribute

Check warning on line 5 in src/Parsley/ColumnAttribute.cs

View workflow job for this annotation

GitHub Actions / Build-Test

Missing XML comment for publicly visible type or member 'ColumnAttribute'

Check warning on line 5 in src/Parsley/ColumnAttribute.cs

View workflow job for this annotation

GitHub Actions / Build-Test

Missing XML comment for publicly visible type or member 'ColumnAttribute'
{
public ColumnAttribute(int index, object defaultvalue = null)

Check warning on line 7 in src/Parsley/ColumnAttribute.cs

View workflow job for this annotation

GitHub Actions / Build-Test

Missing XML comment for publicly visible type or member 'ColumnAttribute.ColumnAttribute(int, object)'

Check warning on line 7 in src/Parsley/ColumnAttribute.cs

View workflow job for this annotation

GitHub Actions / Build-Test

Missing XML comment for publicly visible type or member 'ColumnAttribute.ColumnAttribute(int, object)'
{
Index = index;
DefaultValue = defaultvalue;
}

public int Index { get; }

Check warning on line 13 in src/Parsley/ColumnAttribute.cs

View workflow job for this annotation

GitHub Actions / Build-Test

Missing XML comment for publicly visible type or member 'ColumnAttribute.Index'

Check warning on line 13 in src/Parsley/ColumnAttribute.cs

View workflow job for this annotation

GitHub Actions / Build-Test

Missing XML comment for publicly visible type or member 'ColumnAttribute.Index'
public object DefaultValue { get; }

Check warning on line 14 in src/Parsley/ColumnAttribute.cs

View workflow job for this annotation

GitHub Actions / Build-Test

Missing XML comment for publicly visible type or member 'ColumnAttribute.DefaultValue'

Check warning on line 14 in src/Parsley/ColumnAttribute.cs

View workflow job for this annotation

GitHub Actions / Build-Test

Missing XML comment for publicly visible type or member 'ColumnAttribute.DefaultValue'
}
Expand Down
3 changes: 2 additions & 1 deletion src/Parsley/CustomConverter.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
using System;
using System.ComponentModel;
using System.Globalization;

namespace parsley
{
public class CustomConverter<T> : TypeConverter where T: ICustomType, new()
public class CustomConverter<T> : TypeConverter where T : ICustomType, new()

Check warning on line 7 in src/Parsley/CustomConverter.cs

View workflow job for this annotation

GitHub Actions / Build-Test

Missing XML comment for publicly visible type or member 'CustomConverter<T>'

Check warning on line 7 in src/Parsley/CustomConverter.cs

View workflow job for this annotation

GitHub Actions / Build-Test

Missing XML comment for publicly visible type or member 'CustomConverter<T>'
{
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)

Check warning on line 9 in src/Parsley/CustomConverter.cs

View workflow job for this annotation

GitHub Actions / Build-Test

Missing XML comment for publicly visible type or member 'CustomConverter<T>.CanConvertFrom(ITypeDescriptorContext, Type)'

Check warning on line 9 in src/Parsley/CustomConverter.cs

View workflow job for this annotation

GitHub Actions / Build-Test

Missing XML comment for publicly visible type or member 'CustomConverter<T>.CanConvertFrom(ITypeDescriptorContext, Type)'
{
return sourceType == typeof(string) || base.CanConvertFrom(context, sourceType);
}

public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)

Check warning on line 14 in src/Parsley/CustomConverter.cs

View workflow job for this annotation

GitHub Actions / Build-Test

Missing XML comment for publicly visible type or member 'CustomConverter<T>.ConvertFrom(ITypeDescriptorContext, CultureInfo, object)'

Check warning on line 14 in src/Parsley/CustomConverter.cs

View workflow job for this annotation

GitHub Actions / Build-Test

Missing XML comment for publicly visible type or member 'CustomConverter<T>.ConvertFrom(ITypeDescriptorContext, CultureInfo, object)'
{
string stringValue;
object result;
Expand Down
2 changes: 2 additions & 0 deletions src/Parsley/Extensions.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System.Collections.Generic;

namespace parsley
{
internal static class Extensions
Expand Down
2 changes: 1 addition & 1 deletion src/Parsley/ICustomType.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace parsley
{
public interface ICustomType

Check warning on line 3 in src/Parsley/ICustomType.cs

View workflow job for this annotation

GitHub Actions / Build-Test

Missing XML comment for publicly visible type or member 'ICustomType'

Check warning on line 3 in src/Parsley/ICustomType.cs

View workflow job for this annotation

GitHub Actions / Build-Test

Missing XML comment for publicly visible type or member 'ICustomType'
{
public ICustomType Parse(string column);
ICustomType Parse(string column);

Check warning on line 5 in src/Parsley/ICustomType.cs

View workflow job for this annotation

GitHub Actions / Build-Test

Missing XML comment for publicly visible type or member 'ICustomType.Parse(string)'

Check warning on line 5 in src/Parsley/ICustomType.cs

View workflow job for this annotation

GitHub Actions / Build-Test

Missing XML comment for publicly visible type or member 'ICustomType.Parse(string)'
}
}
6 changes: 4 additions & 2 deletions src/Parsley/IFileLine.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using System.Collections.Generic;

namespace parsley
{
public interface IFileLine

Check warning on line 5 in src/Parsley/IFileLine.cs

View workflow job for this annotation

GitHub Actions / Build-Test

Missing XML comment for publicly visible type or member 'IFileLine'

Check warning on line 5 in src/Parsley/IFileLine.cs

View workflow job for this annotation

GitHub Actions / Build-Test

Missing XML comment for publicly visible type or member 'IFileLine'
{
public int Index { get; set; }
public IList<string> Errors { get; set; }
int Index { get; set; }
IList<string> Errors { get; set; }
}
}
6 changes: 3 additions & 3 deletions src/Parsley/IParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ namespace parsley
{
public interface IParser
{
public T[] Parse<T>(string filepath) where T : IFileLine, new();

public T[] Parse<T>(string[] lines) where T : IFileLine, new();
T[] Parse<T>(string filepath) where T : IFileLine, new();
T[] Parse<T>(string[] lines) where T : IFileLine, new();
}
}
12 changes: 9 additions & 3 deletions src/Parsley/Parser.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;

namespace parsley
{
Expand All @@ -19,7 +24,7 @@ public Parser(char delimiter)
public T[] Parse<T>(string filepath) where T : IFileLine, new()
{
if (string.IsNullOrEmpty(filepath) || !File.Exists(filepath))
return [];
return Array.Empty<T>();

var lines = ReadToLines(filepath);

Expand All @@ -29,7 +34,8 @@ public Parser(char delimiter)
public T[] Parse<T>(string[] lines) where T : IFileLine, new()
{
if (lines == null || lines.Length == 0)
return [];
return Array.Empty<T>();
;

var list = new T[lines.Length];

Expand Down Expand Up @@ -70,7 +76,7 @@ private string[] ReadToLines(string path)
lines.Add(line);
}

return lines.ToArray();
return lines.ToArray<string>();
}

private T ParseLine<T>(string line) where T : IFileLine, new()
Expand Down
12 changes: 6 additions & 6 deletions src/Parsley/Parsley.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PropertyGroup>
<TargetFrameworks>net462; netstandard2.0;netstandard2.1; net9.0</TargetFrameworks>
<ImplicitUsings>disable</ImplicitUsings>
<Title>Parsley.Net</Title>
<Authors>CodeShayk</Authors>
<Company>CodeShayk</Company>
Expand All @@ -20,9 +19,10 @@
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<PackageProjectUrl>https://github.com/CodeShayk/Parsley.Net/wiki</PackageProjectUrl>
<RepositoryUrl>https://github.com/CodeShayk/Parsley.Net</RepositoryUrl>
<PackageReleaseNotes>v1.0 - Targets .Net9.0
<PackageReleaseNotes>
v1.0.1 - Targets .Net9.0, .NetStandard2.1, .NetStandard2.0, and .NetFramework4.6.4. <br/>
* Includes core functionality for parsing delimiter separated files.</PackageReleaseNotes>
<Version>1.0.0</Version>
<Version>1.0.1</Version>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<AssemblyName>Parsley.Net</AssemblyName>
</PropertyGroup>
Expand Down
Loading