Commit: d41f76e
Parent: e14493a

Mårten-ify AI generated code

Mårten Åsberg committed on 2026-11-11 at 07:30
Directory.Build.props +1 -1
diff --git a/Directory.Build.props b/Directory.Build.props
index a596977..47b9a0d 100644
@@ -3,7 +3,7 @@
<TargetFramework>net10.0</TargetFramework>
<RuntimeIdentifiers>win-x64;win-arm64;osx-arm64;linux-x64;linux-arm64;linux-musl-x64</RuntimeIdentifiers>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<ImplicitUsings>disable</ImplicitUsings>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
</PropertyGroup>
SharpDlt.slnx +4 -0
diff --git a/SharpDlt.slnx b/SharpDlt.slnx
index dee0afb..5b9324a 100644
@@ -3,4 +3,8 @@
<Project Path="lib/src/SharpDlt.csproj" />
<Project Path="lib/tests/SharpDlt.Tests.csproj" />
</Folder>
<Folder Name="/app/" />
<Folder Name="/app/core/">
<Project Path="app/core/src/SharpDlt.App.Core.csproj" />
</Folder>
</Solution>
lib/src/DltMessage.cs +3 -0
diff --git a/lib/src/DltMessage.cs b/lib/src/DltMessage.cs
index e04da5d..bc5df8f 100644
@@ -1,4 +1,7 @@
using System;
using SharpDlt.Headers;
using SharpDlt.Internal;
using SharpDlt.Payloads;
namespace SharpDlt;
lib/src/DltParseException.cs +2 -0
diff --git a/lib/src/DltParseException.cs b/lib/src/DltParseException.cs
index 50c4567..8ccf1bb 100644
@@ -1,3 +1,5 @@
using System;
namespace SharpDlt;
/// <summary>
lib/src/DltReader.cs +6 -0
diff --git a/lib/src/DltReader.cs b/lib/src/DltReader.cs
index 8974060..f2274a5 100644
@@ -1,4 +1,10 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
using SharpDlt.Headers;
namespace SharpDlt;
lib/src/Headers/ExtendedHeader.cs +2 -1
diff --git a/lib/src/Headers/ExtendedHeader.cs b/lib/src/Headers/ExtendedHeader.cs
index ae857cd..a9f4c86 100644
@@ -1,6 +1,7 @@
using System;
using SharpDlt.Internal;
namespace SharpDlt;
namespace SharpDlt.Headers;
/// <summary>
/// The Extended Header of a DLT message.
lib/src/Headers/MessageEnums.cs +1 -1
diff --git a/lib/src/Headers/MessageEnums.cs b/lib/src/Headers/MessageEnums.cs
index 80d4340..c098a2d 100644
@@ -1,4 +1,4 @@
namespace SharpDlt;
namespace SharpDlt.Headers;
/// <summary>Message Type (MSTP) of the DLT Extended Header.</summary>
public enum DltMessageType
lib/src/Headers/StandardHeader.cs +2 -1
diff --git a/lib/src/Headers/StandardHeader.cs b/lib/src/Headers/StandardHeader.cs
index e9d2432..c1cf417 100644
@@ -1,7 +1,8 @@
using System;
using System.Buffers.Binary;
using SharpDlt.Internal;
namespace SharpDlt;
namespace SharpDlt.Headers;
/// <summary>
/// The Standard Header of a DLT message.
lib/src/Headers/StorageHeader.cs +2 -1
diff --git a/lib/src/Headers/StorageHeader.cs b/lib/src/Headers/StorageHeader.cs
index 9772679..82a4d48 100644
@@ -1,7 +1,8 @@
using System;
using System.Buffers.Binary;
using SharpDlt.Internal;
namespace SharpDlt;
namespace SharpDlt.Headers;
/// <summary>
/// The Storage Header which precedes every DLT message stored in a DLT file.
lib/src/Internal/AsciiText.cs +1 -0
diff --git a/lib/src/Internal/AsciiText.cs b/lib/src/Internal/AsciiText.cs
index 1b02354..4525e8d 100644
@@ -1,3 +1,4 @@
using System;
using System.Text;
namespace SharpDlt.Internal;
lib/src/Internal/DltMessageParser.cs +4 -0
diff --git a/lib/src/Internal/DltMessageParser.cs b/lib/src/Internal/DltMessageParser.cs
index a618203..98441c0 100644
@@ -1,5 +1,9 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using SharpDlt.Headers;
using SharpDlt.Payloads;
namespace SharpDlt.Internal;
lib/src/Internal/SpanReader.cs +1 -0
diff --git a/lib/src/Internal/SpanReader.cs b/lib/src/Internal/SpanReader.cs
index 68d1079..9f04161 100644
@@ -1,3 +1,4 @@
using System;
using System.Buffers.Binary;
namespace SharpDlt.Internal;
lib/src/Payloads/ArgumentEnums.cs +1 -1
diff --git a/lib/src/Payloads/ArgumentEnums.cs b/lib/src/Payloads/ArgumentEnums.cs
index c7140cb..11a7e60 100644
@@ -1,4 +1,4 @@
namespace SharpDlt;
namespace SharpDlt.Payloads;
/// <summary>Width of an integer argument. The numeric value is the size in bytes.</summary>
public enum DltIntegerWidth
lib/src/Payloads/Arguments.cs +2 -1
diff --git a/lib/src/Payloads/Arguments.cs b/lib/src/Payloads/Arguments.cs
index 7e9d681..ba9240e 100644
@@ -1,6 +1,7 @@
using System;
using System.Globalization;
namespace SharpDlt;
namespace SharpDlt.Payloads;
/// <summary>A single argument of a verbose mode payload.</summary>
public abstract partial record DltArgument
lib/src/Payloads/DltArgument.Parsing.cs +3 -2
diff --git a/lib/src/Payloads/DltArgument.Parsing.cs b/lib/src/Payloads/DltArgument.Parsing.cs
index 448c072..57aab30 100644
@@ -1,7 +1,8 @@
using System;
using System.Text;
using SharpDlt.Internal;
namespace SharpDlt;
namespace SharpDlt.Payloads;
public abstract partial record DltArgument
{
@@ -151,7 +152,7 @@ public abstract partial record DltArgument
return new DltStringArgument(effectiveEncoding.GetString(text), coding);
}
private static DltArgument ParseRaw(ReadOnlySpan<byte> payload, bool msbFirst, uint typeInfo, out int bytesRead)
private static DltRawArgument ParseRaw(ReadOnlySpan<byte> payload, bool msbFirst, uint typeInfo, out int bytesRead)
{
var raw = ReadLengthPrefixed(payload, msbFirst, typeInfo, out bytesRead, out _);
return new DltRawArgument(raw.ToArray());
lib/src/Payloads/DltPayload.cs +4 -1
diff --git a/lib/src/Payloads/DltPayload.cs b/lib/src/Payloads/DltPayload.cs
index ca89103..94b5a4e 100644
@@ -1,6 +1,9 @@
using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
namespace SharpDlt;
namespace SharpDlt.Payloads;
/// <summary>The payload of a DLT message.</summary>
public abstract record DltPayload
lib/src/SharpDlt.csproj +2 -3
diff --git a/lib/src/SharpDlt.csproj b/lib/src/SharpDlt.csproj
index 5789f76..ed0f104 100644
@@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>SharpDlt</RootNamespace>
<AssemblyName>SharpDlt</AssemblyName>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
</Project>
lib/tests/AsyncEnumerableTestExtensions.cs +4 -0
diff --git a/lib/tests/AsyncEnumerableTestExtensions.cs b/lib/tests/AsyncEnumerableTestExtensions.cs
index 234046a..1ac93bc 100644
@@ -1,3 +1,7 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace SharpDlt.Tests;
internal static class AsyncEnumerableTestExtensions
lib/tests/DltArgumentTests.cs +3 -0
diff --git a/lib/tests/DltArgumentTests.cs b/lib/tests/DltArgumentTests.cs
index 8e3c5b8..766a4f1 100644
@@ -1,6 +1,9 @@
using System;
using System.Buffers.Binary;
using System.Text;
using SharpDlt.Payloads;
using Shouldly;
using Xunit;
namespace SharpDlt.Tests;
lib/tests/DltFileTests.cs +6 -0
diff --git a/lib/tests/DltFileTests.cs b/lib/tests/DltFileTests.cs
index 9ab650c..b0784ec 100644
@@ -1,4 +1,10 @@
using System;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using SharpDlt.Payloads;
using Shouldly;
using Xunit;
namespace SharpDlt.Tests;
lib/tests/DltMessageTests.cs +4 -0
diff --git a/lib/tests/DltMessageTests.cs b/lib/tests/DltMessageTests.cs
index e397e2c..c7af5d3 100644
@@ -1,4 +1,8 @@
using System.Linq;
using SharpDlt.Headers;
using SharpDlt.Payloads;
using Shouldly;
using Xunit;
namespace SharpDlt.Tests;
lib/tests/DltPayloadTests.cs +4 -1
diff --git a/lib/tests/DltPayloadTests.cs b/lib/tests/DltPayloadTests.cs
index fe4745c..5676a5e 100644
@@ -1,4 +1,7 @@
using System.Linq;
using SharpDlt.Payloads;
using Shouldly;
using Xunit;
namespace SharpDlt.Tests;
@@ -12,7 +15,7 @@ public class DltPayloadTests
var payload = NonVerbosePayload.Parse(data, msbFirst: false);
payload.MessageId.ShouldBe(0x12345678u);
payload.NonStaticData.ToArray().ShouldBe(new byte[] { 1, 2, 3 });
payload.NonStaticData.ToArray().ShouldBe([1, 2, 3]);
payload.ToString().ShouldBe("[305419896] 010203");
}
lib/tests/DltReaderTests.cs +6 -0
diff --git a/lib/tests/DltReaderTests.cs b/lib/tests/DltReaderTests.cs
index e7f1c0a..a505cca 100644
@@ -1,4 +1,10 @@
using System;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Shouldly;
using Xunit;
namespace SharpDlt.Tests;
lib/tests/ExtendedHeaderTests.cs +2 -0
diff --git a/lib/tests/ExtendedHeaderTests.cs b/lib/tests/ExtendedHeaderTests.cs
index 87f5cd8..3d991f8 100644
@@ -1,4 +1,6 @@
using SharpDlt.Headers;
using Shouldly;
using Xunit;
namespace SharpDlt.Tests;
lib/tests/SharpDlt.Tests.csproj +2 -4
diff --git a/lib/tests/SharpDlt.Tests.csproj b/lib/tests/SharpDlt.Tests.csproj
index be91b33..e9a8ee8 100644
@@ -1,5 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<RootNamespace>SharpDlt.Tests</RootNamespace>
<AssemblyName>SharpDlt.Tests</AssemblyName>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
@@ -24,10 +26,6 @@
</ItemGroup>
<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>
<ItemGroup>
<None Include="Data\**" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
</Project>
lib/tests/StandardHeaderTests.cs +2 -0
diff --git a/lib/tests/StandardHeaderTests.cs b/lib/tests/StandardHeaderTests.cs
index 5a79663..51bc798 100644
@@ -1,4 +1,6 @@
using SharpDlt.Headers;
using Shouldly;
using Xunit;
namespace SharpDlt.Tests;
lib/tests/StorageHeaderTests.cs +4 -0
diff --git a/lib/tests/StorageHeaderTests.cs b/lib/tests/StorageHeaderTests.cs
index 69496ff..f667418 100644
@@ -1,4 +1,8 @@
using System;
using System.Linq;
using SharpDlt.Headers;
using Shouldly;
using Xunit;
namespace SharpDlt.Tests;
lib/tests/TestDlt.cs +4 -0
diff --git a/lib/tests/TestDlt.cs b/lib/tests/TestDlt.cs
index 8227437..4331f3a 100644
@@ -1,5 +1,9 @@
using System;
using System.Buffers.Binary;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SharpDlt.Headers;
namespace SharpDlt.Tests;