mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2024-11-14 10:49:41 +01:00
Do some code formatting in LibHac
This commit is contained in:
parent
ef71eedc05
commit
80d52dd499
267 changed files with 310 additions and 342 deletions
|
@ -19,4 +19,4 @@ public readonly struct ApplicationId : IEquatable<ApplicationId>
|
|||
public override bool Equals(object obj) => obj is ApplicationId id && Equals(id);
|
||||
public bool Equals(ApplicationId other) => Value == other.Value;
|
||||
public override int GetHashCode() => HashCode.Combine(Value);
|
||||
}
|
||||
}
|
|
@ -71,4 +71,4 @@ public class ArpClient : IDisposable
|
|||
_reader.SetByMove(ref reader.Ref());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -9,4 +9,4 @@ public interface IReader : IDisposable
|
|||
Result GetApplicationLaunchPropertyWithApplicationId(out ApplicationLaunchProperty launchProperty, ApplicationId applicationId);
|
||||
Result GetApplicationControlProperty(out ApplicationControlProperty controlProperty, ulong processId);
|
||||
Result GetApplicationControlPropertyWithApplicationId(out ApplicationControlProperty controlProperty, ApplicationId applicationId);
|
||||
}
|
||||
}
|
|
@ -86,4 +86,4 @@ public class BcatServer
|
|||
return StorageManager;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -6,4 +6,4 @@ public enum BcatServiceType
|
|||
BcatS,
|
||||
BcatM,
|
||||
BcatA
|
||||
}
|
||||
}
|
|
@ -23,4 +23,4 @@ internal class BcatServiceObject : IServiceObject
|
|||
serviceObject.SetByCopy(in _serviceCreator);
|
||||
return Result.Success;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -7,4 +7,4 @@ public interface IDeliveryCacheDirectoryService : IDisposable
|
|||
Result Open(ref DirectoryName name);
|
||||
Result Read(out int entriesRead, Span<DeliveryCacheDirectoryEntry> entryBuffer);
|
||||
Result GetCount(out int count);
|
||||
}
|
||||
}
|
|
@ -8,4 +8,4 @@ public interface IDeliveryCacheFileService : IDisposable
|
|||
Result Read(out long bytesRead, long offset, Span<byte> destination);
|
||||
Result GetSize(out long size);
|
||||
Result GetDigest(out Digest digest);
|
||||
}
|
||||
}
|
|
@ -8,4 +8,4 @@ public interface IDeliveryCacheStorageService : IDisposable
|
|||
Result CreateFileService(ref SharedRef<IDeliveryCacheFileService> outFileService);
|
||||
Result CreateDirectoryService(ref SharedRef<IDeliveryCacheDirectoryService> outDirectoryService);
|
||||
Result EnumerateDeliveryCacheDirectory(out int namesRead, Span<DirectoryName> nameBuffer);
|
||||
}
|
||||
}
|
|
@ -10,4 +10,4 @@ public interface IServiceCreator : IDisposable
|
|||
|
||||
Result CreateDeliveryCacheStorageServiceWithApplicationId(
|
||||
ref SharedRef<IDeliveryCacheStorageService> outService, ApplicationId applicationId);
|
||||
}
|
||||
}
|
|
@ -11,4 +11,4 @@ internal enum AccessControl
|
|||
DeliveryTaskManagement = 1 << 3,
|
||||
Debug = 1 << 4,
|
||||
All = ~0
|
||||
}
|
||||
}
|
|
@ -97,4 +97,4 @@ internal class DeliveryCacheDirectoryMetaAccessor
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -119,4 +119,4 @@ internal class DeliveryCacheFileService : IDeliveryCacheFileService
|
|||
|
||||
Parent.NotifyCloseFile();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -55,4 +55,4 @@ internal class ServiceCreator : IServiceCreator
|
|||
|
||||
return Result.Success;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -51,4 +51,4 @@ public static class ResultBcat
|
|||
public static Result.Base InvalidDeliveryCacheStorageFile => new Result.Base(ModuleBcat, 204);
|
||||
/// <summary>Error code: 2122-0205; Inner value: 0x19a7a</summary>
|
||||
public static Result.Base StorageOpenLimitReached => new Result.Base(ModuleBcat, 205);
|
||||
}
|
||||
}
|
|
@ -58,5 +58,6 @@ public struct KeyBlob
|
|||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static implicit operator ReadOnlySpan<byte>(in KeyBlob value) => SpanHelpers.AsReadOnlyByteSpan(in value);
|
||||
|
||||
public readonly override string ToString() => BytesRo.ToHexString();
|
||||
}
|
|
@ -119,11 +119,11 @@ public struct Package2Meta
|
|||
|
||||
// Verify that no payloads overlap.
|
||||
for (int i = 0; i < Package2Header.PayloadCount - 1; i++)
|
||||
for (int j = i + 1; j < Package2Header.PayloadCount; j++)
|
||||
{
|
||||
if (Overlap.HasOverlap(PayloadOffsets[i], PayloadSizes[i], PayloadOffsets[j], PayloadSizes[j]))
|
||||
return ResultLibHac.InvalidPackage2MetaPayloadsOverlap.Log();
|
||||
}
|
||||
for (int j = i + 1; j < Package2Header.PayloadCount; j++)
|
||||
{
|
||||
if (Overlap.HasOverlap(PayloadOffsets[i], PayloadSizes[i], PayloadOffsets[j], PayloadSizes[j]))
|
||||
return ResultLibHac.InvalidPackage2MetaPayloadsOverlap.Log();
|
||||
}
|
||||
|
||||
// Check whether any payload contains the entrypoint.
|
||||
for (int i = 0; i < Package2Header.PayloadCount; i++)
|
||||
|
|
|
@ -106,4 +106,4 @@ public ref struct BlitSpan<T> where T : unmanaged
|
|||
{
|
||||
return Unsafe.SizeOf<T>() * elementCount;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -66,4 +66,4 @@ public readonly struct BlitStruct<T> where T : unmanaged
|
|||
{
|
||||
return Unsafe.SizeOf<T>() * elementCount;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -39,4 +39,4 @@ internal static class HResult
|
|||
COR_E_IO => ResultFs.TargetLocked.Value,
|
||||
_ => ResultFs.UnexpectedInLocalFileSystemE.Value
|
||||
};
|
||||
}
|
||||
}
|
|
@ -91,4 +91,4 @@ internal readonly ref struct InitializationGuard
|
|||
{
|
||||
return (guard & 1) != 0;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -60,4 +60,4 @@ public static unsafe class InteropWin32
|
|||
public Span<char> FileName => MemoryMarshal.CreateSpan(ref _fileName[0], 260);
|
||||
public Span<char> AlternateFileName => MemoryMarshal.CreateSpan(ref _alternateFileName[0], 14);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,7 +1,6 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using Type = LibHac.Common.Keys.KeyInfo.KeyType;
|
||||
|
||||
namespace LibHac.Common.Keys;
|
||||
|
|
|
@ -146,8 +146,7 @@ public static class ExternalKeyReader
|
|||
/// <param name="keyList">A list of all the keys that will be loaded into the key set.
|
||||
/// <see cref="DefaultKeySet.CreateKeyList"/> will create a list containing all loadable keys.</param>
|
||||
/// <param name="logger">An optional logger that key-parsing errors will be written to.</param>
|
||||
public static void ReadMainKeys(KeySet keySet, Stream reader, List<KeyInfo> keyList,
|
||||
IProgressReport logger = null)
|
||||
public static void ReadMainKeys(KeySet keySet, Stream reader, List<KeyInfo> keyList, IProgressReport logger = null)
|
||||
{
|
||||
if (reader == null) return;
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ using System.Text;
|
|||
using LibHac.Fs;
|
||||
using LibHac.Spl;
|
||||
using LibHac.Util;
|
||||
|
||||
using Type = LibHac.Common.Keys.KeyInfo.KeyType;
|
||||
using RangeType = LibHac.Common.Keys.KeyInfo.KeyRangeType;
|
||||
|
||||
|
@ -150,6 +149,7 @@ public static class ExternalKeyWriter
|
|||
PrintKeys(keySet, sb, DefaultKeySet.CreateKeyList(), Type.Common | Type.Seed | Type.DifferentDev, true);
|
||||
keySet.SetMode(KeySet.Mode.Prod);
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
|
@ -169,4 +169,4 @@ public static class ExternalKeyWriter
|
|||
keySet.SetMode(originalMode);
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -400,4 +400,4 @@ internal static class KeyDerivation
|
|||
srcKek.Data.CopyTo(dest);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -163,4 +163,4 @@ public readonly struct KeyInfo
|
|||
|
||||
return isValid1 && isValid2;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -34,18 +34,14 @@ public class MissingKeyException : LibHacException
|
|||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MissingKeyException"/> class.
|
||||
/// </summary>
|
||||
public MissingKeyException()
|
||||
{
|
||||
}
|
||||
public MissingKeyException() { }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MissingKeyException"/> class with a specified error message.
|
||||
/// </summary>
|
||||
/// <param name="message">The error message that explains the reason for the exception.</param>
|
||||
public MissingKeyException(string message)
|
||||
: base(message)
|
||||
{
|
||||
}
|
||||
: base(message) { }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MissingKeyException"/> class with a specified error message
|
||||
|
@ -54,9 +50,7 @@ public class MissingKeyException : LibHacException
|
|||
/// <param name="message">The error message that explains the reason for the exception.</param>
|
||||
/// <param name="innerException">The exception that is the cause of the current exception, or a null reference if no inner exception is specified.</param>
|
||||
public MissingKeyException(string message, Exception innerException)
|
||||
: base(message, innerException)
|
||||
{
|
||||
}
|
||||
: base(message, innerException) { }
|
||||
|
||||
public override string Message
|
||||
{
|
||||
|
|
|
@ -10,18 +10,14 @@ public class LibHacException : Exception
|
|||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="LibHacException"/> class.
|
||||
/// </summary>
|
||||
public LibHacException()
|
||||
{
|
||||
}
|
||||
public LibHacException() { }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="LibHacException"/> class with a specified error message.
|
||||
/// </summary>
|
||||
/// <param name="message">The error message that explains the reason for the exception.</param>
|
||||
public LibHacException(string message)
|
||||
: base(message)
|
||||
{
|
||||
}
|
||||
: base(message) { }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="LibHacException"/> class with a specified error message
|
||||
|
@ -30,7 +26,5 @@ public class LibHacException : Exception
|
|||
/// <param name="message">The error message that explains the reason for the exception.</param>
|
||||
/// <param name="innerException">The exception that is the cause of the current exception, or a null reference if no inner exception is specified.</param>
|
||||
public LibHacException(string message, Exception innerException)
|
||||
: base(message, innerException)
|
||||
{
|
||||
}
|
||||
: base(message, innerException) { }
|
||||
}
|
|
@ -6,4 +6,4 @@ namespace LibHac.Common;
|
|||
public sealed class NonCopyableAttribute : Attribute { }
|
||||
|
||||
[AttributeUsage(AttributeTargets.Struct)]
|
||||
public sealed class NonCopyableDisposableAttribute : Attribute { }
|
||||
public sealed class NonCopyableDisposableAttribute : Attribute { }
|
|
@ -110,6 +110,7 @@ public class ProgressBar : IDisposable, IProgressReport
|
|||
int progressBlockCount = (int)Math.Min(progress * BlockCount, BlockCount);
|
||||
text = $"[{new string('#', progressBlockCount)}{new string('-', BlockCount - progressBlockCount)}] {_progress}/{_total} {progress:P1} {Animation[_animationIndex++ % Animation.Length]}{speed}";
|
||||
}
|
||||
|
||||
UpdateText(text);
|
||||
|
||||
ResetTimer();
|
||||
|
|
|
@ -35,9 +35,7 @@ public readonly ref struct Ref<T>
|
|||
/// <param name="pointer">The pointer to the target value.</param>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe Ref(void* pointer)
|
||||
: this(ref Unsafe.AsRef<T>(pointer))
|
||||
{
|
||||
}
|
||||
: this(ref Unsafe.AsRef<T>(pointer)) { }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <typeparamref name="T"/> reference represented by the current <see cref="Ref{T}"/> instance.
|
||||
|
@ -97,9 +95,7 @@ public readonly ref struct ReadOnlyRef<T>
|
|||
/// <param name="pointer">The pointer to the target value.</param>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe ReadOnlyRef(void* pointer)
|
||||
: this(in Unsafe.AsRef<T>(pointer))
|
||||
{
|
||||
}
|
||||
: this(in Unsafe.AsRef<T>(pointer)) { }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <typeparamref name="T"/> reference represented by the current <see cref="Ref{T}"/> instance.
|
||||
|
@ -130,4 +126,4 @@ public readonly ref struct ReadOnlyRef<T>
|
|||
{
|
||||
return reference.Value;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -37,4 +37,4 @@ public readonly ref struct RentedArray<T>
|
|||
ArrayPool<T>.Shared.Return(Array);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -18,4 +18,4 @@ public static class Shared
|
|||
dest = value;
|
||||
value = default;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -437,4 +437,4 @@ public struct WeakRef<T> : IDisposable where T : class, IDisposable
|
|||
|
||||
return sharedRef;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -113,4 +113,4 @@ public static class SpanHelpers
|
|||
{
|
||||
return ref MemoryMarshal.Cast<TFrom, TTo>(span)[0];
|
||||
}
|
||||
}
|
||||
}
|
|
@ -11,4 +11,4 @@ public static class U8StringHelpers
|
|||
{
|
||||
return new U8Span(value);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -63,4 +63,4 @@ public static class UnsafeHelpers
|
|||
SkipParamInit(out value2);
|
||||
SkipParamInit(out value3);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -230,6 +230,7 @@ public static class Utilities
|
|||
{
|
||||
return bytes.ToString("0 B"); // Byte
|
||||
}
|
||||
|
||||
// Divide by 1024 to get fractional value
|
||||
readable = readable / 1024;
|
||||
// Return formatted number with suffix
|
||||
|
|
|
@ -26,4 +26,4 @@ internal static class CryptoUtil
|
|||
|
||||
return result == 0;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -7,4 +7,4 @@ public interface IHash
|
|||
void Initialize();
|
||||
void Update(ReadOnlySpan<byte> data);
|
||||
void GetHash(Span<byte> hashBuffer);
|
||||
}
|
||||
}
|
|
@ -5,4 +5,4 @@ public enum HashState
|
|||
Initial = 0,
|
||||
Initialized,
|
||||
Done
|
||||
}
|
||||
}
|
|
@ -48,4 +48,4 @@ public struct Sha256Impl
|
|||
|
||||
_baseHash.Hash.CopyTo(hashBuffer);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -142,8 +142,7 @@ public static class Rsa
|
|||
{
|
||||
rng.NextBytes(rndBuf);
|
||||
g = GetBigInteger(rndBuf);
|
||||
}
|
||||
while (g >= n);
|
||||
} while (g >= n);
|
||||
|
||||
y = BigInteger.ModPow(g, r, n);
|
||||
|
||||
|
@ -243,4 +242,4 @@ public static class Rsa
|
|||
|
||||
return t;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -24,4 +24,4 @@ public static class Sha256
|
|||
sha256.Update(data);
|
||||
sha256.GetHash(hashBuffer);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -26,4 +26,4 @@ public class Sha256Generator : IHash
|
|||
{
|
||||
_baseHash.GetHash(hashBuffer);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -34,4 +34,4 @@ public readonly struct DiagClientImpl
|
|||
internal ref DiagClientGlobals Globals => ref Diag.Globals;
|
||||
|
||||
internal DiagClientImpl(DiagClient parentClient) => Diag = parentClient;
|
||||
}
|
||||
}
|
|
@ -141,4 +141,4 @@ internal class LogObserverManager
|
|||
curNode = curNode.Next;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -46,4 +46,4 @@ public static class Log
|
|||
|
||||
/// <summary>"<c>$</c>"</summary>
|
||||
public static ReadOnlySpan<byte> EmptyModuleName => new[] { (byte)'$' }; // "$"
|
||||
}
|
||||
}
|
|
@ -107,4 +107,4 @@ namespace LibHac.Diag.Impl
|
|||
public LogMetaData MetaData;
|
||||
public LogBody Body;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -34,4 +34,4 @@ public ref struct LogBody
|
|||
public U8Span Message;
|
||||
public bool IsHead;
|
||||
public bool IsTail;
|
||||
}
|
||||
}
|
|
@ -5,4 +5,4 @@ public struct FatAttribute
|
|||
public bool IsFatSafeEnabled;
|
||||
public bool IsFatFormatNormalized;
|
||||
public bool IsTimeStampUpdated;
|
||||
}
|
||||
}
|
|
@ -8,4 +8,4 @@ public struct FatFormatParam
|
|||
public uint ProtectedAreaSectors;
|
||||
public Result WriteVerifyErrorResult;
|
||||
public Memory<byte> WorkBuffer;
|
||||
}
|
||||
}
|
|
@ -492,7 +492,6 @@ namespace LibHac.Fs.Impl
|
|||
.Append(LogLineEnd);
|
||||
|
||||
OutputAccessLogImpl(fs, new U8Span(sb.Buffer));
|
||||
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
|
|
@ -8,4 +8,4 @@ public static class AccessLogHelpers
|
|||
return
|
||||
$"FS_ACCESS: {{ start: {(long)startTime.TotalMilliseconds,9}, end: {(long)endTime.TotalMilliseconds,9}, result: 0x{result.Value:x8}, handle: 0x{handleId:x8}, function: \"{caller}\"{message} }}";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
|
||||
using Buffer = LibHac.Mem.Buffer;
|
||||
using CacheHandle = System.UInt64;
|
||||
|
||||
|
|
|
@ -1258,7 +1258,7 @@ public static class PathFunctions
|
|||
/// <see cref="ResultFs.InvalidArgument"/>: <paramref name="pathBuffer"/> was too small to contain the built path.</returns>
|
||||
internal static Result SetUpFixedPathSaveMetaName(ref Path path, Span<byte> pathBuffer, uint metaType)
|
||||
{
|
||||
ReadOnlySpan<byte> metaExtension = new[] { (byte)'.', (byte)'m', (byte)'e', (byte)'t', (byte)'a' }; // ".meta"
|
||||
ReadOnlySpan<byte> metaExtension = new[] { (byte)'.', (byte)'m', (byte)'e', (byte)'t', (byte)'a' }; // ".meta"
|
||||
|
||||
var sb = new U8StringBuilder(pathBuffer);
|
||||
sb.Append((byte)'/').AppendFormat(metaType, 'x', 8).Append(metaExtension);
|
||||
|
@ -1282,9 +1282,9 @@ public static class PathFunctions
|
|||
{
|
||||
ReadOnlySpan<byte> metaDirectoryName = new[]
|
||||
{
|
||||
(byte)'/', (byte)'s', (byte)'a', (byte)'v', (byte)'e', (byte)'M', (byte)'e', (byte)'t',
|
||||
(byte)'a', (byte)'/'
|
||||
};
|
||||
(byte)'/', (byte)'s', (byte)'a', (byte)'v', (byte)'e', (byte)'M', (byte)'e', (byte)'t',
|
||||
(byte)'a', (byte)'/'
|
||||
};
|
||||
|
||||
var sb = new U8StringBuilder(pathBuffer);
|
||||
sb.Append(metaDirectoryName).AppendFormat(saveDataId, 'x', 16);
|
||||
|
|
|
@ -27,6 +27,6 @@ internal static class CommonPaths
|
|||
public static ReadOnlySpan<byte> SdCardNintendoRootDirectoryName => // Nintendo
|
||||
new[]
|
||||
{
|
||||
(byte) 'N', (byte) 'i', (byte) 'n', (byte) 't', (byte) 'e', (byte) 'n', (byte) 'd', (byte) 'o'
|
||||
(byte)'N', (byte)'i', (byte)'n', (byte)'t', (byte)'e', (byte)'n', (byte)'d', (byte)'o'
|
||||
};
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@
|
|||
using LibHac.Common.FixedArrays;
|
||||
|
||||
namespace LibHac.Fs;
|
||||
|
||||
public struct DirectoryEntry
|
||||
{
|
||||
public Array769<byte> Name;
|
||||
|
|
|
@ -21,4 +21,4 @@ public readonly struct DirectoryHandle : IDisposable
|
|||
Directory.GetParent().Hos.Fs.CloseDirectory(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -21,4 +21,4 @@ public readonly struct FileHandle : IDisposable
|
|||
File.Hos.Fs.CloseFile(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -39,4 +39,4 @@ public enum WriteOptionFlag
|
|||
{
|
||||
None = 0,
|
||||
Flush = 1
|
||||
}
|
||||
}
|
|
@ -126,4 +126,4 @@ public struct ScopedAutoAbortDisabler
|
|||
{
|
||||
_fsClient.SetCurrentThreadFsContext(_prevContext);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -74,7 +74,6 @@ public enum FileSystemProxyType
|
|||
RegisteredUpdate = 8
|
||||
}
|
||||
|
||||
|
||||
public enum ImageDirectoryId
|
||||
{
|
||||
Nand = 0,
|
||||
|
|
|
@ -311,6 +311,7 @@ internal class FileSystemAccessor : IDisposable
|
|||
res = _fileSystem.Get.RenameDirectory(in currentPathNormalized, in newPathNormalized);
|
||||
if (res.IsFailure()) return res.Miss();
|
||||
}
|
||||
|
||||
return Result.Success;
|
||||
}
|
||||
|
||||
|
@ -578,7 +579,7 @@ internal class FileSystemAccessor : IDisposable
|
|||
public static ReadOnlySpan<byte> LogLineEnd => new[] { (byte)')', (byte)'\n' }; // ")\n"
|
||||
|
||||
/// <summary>"<c> | </c>"</summary>
|
||||
public static ReadOnlySpan<byte> LogOrOperator => new[] { (byte)' ', (byte)'|', (byte)' ' }; // " | "
|
||||
public static ReadOnlySpan<byte> LogOrOperator => new[] { (byte)' ', (byte)'|', (byte)' ' }; // " | "
|
||||
|
||||
/// <summary>"<c>OpenMode_Read</c>"</summary>
|
||||
private static ReadOnlySpan<byte> LogOpenModeRead => // "OpenMode_Read"
|
||||
|
|
|
@ -27,4 +27,4 @@ public abstract class IAttributeFileSystem : IFileSystem
|
|||
protected abstract Result DoGetFileAttributes(out NxFileAttributes attributes, in Path path);
|
||||
protected abstract Result DoSetFileAttributes(in Path path, NxFileAttributes attributes);
|
||||
protected abstract Result DoGetFileSize(out long fileSize, in Path path);
|
||||
}
|
||||
}
|
|
@ -6,4 +6,4 @@ namespace LibHac.Fs.Fsa;
|
|||
public interface IMultiCommitTarget
|
||||
{
|
||||
SharedRef<IFileSystemSf> GetMultiCommitTarget();
|
||||
}
|
||||
}
|
|
@ -1,5 +1,4 @@
|
|||
global using GameCardHandle = System.UInt32;
|
||||
|
||||
using System;
|
||||
using LibHac.Common.FixedArrays;
|
||||
|
||||
|
|
|
@ -27,4 +27,4 @@ public enum MountHostOptionFlag
|
|||
{
|
||||
None = 0,
|
||||
PseudoCaseSensitive = 1
|
||||
}
|
||||
}
|
|
@ -89,4 +89,4 @@ public readonly struct FileRegion
|
|||
|
||||
return new FileRegion(inclusionStartOffset, inclusionSize);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -49,4 +49,4 @@ public class SharedLock : IDisposable
|
|||
_lock.EnterReadLock();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -30,4 +30,4 @@ internal class SdHandleManager : IDeviceHandleManager
|
|||
|
||||
return Result.Success;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,4 +5,4 @@ public static class PathTool
|
|||
// These are kept in nn::fs, but C# requires them to be inside a class
|
||||
internal const int EntryNameLengthMax = 0x300;
|
||||
internal const int MountNameLengthMax = 15;
|
||||
}
|
||||
}
|
|
@ -75,4 +75,4 @@ public static class ResultHandlingUtility
|
|||
if (!result.IsSuccess())
|
||||
Abort.DoAbort(result);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -25,4 +25,4 @@ public ref struct ScopedSetter<T>
|
|||
{
|
||||
return new ScopedSetter<T>(ref reference, value);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,7 +2,6 @@
|
|||
using LibHac.Fs.Fsa;
|
||||
using LibHac.Fs.Impl;
|
||||
using LibHac.FsSrv.Sf;
|
||||
|
||||
using IFileSystem = LibHac.Fs.Fsa.IFileSystem;
|
||||
using IFileSystemSf = LibHac.FsSrv.Sf.IFileSystem;
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ using LibHac.Fs.Fsa;
|
|||
using LibHac.Fs.Impl;
|
||||
using LibHac.FsSrv.Sf;
|
||||
using LibHac.Os;
|
||||
|
||||
using static LibHac.Fs.Impl.AccessLogStrings;
|
||||
using static LibHac.Fs.SaveData;
|
||||
using IFileSystem = LibHac.Fs.Fsa.IFileSystem;
|
||||
|
|
|
@ -8,7 +8,6 @@ using LibHac.Ncm;
|
|||
using LibHac.Os;
|
||||
using IFileSystem = LibHac.Fs.Fsa.IFileSystem;
|
||||
using IFileSystemSf = LibHac.FsSrv.Sf.IFileSystem;
|
||||
|
||||
using static LibHac.Fs.Impl.AccessLogStrings;
|
||||
using static LibHac.Fs.SaveData;
|
||||
|
||||
|
|
|
@ -144,4 +144,4 @@ public static class FileSystemProxyServiceObject
|
|||
{
|
||||
fs.Globals.FileSystemProxyServiceObject.DfcFileSystemProxyServiceObject.SetByMove(ref serviceObject);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,7 +5,6 @@ using LibHac.Common;
|
|||
using LibHac.Fs.Fsa;
|
||||
using LibHac.Sf;
|
||||
using LibHac.Util;
|
||||
|
||||
using IFile = LibHac.Fs.Fsa.IFile;
|
||||
using IFileSf = LibHac.FsSrv.Sf.IFile;
|
||||
using IDirectory = LibHac.Fs.Fsa.IDirectory;
|
||||
|
|
|
@ -9,10 +9,8 @@ using LibHac.Gc;
|
|||
using LibHac.Os;
|
||||
using LibHac.Sf;
|
||||
using LibHac.Util;
|
||||
|
||||
using static LibHac.Fs.Impl.AccessLogStrings;
|
||||
using static LibHac.Gc.Values;
|
||||
|
||||
using IFileSystem = LibHac.Fs.Fsa.IFileSystem;
|
||||
using IFileSystemSf = LibHac.FsSrv.Sf.IFileSystem;
|
||||
using IStorageSf = LibHac.FsSrv.Sf.IStorage;
|
||||
|
|
|
@ -6,7 +6,6 @@ using LibHac.FsSrv.Sf;
|
|||
using LibHac.Os;
|
||||
using IFileSystem = LibHac.Fs.Fsa.IFileSystem;
|
||||
using IFileSystemSf = LibHac.FsSrv.Sf.IFileSystem;
|
||||
|
||||
using static LibHac.Fs.Impl.AccessLogStrings;
|
||||
|
||||
namespace LibHac.Fs.Shim;
|
||||
|
|
|
@ -7,7 +7,6 @@ using LibHac.Ncm;
|
|||
using LibHac.Os;
|
||||
using IFileSystem = LibHac.Fs.Fsa.IFileSystem;
|
||||
using IFileSystemSf = LibHac.FsSrv.Sf.IFileSystem;
|
||||
|
||||
using static LibHac.Fs.Impl.AccessLogStrings;
|
||||
|
||||
namespace LibHac.Fs.Shim;
|
||||
|
|
|
@ -48,4 +48,4 @@ namespace LibHac.Fs.Shim
|
|||
return PriorityRaw.Normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,7 +5,6 @@ using LibHac.Diag;
|
|||
using LibHac.Fs.Impl;
|
||||
using LibHac.FsSrv.Sf;
|
||||
using LibHac.Os;
|
||||
|
||||
using static LibHac.Fs.Impl.AccessLogStrings;
|
||||
using static LibHac.Fs.SaveData;
|
||||
|
||||
|
|
|
@ -12,7 +12,6 @@ using LibHac.Ncm;
|
|||
using LibHac.Os;
|
||||
using LibHac.Sf;
|
||||
using LibHac.Time;
|
||||
|
||||
using static LibHac.Fs.Impl.AccessLogStrings;
|
||||
using static LibHac.Fs.SaveData;
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@ using LibHac.Fs.Shim;
|
|||
using LibHac.FsSrv.Sf;
|
||||
using LibHac.Sf;
|
||||
using LibHac.Util;
|
||||
|
||||
using static LibHac.Fs.SaveData;
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
|
|
@ -5,7 +5,6 @@ using LibHac.Fs.Fsa;
|
|||
using LibHac.Fs.Impl;
|
||||
using LibHac.FsSrv.Sf;
|
||||
using LibHac.Os;
|
||||
|
||||
using static LibHac.Fs.Impl.AccessLogStrings;
|
||||
using static LibHac.Fs.SaveData;
|
||||
using IFileSystem = LibHac.Fs.Fsa.IFileSystem;
|
||||
|
|
|
@ -7,4 +7,4 @@ internal static class StringTraits
|
|||
public const byte DriveSeparator = (byte)':';
|
||||
public const byte Dot = (byte)'.';
|
||||
public const byte NullTerminator = 0;
|
||||
}
|
||||
}
|
|
@ -55,4 +55,4 @@ public struct UserId : IEquatable<UserId>, IComparable<UserId>, IComparable
|
|||
public static bool operator >(UserId left, UserId right) => left.CompareTo(right) > 0;
|
||||
public static bool operator <=(UserId left, UserId right) => left.CompareTo(right) <= 0;
|
||||
public static bool operator >=(UserId left, UserId right) => left.CompareTo(right) >= 0;
|
||||
}
|
||||
}
|
|
@ -99,4 +99,4 @@ public readonly struct AccessFailureManagementService
|
|||
|
||||
return Result.Success;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -65,4 +65,4 @@ public class AccessFailureManagementServiceImpl
|
|||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -67,10 +67,10 @@ internal readonly struct AccessLogService
|
|||
private static ReadOnlySpan<byte> MultiProgramTag => // FS_ACCESS: { multi_program_tag: true }\n
|
||||
new[]
|
||||
{
|
||||
(byte) 'F', (byte) 'S', (byte) '_', (byte) 'A', (byte) 'C', (byte) 'C', (byte) 'E', (byte) 'S',
|
||||
(byte) 'S', (byte) ':', (byte) ' ', (byte) '{', (byte) ' ', (byte) 'm', (byte) 'u', (byte) 'l',
|
||||
(byte) 't', (byte) 'i', (byte) '_', (byte) 'p', (byte) 'r', (byte) 'o', (byte) 'g', (byte) 'r',
|
||||
(byte) 'a', (byte) 'm', (byte) '_', (byte) 't', (byte) 'a', (byte) 'g', (byte) ':', (byte) ' ',
|
||||
(byte) 't', (byte) 'r', (byte) 'u', (byte) 'e', (byte) ' ', (byte) '}', (byte) '\n'
|
||||
(byte)'F', (byte)'S', (byte)'_', (byte)'A', (byte)'C', (byte)'C', (byte)'E', (byte)'S',
|
||||
(byte)'S', (byte)':', (byte)' ', (byte)'{', (byte)' ', (byte)'m', (byte)'u', (byte)'l',
|
||||
(byte)'t', (byte)'i', (byte)'_', (byte)'p', (byte)'r', (byte)'o', (byte)'g', (byte)'r',
|
||||
(byte)'a', (byte)'m', (byte)'_', (byte)'t', (byte)'a', (byte)'g', (byte)':', (byte)' ',
|
||||
(byte)'t', (byte)'r', (byte)'u', (byte)'e', (byte)' ', (byte)'}', (byte)'\n'
|
||||
};
|
||||
}
|
|
@ -62,4 +62,4 @@ public class AccessLogServiceImpl : IDisposable
|
|||
var registry = new ProgramRegistryImpl(_config.FsServer);
|
||||
return registry.GetProgramInfo(out programInfo, processId);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -324,4 +324,4 @@ public readonly struct BaseFileSystemService
|
|||
|
||||
return Result.Success;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -123,4 +123,4 @@ public class BaseFileSystemServiceImpl
|
|||
var registry = new ProgramRegistryImpl(_config.FsServer);
|
||||
return registry.GetProgramInfo(out programInfo, processId);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -239,4 +239,4 @@ public class BaseStorageServiceImpl
|
|||
outDeviceOperator.SetByCopy(in _deviceOperator);
|
||||
return Result.Success;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -20,6 +20,7 @@ public class EmulatedGameCard
|
|||
{
|
||||
KeySet = keySet;
|
||||
}
|
||||
|
||||
public GameCardHandle GetGameCardHandle()
|
||||
{
|
||||
return Handle;
|
||||
|
|
|
@ -13,4 +13,4 @@ public class EmulatedSdCard
|
|||
{
|
||||
IsInserted = isInserted;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -98,4 +98,4 @@ public class ExternalKeySet
|
|||
{
|
||||
ExternalKeys.EnsureCapacity(capacity);
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue