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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ Installation is simple, just install via
dotnet add package ClosureOSS.Calendare.VSyntaxReader
~~~

# Usage

Refer to the examples in the VSyntaxReader.Examples folder.

# Scope

## Supported RFC's
Expand Down
12 changes: 6 additions & 6 deletions VSyntaxReader.Examples/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
},
"LinkDotNet.StringBuilder": {
"type": "Transitive",
"resolved": "3.2.0",
"contentHash": "lCVle+mEP4RKmsvWYLsXC3aR3byETFej3HN/L2xQ5yPIK/lzTjtWHLMObk90/9mbeOnv2cooWBtMVEMNh8aM/g=="
"resolved": "3.3.0",
"contentHash": "WtPuxOokoW4n867vlcy7oL2JWclsBWfDl7N7KYuTlI48IXqOtf6knxtYO4ldJeDUGc8AHt9gvATaKyU4YhlRGA=="
},
"NodaTime": {
"type": "Transitive",
Expand All @@ -20,18 +20,18 @@
},
"NodaTime.Serialization.SystemTextJson": {
"type": "Transitive",
"resolved": "1.3.0",
"contentHash": "Zf9sdKrfcId0rvZLOB7Yncy/cfCv20TdQ84IKE6CkcWW33u1wsRvmYUbfaP5MYUm+9vp9Yoi3G2vN1/9nZ/JCA==",
"resolved": "1.3.1",
"contentHash": "Ndo6VK/TwyIjcppiHY3I3p1iFM+dkjIghiSR/eC3rzu0whoV2GY9F5xCERf5BZDmkI4HuExlA4UE/smDV46SkQ==",
"dependencies": {
"NodaTime": "[3.0.0, 4.0.0)"
}
},
"ClosureOSS.Calendare.VSyntaxReader": {
"type": "Project",
"dependencies": {
"LinkDotNet.StringBuilder": "[3.2.0, )",
"LinkDotNet.StringBuilder": "[3.3.0, )",
"NodaTime": "[3.3.0, )",
"NodaTime.Serialization.SystemTextJson": "[1.3.0, )"
"NodaTime.Serialization.SystemTextJson": "[1.3.1, )"
}
}
}
Expand Down
7 changes: 1 addition & 6 deletions VSyntaxReader.Tests/PropertiesGeneric/ListComparerTest.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Calendare.VSyntaxReader.Components;
using Calendare.VSyntaxReader.Models;
using Calendare.VSyntaxReader.Components;
using Calendare.VSyntaxReader.Operations;
using Calendare.VSyntaxReader.Properties;
using NodaTime;
using Xunit.Abstractions;

namespace VSyntaxReader.Tests.PropertiesGeneric;
Expand Down
3 changes: 1 addition & 2 deletions VSyntaxReader.Tests/PropertiesGeneric/MergeTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Linq;
using System.Linq;
using Calendare.VSyntaxReader.Components;
using Calendare.VSyntaxReader.Models;
using Calendare.VSyntaxReader.Properties;
Expand Down
12 changes: 6 additions & 6 deletions VSyntaxReader.Tests/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
},
"LinkDotNet.StringBuilder": {
"type": "Transitive",
"resolved": "3.2.0",
"contentHash": "lCVle+mEP4RKmsvWYLsXC3aR3byETFej3HN/L2xQ5yPIK/lzTjtWHLMObk90/9mbeOnv2cooWBtMVEMNh8aM/g=="
"resolved": "3.3.0",
"contentHash": "WtPuxOokoW4n867vlcy7oL2JWclsBWfDl7N7KYuTlI48IXqOtf6knxtYO4ldJeDUGc8AHt9gvATaKyU4YhlRGA=="
},
"Microsoft.CodeCoverage": {
"type": "Transitive",
Expand Down Expand Up @@ -77,8 +77,8 @@
},
"NodaTime.Serialization.SystemTextJson": {
"type": "Transitive",
"resolved": "1.3.0",
"contentHash": "Zf9sdKrfcId0rvZLOB7Yncy/cfCv20TdQ84IKE6CkcWW33u1wsRvmYUbfaP5MYUm+9vp9Yoi3G2vN1/9nZ/JCA==",
"resolved": "1.3.1",
"contentHash": "Ndo6VK/TwyIjcppiHY3I3p1iFM+dkjIghiSR/eC3rzu0whoV2GY9F5xCERf5BZDmkI4HuExlA4UE/smDV46SkQ==",
"dependencies": {
"NodaTime": "[3.0.0, 4.0.0)"
}
Expand Down Expand Up @@ -126,9 +126,9 @@
"ClosureOSS.Calendare.VSyntaxReader": {
"type": "Project",
"dependencies": {
"LinkDotNet.StringBuilder": "[3.2.0, )",
"LinkDotNet.StringBuilder": "[3.3.0, )",
"NodaTime": "[3.3.0, )",
"NodaTime.Serialization.SystemTextJson": "[1.3.0, )"
"NodaTime.Serialization.SystemTextJson": "[1.3.1, )"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion VSyntaxReader/Line.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Calendare.VSyntaxReader;

public class Line
sealed class Line
{
public required string Raw { get; set; }
public int LineNo { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion VSyntaxReader/LineReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Calendare.VSyntaxReader;

public class LineReader
sealed class LineReader
{
private readonly Stream Stream;
private readonly int BufferSize = 256;
Expand Down
4 changes: 2 additions & 2 deletions VSyntaxReader/Models/CaldavPeriodExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ public static class CaldavPeriodExtension
{
public static List<ZonedDateTime> ToNormalizedInZone(this IEnumerable<CaldavPeriod> dates, DateTimeZone referenceTimeZone)
{
return dates.Select(x => x.Start.GetNormalizedInZone(referenceTimeZone)).Where(x => x != null).Select(x => x!.Value).ToList();
return [.. dates.Select(x => x.Start.GetNormalizedInZone(referenceTimeZone)).Where(x => x != null).Select(x => x!.Value)];
}

public static List<Instant> ToNormalized(this IEnumerable<CaldavPeriod> dates, DateTimeZone referenceTimeZone)
{
return dates.Select(x => x.Start.ToInstant(referenceTimeZone)).Where(x => x != null).Select(x => x!.Value).ToList();
return [.. dates.Select(x => x.Start.ToInstant(referenceTimeZone)).Where(x => x != null).Select(x => x!.Value)];
}
}
2 changes: 1 addition & 1 deletion VSyntaxReader/Models/FreeBusyEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Calendare.VSyntaxReader.Models;

public class FreeBusyEntry
public sealed class FreeBusyEntry
{
public FreeBusyStatus Status { get; set; } = FreeBusyStatus.Busy;
public Interval Period { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion VSyntaxReader/Operations/FreeBusyNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Calendare.VSyntaxReader.Operations;

public class FreeBusyList : LinkedList<FreeBusyEntry>
sealed class FreeBusyList : LinkedList<FreeBusyEntry>
{

public bool Insert(Interval period, FreeBusyStatus status, bool punching = false, int priority = 0)
Expand Down
2 changes: 1 addition & 1 deletion VSyntaxReader/Operations/RecurrenceCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Calendare.VSyntaxReader.Operations;

public class RecurrenceCalculator
public sealed class RecurrenceCalculator
{
public CaldavRecurrence Rule { get; init; }
public ZonedDateTime ReferenceDate { get; private set; }
Expand Down
2 changes: 1 addition & 1 deletion VSyntaxReader/Parsers/CalendarParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Calendare.VSyntaxReader.Parsers;

public class CalendarParser : ICalendarParser
public sealed class CalendarParser : ICalendarParser
{
private readonly CalendarBuilder Builder;

Expand Down
2 changes: 1 addition & 1 deletion VSyntaxReader/Parsers/LineParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Calendare.VSyntaxReader.Parsers;
/// <summary>
/// Original source for regex expressions and comments is Ical.Net \src\Ical.Net\Serialization\SimpleDeserializer.cs
/// </summary>
public partial class LineParser
partial class LineParser
{
private const string NameGroup = "name";
private const string ValueGroup = "value";
Expand Down
1 change: 0 additions & 1 deletion VSyntaxReader/Parsers/RecurrenceRuleParser.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Security.Cryptography;
using System.Text.RegularExpressions;
using Calendare.VSyntaxReader.Models;
using NodaTime;
Expand Down
2 changes: 1 addition & 1 deletion VSyntaxReader/Properties/IProperty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public string Serialize()
sb.Append(Raw.Value);
if (!IsValid)
{
sb.Append($" ###ERR");
sb.Append(" ###ERR");
}
return sb.ToString().WrapLine();
}
Expand Down
2 changes: 1 addition & 1 deletion VSyntaxReader/SerializeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Calendare.VSyntaxReader;

public static class SerializeExtensions
static class SerializeExtensions
{
public const int MaxCharactersPerLine = 75;
public const string LineBreak = "\r\n";
Expand Down
4 changes: 2 additions & 2 deletions VSyntaxReader/VSyntaxReader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
<None Include="../README.md" Pack="true" PackagePath="\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="LinkDotNet.StringBuilder" Version="3.2.0" />
<PackageReference Include="LinkDotNet.StringBuilder" Version="3.3.0" />
<PackageReference Include="NodaTime" Version="3.3.0" />
<PackageReference Include="NodaTime.Serialization.SystemTextJson" Version="1.3.0" />
<PackageReference Include="NodaTime.Serialization.SystemTextJson" Version="1.3.1" />
</ItemGroup>
</Project>
36 changes: 18 additions & 18 deletions VSyntaxReader/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"net10.0": {
"LinkDotNet.StringBuilder": {
"type": "Direct",
"requested": "[3.2.0, )",
"resolved": "3.2.0",
"contentHash": "lCVle+mEP4RKmsvWYLsXC3aR3byETFej3HN/L2xQ5yPIK/lzTjtWHLMObk90/9mbeOnv2cooWBtMVEMNh8aM/g=="
"requested": "[3.3.0, )",
"resolved": "3.3.0",
"contentHash": "WtPuxOokoW4n867vlcy7oL2JWclsBWfDl7N7KYuTlI48IXqOtf6knxtYO4ldJeDUGc8AHt9gvATaKyU4YhlRGA=="
},
"Nerdbank.GitVersioning": {
"type": "Direct",
Expand All @@ -22,9 +22,9 @@
},
"NodaTime.Serialization.SystemTextJson": {
"type": "Direct",
"requested": "[1.3.0, )",
"resolved": "1.3.0",
"contentHash": "Zf9sdKrfcId0rvZLOB7Yncy/cfCv20TdQ84IKE6CkcWW33u1wsRvmYUbfaP5MYUm+9vp9Yoi3G2vN1/9nZ/JCA==",
"requested": "[1.3.1, )",
"resolved": "1.3.1",
"contentHash": "Ndo6VK/TwyIjcppiHY3I3p1iFM+dkjIghiSR/eC3rzu0whoV2GY9F5xCERf5BZDmkI4HuExlA4UE/smDV46SkQ==",
"dependencies": {
"NodaTime": "[3.0.0, 4.0.0)"
}
Expand All @@ -33,9 +33,9 @@
"net8.0": {
"LinkDotNet.StringBuilder": {
"type": "Direct",
"requested": "[3.2.0, )",
"resolved": "3.2.0",
"contentHash": "lCVle+mEP4RKmsvWYLsXC3aR3byETFej3HN/L2xQ5yPIK/lzTjtWHLMObk90/9mbeOnv2cooWBtMVEMNh8aM/g=="
"requested": "[3.3.0, )",
"resolved": "3.3.0",
"contentHash": "WtPuxOokoW4n867vlcy7oL2JWclsBWfDl7N7KYuTlI48IXqOtf6knxtYO4ldJeDUGc8AHt9gvATaKyU4YhlRGA=="
},
"Nerdbank.GitVersioning": {
"type": "Direct",
Expand All @@ -51,9 +51,9 @@
},
"NodaTime.Serialization.SystemTextJson": {
"type": "Direct",
"requested": "[1.3.0, )",
"resolved": "1.3.0",
"contentHash": "Zf9sdKrfcId0rvZLOB7Yncy/cfCv20TdQ84IKE6CkcWW33u1wsRvmYUbfaP5MYUm+9vp9Yoi3G2vN1/9nZ/JCA==",
"requested": "[1.3.1, )",
"resolved": "1.3.1",
"contentHash": "Ndo6VK/TwyIjcppiHY3I3p1iFM+dkjIghiSR/eC3rzu0whoV2GY9F5xCERf5BZDmkI4HuExlA4UE/smDV46SkQ==",
"dependencies": {
"NodaTime": "[3.0.0, 4.0.0)"
}
Expand All @@ -62,9 +62,9 @@
"net9.0": {
"LinkDotNet.StringBuilder": {
"type": "Direct",
"requested": "[3.2.0, )",
"resolved": "3.2.0",
"contentHash": "lCVle+mEP4RKmsvWYLsXC3aR3byETFej3HN/L2xQ5yPIK/lzTjtWHLMObk90/9mbeOnv2cooWBtMVEMNh8aM/g=="
"requested": "[3.3.0, )",
"resolved": "3.3.0",
"contentHash": "WtPuxOokoW4n867vlcy7oL2JWclsBWfDl7N7KYuTlI48IXqOtf6knxtYO4ldJeDUGc8AHt9gvATaKyU4YhlRGA=="
},
"Nerdbank.GitVersioning": {
"type": "Direct",
Expand All @@ -80,9 +80,9 @@
},
"NodaTime.Serialization.SystemTextJson": {
"type": "Direct",
"requested": "[1.3.0, )",
"resolved": "1.3.0",
"contentHash": "Zf9sdKrfcId0rvZLOB7Yncy/cfCv20TdQ84IKE6CkcWW33u1wsRvmYUbfaP5MYUm+9vp9Yoi3G2vN1/9nZ/JCA==",
"requested": "[1.3.1, )",
"resolved": "1.3.1",
"contentHash": "Ndo6VK/TwyIjcppiHY3I3p1iFM+dkjIghiSR/eC3rzu0whoV2GY9F5xCERf5BZDmkI4HuExlA4UE/smDV46SkQ==",
"dependencies": {
"NodaTime": "[3.0.0, 4.0.0)"
}
Expand Down