From a07e17c36959052a6cf78c1f4f5b77a0aaf37fed Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Fri, 14 Aug 2020 22:41:03 -0700 Subject: [PATCH] Make file option struct constructors public. --- src/LibHac/Fs/{IFile2.cs => FileOptions.cs} | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) rename src/LibHac/Fs/{IFile2.cs => FileOptions.cs} (69%) diff --git a/src/LibHac/Fs/IFile2.cs b/src/LibHac/Fs/FileOptions.cs similarity index 69% rename from src/LibHac/Fs/IFile2.cs rename to src/LibHac/Fs/FileOptions.cs index 567826fc..b844520b 100644 --- a/src/LibHac/Fs/IFile2.cs +++ b/src/LibHac/Fs/FileOptions.cs @@ -6,8 +6,7 @@ namespace LibHac.Fs { public readonly int Value; - // ReSharper disable once UnusedMember.Local - private ReadOption(int value) + public ReadOption(int value) { Value = value; } @@ -19,14 +18,19 @@ namespace LibHac.Fs { public readonly WriteOptionFlag Flags; - private WriteOption(WriteOptionFlag flags) + public WriteOption(int flags) + { + Flags = (WriteOptionFlag) flags; + } + + public WriteOption(WriteOptionFlag flags) { Flags = flags; } public bool HasFlushFlag() => Flags.HasFlag(WriteOptionFlag.Flush); - public static WriteOption None => default; + public static WriteOption None => new WriteOption(WriteOptionFlag.None); public static WriteOption Flush => new WriteOption(WriteOptionFlag.Flush); }