summaryrefslogtreecommitdiff
path: root/Util.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Util.cs')
-rw-r--r--Util.cs19
1 files changed, 19 insertions, 0 deletions
diff --git a/Util.cs b/Util.cs
new file mode 100644
index 0000000..53c82e4
--- /dev/null
+++ b/Util.cs
@@ -0,0 +1,19 @@
+using HyperBooru.ApiModels;
+using System.Runtime.InteropServices;
+
+namespace HyperBooru.ApiClient;
+
+internal static class Util {
+ internal static PathType CurrentOSPathType {
+ get {
+ KeyValuePair<OSPlatform, PathType>[] osPlatformMap = [
+ new(OSPlatform.Windows, PathType.Windows),
+ new(OSPlatform.OSX, PathType.Unix),
+ new(OSPlatform.Linux, PathType.Unix),
+ new(OSPlatform.FreeBSD, PathType.Unix),
+ ];
+
+ return osPlatformMap.First(kv => RuntimeInformation.IsOSPlatform(kv.Key)).Value;
+ }
+ }
+}