Move common items to the Fs class

This commit is contained in:
Alex Barney 2019-09-21 13:05:45 -05:00
parent 0e01aa3984
commit 0fe3031701
138 changed files with 155 additions and 73 deletions

View file

@ -35,7 +35,7 @@ namespace LibHac.Common
public override bool Equals(object obj)
{
return obj is FsSystem.UserId other && Equals(other);
return obj is Id128 other && Equals(other);
}
public override int GetHashCode()

View file

@ -1,5 +1,4 @@
using System.Collections.Generic;
using LibHac.FsSystem;
namespace LibHac.Fs.Accessors
{

View file

@ -1,6 +1,5 @@
using System;
using LibHac.Common;
using LibHac.FsSystem;
using LibHac.FsService;
namespace LibHac.Fs

View file

@ -1,8 +1,9 @@
using System;
using System.Runtime.InteropServices;
using LibHac.Common;
using LibHac.FsSystem;
namespace LibHac.FsSystem
namespace LibHac.Fs
{
public class DirectoryEntryEx
{

View file

@ -1,5 +1,4 @@
using System;
using LibHac.FsSystem;
namespace LibHac.Fs
{

View file

@ -1,5 +1,4 @@
using LibHac.Common;
using LibHac.FsSystem;
using LibHac.FsService;
namespace LibHac.Fs

View file

@ -1,5 +1,4 @@
using LibHac.Common;
using LibHac.FsSystem;
using LibHac.FsService;
namespace LibHac.Fs

View file

@ -1,4 +1,4 @@
namespace LibHac.FsSystem
namespace LibHac.Fs
{
public struct FileTimeStampRaw
{

View file

@ -1,4 +1,4 @@
namespace LibHac.FsSystem
namespace LibHac.Fs
{
public enum BisPartitionId
{

View file

@ -1,4 +1,4 @@
namespace LibHac.FsSystem
namespace LibHac.Fs
{
public interface IAttributeFileSystem : IFileSystem
{

View file

@ -1,6 +1,6 @@
using System;
namespace LibHac.FsSystem
namespace LibHac.Fs
{
/// <summary>
/// Provides an interface for enumerating the child entries of a directory.

View file

@ -1,6 +1,7 @@
using System;
using LibHac.FsSystem;
namespace LibHac.FsSystem
namespace LibHac.Fs
{
/// <summary>
/// Provides an interface for reading and writing a sequence of bytes.

View file

@ -1,6 +1,7 @@
using System;
using LibHac.FsSystem;
namespace LibHac.FsSystem
namespace LibHac.Fs
{
/// <summary>
/// Provides an interface for accessing a file system. <c>/</c> is used as the path delimiter.

View file

@ -1,6 +1,6 @@
using System;
namespace LibHac.FsSystem
namespace LibHac.Fs
{
/// <summary>
/// Provides an interface for reading and writing a sequence of bytes.

View file

@ -1,5 +1,4 @@
using LibHac.Common;
using LibHac.FsSystem;
namespace LibHac.Fs
{
@ -24,6 +23,7 @@ namespace LibHac.Fs
return Result.Success;
}
// ReSharper disable once UnusedParameter.Local
private static bool CheckMountNameImpl(U8Span name)
{
// Todo

View file

@ -1,4 +1,4 @@
namespace LibHac.FsSystem
namespace LibHac.Fs
{
public class ResultFs
{

View file

@ -1,4 +1,4 @@
namespace LibHac.FsSystem
namespace LibHac.Fs
{
public static class ResultRangeFs
{

View file

@ -2,7 +2,7 @@
using System.Runtime.InteropServices;
using LibHac.Common;
namespace LibHac.FsSystem
namespace LibHac.Fs
{
[StructLayout(LayoutKind.Sequential, Size = 0x10)]
public struct RightsId : IEquatable<RightsId>, IComparable<RightsId>, IComparable

View file

@ -3,7 +3,7 @@ using System.Buffers.Binary;
using LibHac.FsSystem.Save;
using LibHac.Kvdb;
namespace LibHac.FsSystem
namespace LibHac.Fs
{
public class SaveDataAttribute : IComparable<SaveDataAttribute>, IComparable, IEquatable<SaveDataAttribute>, IExportable
{

View file

@ -4,7 +4,7 @@ using LibHac.Common;
using LibHac.FsSystem.Save;
using LibHac.Ncm;
namespace LibHac.FsSystem
namespace LibHac.Fs
{
[StructLayout(LayoutKind.Explicit, Size = 0x40)]
public struct SaveDataAttribute2
@ -67,4 +67,17 @@ namespace LibHac.FsSystem
public Span<byte> Hash => SpanHelpers.CreateSpan(ref _hashStart, HashLength);
}
[StructLayout(LayoutKind.Explicit, Size = 0x10)]
public struct SaveMetaCreateInfo
{
[FieldOffset(0)] public int Size;
[FieldOffset(4)] public SaveMetaType Type;
}
[StructLayout(LayoutKind.Explicit, Size = 0x40)]
public struct SaveDataCreateInfo
{
// Todo
}
}

View file

@ -2,7 +2,7 @@
using System.Runtime.InteropServices;
using LibHac.Common;
namespace LibHac.FsSystem
namespace LibHac.Fs
{
[StructLayout(LayoutKind.Sequential, Size = 0x10)]
public struct UserId : IEquatable<UserId>, IComparable<UserId>, IComparable

View file

@ -1,5 +1,5 @@
using System.Diagnostics;
using LibHac.FsSystem;
using LibHac.Fs;
namespace LibHac.FsService.Creators
{

View file

@ -1,5 +1,5 @@
using System.Diagnostics;
using LibHac.FsSystem;
using LibHac.Fs;
namespace LibHac.FsService.Creators
{

View file

@ -1,5 +1,5 @@
using System;
using LibHac.FsSystem;
using LibHac.Fs;
namespace LibHac.FsService.Creators
{

View file

@ -1,4 +1,5 @@
using System;
using LibHac.Fs;
using LibHac.FsSystem;
namespace LibHac.FsService.Creators

View file

@ -1,4 +1,4 @@
using LibHac.FsSystem;
using LibHac.Fs;
namespace LibHac.FsService.Creators
{

View file

@ -1,4 +1,4 @@
using LibHac.FsSystem;
using LibHac.Fs;
namespace LibHac.FsService.Creators
{

View file

@ -1,4 +1,4 @@
using LibHac.FsSystem;
using LibHac.Fs;
namespace LibHac.FsService.Creators
{

View file

@ -1,5 +1,5 @@
using System;
using LibHac.FsSystem;
using LibHac.Fs;
namespace LibHac.FsService.Creators
{

View file

@ -1,4 +1,4 @@
using LibHac.FsSystem;
using LibHac.Fs;
namespace LibHac.FsService.Creators
{

View file

@ -1,4 +1,4 @@
using LibHac.FsSystem;
using LibHac.Fs;
namespace LibHac.FsService.Creators
{

View file

@ -1,4 +1,4 @@
using LibHac.FsSystem;
using LibHac.Fs;
namespace LibHac.FsService.Creators
{

View file

@ -1,4 +1,4 @@
using LibHac.FsSystem;
using LibHac.Fs;
namespace LibHac.FsService.Creators
{

View file

@ -1,5 +1,5 @@
using System;
using LibHac.FsSystem;
using LibHac.Fs;
namespace LibHac.FsService.Creators
{

View file

@ -1,4 +1,4 @@
using LibHac.FsSystem;
using LibHac.Fs;
namespace LibHac.FsService.Creators
{

View file

@ -1,4 +1,4 @@
using LibHac.FsSystem;
using LibHac.Fs;
namespace LibHac.FsService.Creators
{

View file

@ -1,5 +1,6 @@
using System;
using LibHac.Common;
using LibHac.Fs;
using LibHac.FsSystem;
using LibHac.FsSystem.Save;

View file

@ -1,4 +1,4 @@
using LibHac.FsSystem;
using LibHac.Fs;
namespace LibHac.FsService.Creators
{

View file

@ -1,4 +1,4 @@
using LibHac.FsSystem;
using LibHac.Fs;
namespace LibHac.FsService.Creators
{

View file

@ -1,4 +1,4 @@
using LibHac.FsSystem;
using LibHac.Fs;
using LibHac.FsSystem.NcaUtils;
namespace LibHac.FsService.Creators

View file

@ -1,4 +1,4 @@
using LibHac.FsSystem;
using LibHac.Fs;
namespace LibHac.FsService.Creators
{

View file

@ -1,4 +1,4 @@
using LibHac.FsSystem;
using LibHac.Fs;
namespace LibHac.FsService.Creators
{

View file

@ -1,4 +1,5 @@
using LibHac.FsSystem;
using LibHac.Fs;
using LibHac.FsSystem;
namespace LibHac.FsService.Creators
{

View file

@ -10,6 +10,7 @@ namespace LibHac.FsService
private FileSystemProxyCore FsProxyCore { get; }
/// <summary>The client instance to be used for internal operations like save indexer access.</summary>
// ReSharper disable once UnusedAutoPropertyAccessor.Local
private FileSystemClient FsClient { get; }
public long CurrentProcess { get; private set; }
@ -110,7 +111,7 @@ namespace LibHac.FsService
if (!IsSystemSaveDataId(attribute.SaveId)) return ResultFs.InvalidArgument.Log();
Result rc = OpenSaveDataFileSystemImpl(out IFileSystem saveFs, out ulong saveDataId, spaceId,
Result rc = OpenSaveDataFileSystemImpl(out IFileSystem saveFs, out _, spaceId,
attribute, false, true);
if (rc.IsFailure()) return rc;
@ -159,6 +160,7 @@ namespace LibHac.FsService
if (saveDataId != SaveIndexerId)
{
// ReSharper disable once ConditionIsAlwaysTrueOrFalse
if (hasFixedId)
{
// todo: remove save indexer entry

View file

@ -1,4 +1,5 @@
using System;
using LibHac.Fs;
using LibHac.FsSystem;
using LibHac.FsSystem.Save;
using LibHac.FsService.Creators;
@ -157,9 +158,8 @@ namespace LibHac.FsService
// Missing save FS cache lookup
rc = FsCreators.SaveDataFileSystemCreator.Create(out IFileSystem saveFs,
out ISaveDataExtraDataAccessor extraDataAccessor, saveDirFs, saveDataId, allowDirectorySaveData,
useDeviceUniqueMac, type, null);
rc = FsCreators.SaveDataFileSystemCreator.Create(out IFileSystem saveFs, out _, saveDirFs, saveDataId,
allowDirectorySaveData, useDeviceUniqueMac, type, null);
if (rc.IsFailure()) return rc;

View file

@ -1,5 +1,6 @@
using System;
using LibHac.Common;
using LibHac.Fs;
using LibHac.FsSystem;
using LibHac.Ncm;
using LibHac.Spl;

View file

@ -2,7 +2,7 @@
using System.Buffers.Binary;
using LibHac.Kvdb;
namespace LibHac.FsSystem
namespace LibHac.FsService
{
public class SaveIndexerStruct : IExportable
{

View file

@ -1,4 +1,5 @@
using System;
using LibHac.Fs;
using LibHac.FsSystem;
namespace LibHac.FsService

View file

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -1,6 +1,7 @@
using System;
using System.Buffers;
using System.Buffers.Binary;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -1,4 +1,5 @@
using System;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -1,5 +1,6 @@
using System;
using LibHac.Common;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -1,4 +1,5 @@
using System;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -2,6 +2,7 @@
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Text;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -1,5 +1,6 @@
using System;
using System.Diagnostics;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -1,6 +1,6 @@
using System;
using LibHac.Common;
using LibHac.Fs;
#if CROSS_PLATFORM
using System.Runtime.InteropServices;
#endif

View file

@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -1,6 +1,6 @@
using System;
using System.Collections.Generic;
using LibHac.Fs;
#if CROSS_PLATFORM
using System.Runtime.InteropServices;
#endif

View file

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -1,4 +1,5 @@
using System;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -1,4 +1,5 @@
using System;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -1,5 +1,6 @@
using System;
using LibHac.Common;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -2,6 +2,7 @@
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Text;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -1,4 +1,5 @@
using System;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -3,6 +3,7 @@ using System.Buffers;
using System.Collections.Generic;
using System.IO;
using LibHac.Common;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO;
using System.Security.Cryptography;
using System.Text;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -2,6 +2,7 @@
using System.Buffers;
using System.IO;
using System.Security.Cryptography;
using LibHac.Fs;
using LibHac.FsSystem.Save;
namespace LibHac.FsSystem

View file

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO;
using System.Runtime.CompilerServices;
using LibHac.Common;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -1,5 +1,6 @@
using System;
using System.IO;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -1,6 +1,7 @@
using System;
using System.IO;
using System.Security;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -1,4 +1,5 @@
using System;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using LibHac.Fs;
using LibHac.FsSystem.RomFs;
namespace LibHac.FsSystem.NcaUtils

View file

@ -1,6 +1,7 @@
using System;
using System.Buffers.Binary;
using System.Diagnostics;
using LibHac.Fs;
namespace LibHac.FsSystem.NcaUtils
{

View file

@ -2,6 +2,7 @@
using System.IO;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using LibHac.Fs;
namespace LibHac.FsSystem.NcaUtils
{

View file

@ -1,4 +1,5 @@
using System;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -1,4 +1,5 @@
using System;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -1,5 +1,6 @@
using System;
using System.IO;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -2,6 +2,7 @@
using System.IO;
using System.Text;
using LibHac.Common;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -1,4 +1,5 @@
using System;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -4,6 +4,7 @@ using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -1,6 +1,7 @@
using System;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using LibHac.Fs;
#if HAS_FILE_SYSTEM_NAME
using System.IO.Enumeration;

View file

@ -1,4 +1,5 @@
using System;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -1,4 +1,5 @@
using System;
using LibHac.Fs;
namespace LibHac.FsSystem
{

View file

@ -1,5 +1,6 @@
using System;
using System.Runtime.InteropServices;
using LibHac.Fs;
namespace LibHac.FsSystem.RomFs
{

View file

@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using LibHac.Fs;
namespace LibHac.FsSystem.RomFs
{

View file

@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using LibHac.Fs;
namespace LibHac.FsSystem.RomFs
{

View file

@ -1,6 +1,7 @@
using System;
using System.Text;
using LibHac.Common;
using LibHac.Fs;
namespace LibHac.FsSystem.RomFs
{

View file

@ -1,4 +1,5 @@
using System;
using LibHac.Fs;
namespace LibHac.FsSystem.RomFs
{

View file

@ -1,4 +1,5 @@
using System;
using LibHac.Fs;
namespace LibHac.FsSystem.RomFs
{

View file

@ -2,6 +2,7 @@
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
using LibHac.Fs;
namespace LibHac.FsSystem.Save
{

View file

@ -1,5 +1,6 @@
using System;
using System.IO;
using LibHac.Fs;
namespace LibHac.FsSystem.Save
{

Some files were not shown because too many files have changed in this diff Show more