small changes

This commit is contained in:
Timerix22 2022-09-26 17:16:40 +06:00
parent 1c9d44d15e
commit 076affd1e4
6 changed files with 25 additions and 9 deletions

View File

@ -22,6 +22,6 @@ public struct KVPair
public override string ToString() public override string ToString()
{ {
throw new NotImplementedException("Marshal.PtrToStringUTF8 can't get non-ascii chars?"); throw new NotImplementedException("Marshal.PtrToStringUTF8 can't get non-ascii chars?");
return $"{{{Marshal.PtrToStringUTF8(key)}, {value}}}"; //return $"{{{Marshal.PtrToStringUTF8(key)}, {value}}}";
} }
} }

@ -1 +1 @@
Subproject commit 5f593123dea943703bafa836f30c76101cf62a89 Subproject commit ffddfa21ecd669dc5c1189ac2744737bc084e165

View File

@ -10,8 +10,9 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Remove="Ben.Demystifier\**"/> <Compile Remove="Ben.Demystifier\**" />
<None Remove="Ben.Demystifier\**" />
<ProjectReference Include="..\DTLib\DTLib.csproj" /> <ProjectReference Include="..\DTLib\DTLib.csproj" />
<ProjectReference Include="Ben.Demystifier\src\Ben.Demystifier\Ben.Demystifier.csproj" /> <ProjectReference Include="Ben.Demystifier\src\Ben.Demystifier\Ben.Demystifier.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,10 +1,14 @@
global using DTLib; global using DTLib;
global using DTLib.Extensions; global using DTLib.Extensions;
global using System;
using Ben.Demystifier; using Ben.Demystifier;
namespace DTLib.Exceptions; namespace DTLib.Exceptions;
public static class MyExceptions public static class MyExceptionHelper
{ {
public static string ExToString(Exception ex)
{
return ex.ToStringDemystified();
}
} }

View File

@ -9,7 +9,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DTLib.Tests", "DTLib.Tests\
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{6308F24E-A4FF-46B3-B72F-30E05DDCB1D5}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{6308F24E-A4FF-46B3-B72F-30E05DDCB1D5}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitignore = .gitignore .gitignore = .gitignore
README.md = README.md README.md = README.md
EndProjectSection EndProjectSection
@ -18,6 +17,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DTLib.Dtsod", "DTLib.Dtsod\
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DTLib.Network", "DTLib.Network\DTLib.Network.csproj", "{24B7D0A2-0462-424D-B3F5-29A6655FE472}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DTLib.Network", "DTLib.Network\DTLib.Network.csproj", "{24B7D0A2-0462-424D-B3F5-29A6655FE472}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DTLib.Exceptions", "DTLib.Exceptions\DTLib.Exceptions.csproj", "{A999EC29-ADBA-4A89-8EBD-E28594F6CE0A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ben.Demystifier", "DTLib.Exceptions\Ben.Demystifier\src\Ben.Demystifier\Ben.Demystifier.csproj", "{001D56C7-08D3-4F24-802C-C11077510D4F}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -40,6 +43,14 @@ Global
{24B7D0A2-0462-424D-B3F5-29A6655FE472}.Debug|Any CPU.Build.0 = Debug|Any CPU {24B7D0A2-0462-424D-B3F5-29A6655FE472}.Debug|Any CPU.Build.0 = Debug|Any CPU
{24B7D0A2-0462-424D-B3F5-29A6655FE472}.Release|Any CPU.ActiveCfg = Release|Any CPU {24B7D0A2-0462-424D-B3F5-29A6655FE472}.Release|Any CPU.ActiveCfg = Release|Any CPU
{24B7D0A2-0462-424D-B3F5-29A6655FE472}.Release|Any CPU.Build.0 = Release|Any CPU {24B7D0A2-0462-424D-B3F5-29A6655FE472}.Release|Any CPU.Build.0 = Release|Any CPU
{A999EC29-ADBA-4A89-8EBD-E28594F6CE0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A999EC29-ADBA-4A89-8EBD-E28594F6CE0A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A999EC29-ADBA-4A89-8EBD-E28594F6CE0A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A999EC29-ADBA-4A89-8EBD-E28594F6CE0A}.Release|Any CPU.Build.0 = Release|Any CPU
{001D56C7-08D3-4F24-802C-C11077510D4F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{001D56C7-08D3-4F24-802C-C11077510D4F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{001D56C7-08D3-4F24-802C-C11077510D4F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{001D56C7-08D3-4F24-802C-C11077510D4F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View File

@ -12,7 +12,7 @@ public static class EmbeddedResources
public static byte[] ReadBynary(string resourcePath, Assembly assembly = null) public static byte[] ReadBynary(string resourcePath, Assembly assembly = null)
{ {
if (assembly == null) assembly = Assembly.GetCallingAssembly(); if (assembly is null) assembly = Assembly.GetCallingAssembly();
using var reader = new BinaryReader(GetResourceStream(resourcePath, assembly)); using var reader = new BinaryReader(GetResourceStream(resourcePath, assembly));
return reader.ReadBytes(int.MaxValue); return reader.ReadBytes(int.MaxValue);
} }
@ -20,7 +20,7 @@ public static class EmbeddedResources
public static string ReadText(string resourcePath, Assembly assembly = null) public static string ReadText(string resourcePath, Assembly assembly = null)
{ {
if (assembly == null) assembly = Assembly.GetCallingAssembly(); if (assembly is null) assembly = Assembly.GetCallingAssembly();
using var reader = new StreamReader(GetResourceStream(resourcePath, assembly)); using var reader = new StreamReader(GetResourceStream(resourcePath, assembly));
return reader.ReadToEnd(); return reader.ReadToEnd();
} }