Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
Add missing proxy method attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
JustArchi committed Nov 19, 2021
1 parent 59d34ca commit ac32326
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>2.3.0</Version>
<Version>2.3.1</Version>
</PropertyGroup>

<PropertyGroup>
Expand Down
4 changes: 4 additions & 0 deletions JustArchiNET.Madness/ConvertMadness/Convert.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,19 @@ namespace JustArchiNET.Madness.ConvertMadness;
[PublicAPI]
public static class Convert {
[MadnessType(EMadnessType.Proxy)]
[Pure]
public static object ChangeType(object? value, Type conversionType, IFormatProvider? provider) => System.Convert.ChangeType(value, conversionType, provider);

[MadnessType(EMadnessType.Proxy)]
[Pure]
public static byte[] FromBase64String(string s) => System.Convert.FromBase64String(s);

[MadnessType(EMadnessType.Proxy)]
[Pure]
public static string ToBase64String(byte[] inArray) => System.Convert.ToBase64String(inArray);

[MadnessType(EMadnessType.Implementation)]
[Pure]
public static string ToHexString(byte[] inArray) {
if (inArray == null) {
throw new ArgumentNullException(nameof(inArray));
Expand Down
2 changes: 2 additions & 0 deletions JustArchiNET.Madness/EnvironmentMadness/Environment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ public static string? ProcessPath {
}
}

[ContractAnnotation("=>halt")]
[MadnessType(EMadnessType.Proxy)]
public static void Exit(int exitCode) => System.Environment.Exit(exitCode);

[MadnessType(EMadnessType.Proxy)]
[Pure]
public static string[] GetCommandLineArgs() => System.Environment.GetCommandLineArgs();

[MadnessType(EMadnessType.Proxy)]
Expand Down
9 changes: 9 additions & 0 deletions JustArchiNET.Madness/PathMadness/Path.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,28 @@ public static class Path {
[MadnessType(EMadnessType.Proxy)]
public static string Combine(params string[] paths) => System.IO.Path.Combine(paths);

[ContractAnnotation("null=>null")]
[MadnessType(EMadnessType.Proxy)]
[Pure]
public static string? GetDirectoryName(string? path) => System.IO.Path.GetDirectoryName(path);

[ContractAnnotation("null=>null;notnull=>notnull")]
[MadnessType(EMadnessType.Proxy)]
[Pure]
public static string? GetExtension(string? path) => System.IO.Path.GetExtension(path);

[ContractAnnotation("null=>null;notnull=>notnull")]
[MadnessType(EMadnessType.Proxy)]
[Pure]
public static string? GetFileName(string? path) => System.IO.Path.GetFileName(path);

[ContractAnnotation("null=>null;notnull=>notnull")]
[MadnessType(EMadnessType.Proxy)]
[Pure]
public static string? GetFileNameWithoutExtension(string? path) => System.IO.Path.GetFileNameWithoutExtension(path);

[MadnessType(EMadnessType.Proxy)]
[Pure]
public static string GetFullPath(string path) => System.IO.Path.GetFullPath(path);

[MadnessType(EMadnessType.Implementation)]
Expand Down
4 changes: 4 additions & 0 deletions JustArchiNET.Madness/StringMadness/String.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,14 @@ public static string Create<TState>(int length, TState state, SpanAction<char, T
return new string(buffer);
}

[ContractAnnotation("null=>true", true)]
[MadnessType(EMadnessType.Proxy)]
[Pure]
public static bool IsNullOrEmpty(string value) => string.IsNullOrEmpty(value);

[ContractAnnotation("null=>true", true)]
[MadnessType(EMadnessType.Proxy)]
[Pure]
public static bool IsNullOrWhiteSpace(string value) => string.IsNullOrWhiteSpace(value);
}
#pragma warning restore CA1716, CA1720 // That's exactly our intention

0 comments on commit ac32326

Please sign in to comment.