mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2025-02-09 13:14:46 +01:00
Move FsSystem/Save
This commit is contained in:
parent
fef8e16a85
commit
2d86d63fc6
@ -6,7 +6,7 @@ using LibHac.Diag;
|
|||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
using LibHac.Fs.Fsa;
|
using LibHac.Fs.Fsa;
|
||||||
using LibHac.FsSystem;
|
using LibHac.FsSystem;
|
||||||
using LibHac.FsSystem.Save;
|
using LibHac.Tools.FsSystem.Save;
|
||||||
using LibHac.Util;
|
using LibHac.Util;
|
||||||
|
|
||||||
using OpenType = LibHac.FsSrv.SaveDataOpenTypeSetFileStorage.OpenType;
|
using OpenType = LibHac.FsSrv.SaveDataOpenTypeSetFileStorage.OpenType;
|
||||||
@ -123,4 +123,4 @@ public class SaveDataFileSystemCreator : ISaveDataFileSystemCreator
|
|||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -10,7 +10,7 @@ using LibHac.Util;
|
|||||||
using Buffer = LibHac.Mem.Buffer;
|
using Buffer = LibHac.Mem.Buffer;
|
||||||
using CacheHandle = System.Int64;
|
using CacheHandle = System.Int64;
|
||||||
|
|
||||||
namespace LibHac.FsSystem.Save;
|
namespace LibHac.FsSystem;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An <see cref="IStorage"/> that provides buffered access to a base <see cref="IStorage"/>.
|
/// An <see cref="IStorage"/> that provides buffered access to a base <see cref="IStorage"/>.
|
||||||
@ -21,7 +21,7 @@ public class BufferedStorage : IStorage
|
|||||||
private const int InvalidIndex = -1;
|
private const int InvalidIndex = -1;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Caches a single block of data for a <see cref="Save.BufferedStorage"/>
|
/// Caches a single block of data for a <see cref="FsSystem.BufferedStorage"/>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private struct Cache : IDisposable
|
private struct Cache : IDisposable
|
||||||
{
|
{
|
||||||
@ -101,7 +101,7 @@ public class BufferedStorage : IStorage
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Decrements the ref-count and adds the <see cref="Cache"/> to its <see cref="Save.BufferedStorage"/>'s
|
/// Decrements the ref-count and adds the <see cref="Cache"/> to its <see cref="FsSystem.BufferedStorage"/>'s
|
||||||
/// fetch list if the <see cref="Cache"/> has no more references, and registering the buffer with
|
/// fetch list if the <see cref="Cache"/> has no more references, and registering the buffer with
|
||||||
/// the <see cref="IBufferManager"/> if not dirty.
|
/// the <see cref="IBufferManager"/> if not dirty.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -186,7 +186,7 @@ public class BufferedStorage : IStorage
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Increments the ref-count and removes the <see cref="Cache"/> from its
|
/// Increments the ref-count and removes the <see cref="Cache"/> from its
|
||||||
/// <see cref="Save.BufferedStorage"/>'s fetch list if needed.
|
/// <see cref="FsSystem.BufferedStorage"/>'s fetch list if needed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void Unlink()
|
public void Unlink()
|
||||||
{
|
{
|
||||||
@ -557,7 +557,7 @@ public class BufferedStorage : IStorage
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Allows iteration over the <see cref="Save.BufferedStorage.Cache"/> in a <see cref="Save.BufferedStorage"/>.
|
/// Allows iteration over the <see cref="Cache"/> in a <see cref="FsSystem.BufferedStorage"/>.
|
||||||
/// Several options exist for which Caches to iterate.
|
/// Several options exist for which Caches to iterate.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private ref struct SharedCache
|
private ref struct SharedCache
|
||||||
@ -584,11 +584,11 @@ public class BufferedStorage : IStorage
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Moves to the next <see cref="Save.BufferedStorage.Cache"/> that contains data from the specified range.
|
/// Moves to the next <see cref="FsSystem.BufferedStorage.Cache"/> that contains data from the specified range.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="offset">The start offset of the range.</param>
|
/// <param name="offset">The start offset of the range.</param>
|
||||||
/// <param name="size">The size of the range.</param>
|
/// <param name="size">The size of the range.</param>
|
||||||
/// <returns><see langword="true"/> if a <see cref="Save.BufferedStorage.Cache"/> from the
|
/// <returns><see langword="true"/> if a <see cref="FsSystem.BufferedStorage.Cache"/> from the
|
||||||
/// specified range was found. <see langword="false"/> if no matching Caches exist,
|
/// specified range was found. <see langword="false"/> if no matching Caches exist,
|
||||||
/// or if all matching Caches have already been iterated.</returns>
|
/// or if all matching Caches have already been iterated.</returns>
|
||||||
public bool AcquireNextOverlappedCache(long offset, long size)
|
public bool AcquireNextOverlappedCache(long offset, long size)
|
||||||
@ -643,9 +643,9 @@ public class BufferedStorage : IStorage
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Moves to the next dirty <see cref="Save.BufferedStorage.Cache"/>.
|
/// Moves to the next dirty <see cref="FsSystem.BufferedStorage.Cache"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns><see langword="true"/> if a dirty <see cref="Save.BufferedStorage.Cache"/> was found.
|
/// <returns><see langword="true"/> if a dirty <see cref="FsSystem.BufferedStorage.Cache"/> was found.
|
||||||
/// <see langword="false"/> if no dirty Caches exist,
|
/// <see langword="false"/> if no dirty Caches exist,
|
||||||
/// or if all dirty Caches have already been iterated.</returns>
|
/// or if all dirty Caches have already been iterated.</returns>
|
||||||
public bool AcquireNextDirtyCache()
|
public bool AcquireNextDirtyCache()
|
||||||
@ -686,9 +686,9 @@ public class BufferedStorage : IStorage
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Moves to the next valid <see cref="Save.BufferedStorage.Cache"/>.
|
/// Moves to the next valid <see cref="FsSystem.BufferedStorage.Cache"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns><see langword="true"/> if a valid <see cref="Save.BufferedStorage.Cache"/> was found.
|
/// <returns><see langword="true"/> if a valid <see cref="FsSystem.BufferedStorage.Cache"/> was found.
|
||||||
/// <see langword="false"/> if no valid Caches exist,
|
/// <see langword="false"/> if no valid Caches exist,
|
||||||
/// or if all valid Caches have already been iterated.</returns>
|
/// or if all valid Caches have already been iterated.</returns>
|
||||||
public bool AcquireNextValidCache()
|
public bool AcquireNextValidCache()
|
||||||
@ -729,10 +729,10 @@ public class BufferedStorage : IStorage
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Moves to a <see cref="Save.BufferedStorage.Cache"/> that can be used for
|
/// Moves to a <see cref="FsSystem.BufferedStorage.Cache"/> that can be used for
|
||||||
/// fetching a new block from the base <see cref="IStorage"/>.
|
/// fetching a new block from the base <see cref="IStorage"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns><see langword="true"/> if a <see cref="Save.BufferedStorage.Cache"/> was acquired.
|
/// <returns><see langword="true"/> if a <see cref="FsSystem.BufferedStorage.Cache"/> was acquired.
|
||||||
/// Otherwise, <see langword="false"/>.</returns>
|
/// Otherwise, <see langword="false"/>.</returns>
|
||||||
public bool AcquireFetchableCache()
|
public bool AcquireFetchableCache()
|
||||||
{
|
{
|
||||||
@ -758,9 +758,9 @@ public class BufferedStorage : IStorage
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Reads from the current <see cref="Save.BufferedStorage.Cache"/>'s buffer.
|
/// Reads from the current <see cref="FsSystem.BufferedStorage.Cache"/>'s buffer.
|
||||||
/// The provided <paramref name="offset"/> must be inside the block of
|
/// The provided <paramref name="offset"/> must be inside the block of
|
||||||
/// data held by the <see cref="Save.BufferedStorage.Cache"/>.
|
/// data held by the <see cref="FsSystem.BufferedStorage.Cache"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="offset">The offset in the base <see cref="IStorage"/> to be read from.</param>
|
/// <param name="offset">The offset in the base <see cref="IStorage"/> to be read from.</param>
|
||||||
/// <param name="buffer">The buffer in which to place the read data.</param>
|
/// <param name="buffer">The buffer in which to place the read data.</param>
|
||||||
@ -772,8 +772,8 @@ public class BufferedStorage : IStorage
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Buffers data to be written to the base <see cref="IStorage"/> when the current
|
/// Buffers data to be written to the base <see cref="IStorage"/> when the current
|
||||||
/// <see cref="Save.BufferedStorage.Cache"/> is flushed. The provided <paramref name="offset"/>
|
/// <see cref="FsSystem.BufferedStorage.Cache"/> is flushed. The provided <paramref name="offset"/>
|
||||||
/// must be contained by the block of data held by the <see cref="Save.BufferedStorage.Cache"/>.
|
/// must be contained by the block of data held by the <see cref="FsSystem.BufferedStorage.Cache"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="offset">The offset in the base <see cref="IStorage"/> to be written to.</param>
|
/// <param name="offset">The offset in the base <see cref="IStorage"/> to be written to.</param>
|
||||||
/// <param name="buffer">The buffer containing the data to be written.</param>
|
/// <param name="buffer">The buffer containing the data to be written.</param>
|
||||||
@ -784,7 +784,7 @@ public class BufferedStorage : IStorage
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// If the current <see cref="Save.BufferedStorage.Cache"/> is dirty,
|
/// If the current <see cref="FsSystem.BufferedStorage.Cache"/> is dirty,
|
||||||
/// flushes its data to the base <see cref="IStorage"/>.
|
/// flushes its data to the base <see cref="IStorage"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>The <see cref="Result"/> of the operation.</returns>
|
/// <returns>The <see cref="Result"/> of the operation.</returns>
|
||||||
@ -795,7 +795,7 @@ public class BufferedStorage : IStorage
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Invalidates the data in the current <see cref="Save.BufferedStorage.Cache"/>.
|
/// Invalidates the data in the current <see cref="FsSystem.BufferedStorage.Cache"/>.
|
||||||
/// Any dirty data will be discarded.
|
/// Any dirty data will be discarded.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void Invalidate()
|
public void Invalidate()
|
||||||
@ -805,11 +805,11 @@ public class BufferedStorage : IStorage
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks if the current <see cref="Save.BufferedStorage.Cache"/> covers any of the specified range.
|
/// Checks if the current <see cref="FsSystem.BufferedStorage.Cache"/> covers any of the specified range.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="offset">The start offset of the range to check.</param>
|
/// <param name="offset">The start offset of the range to check.</param>
|
||||||
/// <param name="size">The size of the range to check.</param>
|
/// <param name="size">The size of the range to check.</param>
|
||||||
/// <returns><see langword="true"/> if the current <see cref="Save.BufferedStorage.Cache"/>'s range
|
/// <returns><see langword="true"/> if the current <see cref="FsSystem.BufferedStorage.Cache"/>'s range
|
||||||
/// covers any of the input range. Otherwise, <see langword="false"/>.</returns>
|
/// covers any of the input range. Otherwise, <see langword="false"/>.</returns>
|
||||||
public bool Hits(long offset, long size)
|
public bool Hits(long offset, long size)
|
||||||
{
|
{
|
||||||
@ -818,7 +818,7 @@ public class BufferedStorage : IStorage
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Releases the current <see cref="Save.BufferedStorage.Cache"/> to return to the fetch list.
|
/// Releases the current <see cref="FsSystem.BufferedStorage.Cache"/> to return to the fetch list.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void Release()
|
private void Release()
|
||||||
{
|
{
|
||||||
@ -839,8 +839,8 @@ public class BufferedStorage : IStorage
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Provides exclusive access to a <see cref="Save.BufferedStorage.Cache"/>
|
/// Provides exclusive access to a <see cref="Cache"/>
|
||||||
/// entry in a <see cref="Save.BufferedStorage"/>.
|
/// entry in a <see cref="FsSystem.BufferedStorage"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private ref struct UniqueCache
|
private ref struct UniqueCache
|
||||||
{
|
{
|
||||||
@ -856,7 +856,7 @@ public class BufferedStorage : IStorage
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Disposes the <see cref="UniqueCache"/>, releasing any held <see cref="Save.BufferedStorage.Cache"/>.
|
/// Disposes the <see cref="UniqueCache"/>, releasing any held <see cref="FsSystem.BufferedStorage.Cache"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
@ -870,7 +870,7 @@ public class BufferedStorage : IStorage
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Attempts to gain exclusive access to the <see cref="Save.BufferedStorage.Cache"/> held by
|
/// Attempts to gain exclusive access to the <see cref="FsSystem.BufferedStorage.Cache"/> held by
|
||||||
/// <paramref name="sharedCache"/> and prepare it to read a new block from the base <see cref="IStorage"/>.
|
/// <paramref name="sharedCache"/> and prepare it to read a new block from the base <see cref="IStorage"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sharedCache">The <see cref="SharedCache"/> to gain exclusive access to.</param>
|
/// <param name="sharedCache">The <see cref="SharedCache"/> to gain exclusive access to.</param>
|
||||||
@ -894,7 +894,7 @@ public class BufferedStorage : IStorage
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Reads the storage block containing the specified offset into the
|
/// Reads the storage block containing the specified offset into the
|
||||||
/// <see cref="Save.BufferedStorage.Cache"/>'s buffer, and sets the Cache to that offset.
|
/// <see cref="FsSystem.BufferedStorage.Cache"/>'s buffer, and sets the Cache to that offset.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="offset">An offset in the block to fetch.</param>
|
/// <param name="offset">An offset in the block to fetch.</param>
|
||||||
/// <returns><see cref="Result.Success"/>: The operation was successful.<br/>
|
/// <returns><see cref="Result.Success"/>: The operation was successful.<br/>
|
||||||
@ -907,7 +907,7 @@ public class BufferedStorage : IStorage
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Fills the <see cref="Save.BufferedStorage.Cache"/>'s buffer from an input buffer containing a block of data
|
/// Fills the <see cref="FsSystem.BufferedStorage.Cache"/>'s buffer from an input buffer containing a block of data
|
||||||
/// read from the base <see cref="IStorage"/>, and sets the Cache to that offset.
|
/// read from the base <see cref="IStorage"/>, and sets the Cache to that offset.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="offset">The start offset of the block in the base <see cref="IStorage"/>
|
/// <param name="offset">The start offset of the block in the base <see cref="IStorage"/>
|
||||||
@ -1709,4 +1709,4 @@ public class BufferedStorage : IStorage
|
|||||||
|
|
||||||
return Result.Success;
|
return Result.Success;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -3,7 +3,7 @@ using System.Buffers;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using LibHac.Crypto;
|
using LibHac.Crypto;
|
||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
using LibHac.FsSystem.Save;
|
using LibHac.Tools.FsSystem.Save;
|
||||||
|
|
||||||
namespace LibHac.FsSystem;
|
namespace LibHac.FsSystem;
|
||||||
|
|
||||||
@ -250,4 +250,4 @@ public enum IntegrityCheckLevel
|
|||||||
/// An <see cref="InvalidDataException"/> will be thrown if an integrity check fails.
|
/// An <see cref="InvalidDataException"/> will be thrown if an integrity check fails.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ErrorOnInvalid
|
ErrorOnInvalid
|
||||||
}
|
}
|
@ -4,7 +4,7 @@ using LibHac.Common;
|
|||||||
using LibHac.Diag;
|
using LibHac.Diag;
|
||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
using LibHac.Fs.Fsa;
|
using LibHac.Fs.Fsa;
|
||||||
using LibHac.FsSystem.Save;
|
using LibHac.Tools.FsSystem.Save;
|
||||||
|
|
||||||
namespace LibHac.FsSystem;
|
namespace LibHac.FsSystem;
|
||||||
|
|
||||||
@ -145,4 +145,4 @@ public class SaveDataFileSystemCacheRegisterBase<T> : IFileSystem where T : IFil
|
|||||||
{
|
{
|
||||||
return _baseFileSystem.Get.GetTotalSpaceSize(out totalSpace, path);
|
return _baseFileSystem.Get.GetTotalSpaceSize(out totalSpace, path);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -9,9 +9,9 @@ using LibHac.Fs;
|
|||||||
using LibHac.Fs.Fsa;
|
using LibHac.Fs.Fsa;
|
||||||
using LibHac.FsSystem;
|
using LibHac.FsSystem;
|
||||||
using LibHac.FsSystem.NcaUtils;
|
using LibHac.FsSystem.NcaUtils;
|
||||||
using LibHac.FsSystem.Save;
|
|
||||||
using LibHac.Ncm;
|
using LibHac.Ncm;
|
||||||
using LibHac.Ns;
|
using LibHac.Ns;
|
||||||
|
using LibHac.Tools.FsSystem.Save;
|
||||||
using LibHac.Tools.Ncm;
|
using LibHac.Tools.Ncm;
|
||||||
using LibHac.Util;
|
using LibHac.Util;
|
||||||
|
|
||||||
|
@ -3,8 +3,9 @@ using System.Diagnostics;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
|
using LibHac.FsSystem;
|
||||||
|
|
||||||
namespace LibHac.FsSystem.Save;
|
namespace LibHac.Tools.FsSystem.Save;
|
||||||
|
|
||||||
public class AllocationTable
|
public class AllocationTable
|
||||||
{
|
{
|
||||||
@ -550,4 +551,4 @@ public class AllocationTableHeader
|
|||||||
DirectoryTableBlock = reader.ReadInt32();
|
DirectoryTableBlock = reader.ReadInt32();
|
||||||
FileTableBlock = reader.ReadInt32();
|
FileTableBlock = reader.ReadInt32();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace LibHac.FsSystem.Save;
|
namespace LibHac.Tools.FsSystem.Save;
|
||||||
|
|
||||||
public class AllocationTableIterator
|
public class AllocationTableIterator
|
||||||
{
|
{
|
||||||
@ -75,4 +75,4 @@ public class AllocationTableIterator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -3,7 +3,7 @@ using System.IO;
|
|||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
using LibHac.Util;
|
using LibHac.Util;
|
||||||
|
|
||||||
namespace LibHac.FsSystem.Save;
|
namespace LibHac.Tools.FsSystem.Save;
|
||||||
|
|
||||||
public class AllocationTableStorage : IStorage
|
public class AllocationTableStorage : IStorage
|
||||||
{
|
{
|
||||||
@ -147,4 +147,4 @@ public class AllocationTableStorage : IStorage
|
|||||||
|
|
||||||
return Result.Success;
|
return Result.Success;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -2,8 +2,9 @@
|
|||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
|
using LibHac.FsSystem;
|
||||||
|
|
||||||
namespace LibHac.FsSystem.Save;
|
namespace LibHac.Tools.FsSystem.Save;
|
||||||
|
|
||||||
public class DuplexBitmap
|
public class DuplexBitmap
|
||||||
{
|
{
|
||||||
@ -38,4 +39,4 @@ public class DuplexBitmap
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,7 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
|
using LibHac.FsSystem;
|
||||||
|
|
||||||
namespace LibHac.FsSystem.Save;
|
namespace LibHac.Tools.FsSystem.Save;
|
||||||
|
|
||||||
public class DuplexStorage : IStorage
|
public class DuplexStorage : IStorage
|
||||||
{
|
{
|
||||||
@ -123,4 +124,4 @@ public class DuplexStorage : IStorage
|
|||||||
dataToClear.Slice(i * BlockSize, BlockSize).Fill(SaveDataFileSystem.TrimFillValue);
|
dataToClear.Slice(i * BlockSize, BlockSize).Fill(SaveDataFileSystem.TrimFillValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -3,8 +3,9 @@ using System.IO;
|
|||||||
using LibHac.Common.Keys;
|
using LibHac.Common.Keys;
|
||||||
using LibHac.Crypto;
|
using LibHac.Crypto;
|
||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
|
using LibHac.FsSystem;
|
||||||
|
|
||||||
namespace LibHac.FsSystem.Save;
|
namespace LibHac.Tools.FsSystem.Save;
|
||||||
|
|
||||||
public class Header
|
public class Header
|
||||||
{
|
{
|
||||||
@ -284,4 +285,4 @@ public class ExtraData
|
|||||||
|
|
||||||
return new Guid(b);
|
return new Guid(b);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
|
|
||||||
namespace LibHac.FsSystem.Save;
|
namespace LibHac.Tools.FsSystem.Save;
|
||||||
|
|
||||||
public class HierarchicalDuplexStorage : IStorage
|
public class HierarchicalDuplexStorage : IStorage
|
||||||
{
|
{
|
||||||
@ -74,4 +74,4 @@ public class DuplexFsLayerInfo
|
|||||||
public IStorage DataA { get; set; }
|
public IStorage DataA { get; set; }
|
||||||
public IStorage DataB { get; set; }
|
public IStorage DataB { get; set; }
|
||||||
public DuplexInfo Info { get; set; }
|
public DuplexInfo Info { get; set; }
|
||||||
}
|
}
|
@ -3,9 +3,10 @@ using System.IO;
|
|||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using LibHac.Common;
|
using LibHac.Common;
|
||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
|
using LibHac.FsSystem;
|
||||||
using LibHac.Util;
|
using LibHac.Util;
|
||||||
|
|
||||||
namespace LibHac.FsSystem.Save;
|
namespace LibHac.Tools.FsSystem.Save;
|
||||||
|
|
||||||
public class HierarchicalSaveFileTable
|
public class HierarchicalSaveFileTable
|
||||||
{
|
{
|
||||||
@ -408,4 +409,4 @@ public class HierarchicalSaveFileTable
|
|||||||
public int NextSibling;
|
public int NextSibling;
|
||||||
public T Value;
|
public T Value;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,8 +1,9 @@
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
|
using LibHac.FsSystem;
|
||||||
using LibHac.Util;
|
using LibHac.Util;
|
||||||
|
|
||||||
namespace LibHac.FsSystem.Save;
|
namespace LibHac.Tools.FsSystem.Save;
|
||||||
|
|
||||||
public class JournalMap
|
public class JournalMap
|
||||||
{
|
{
|
||||||
@ -99,4 +100,4 @@ public class JournalMapParams
|
|||||||
public IStorage PhysicalBlockBitmap { get; set; }
|
public IStorage PhysicalBlockBitmap { get; set; }
|
||||||
public IStorage VirtualBlockBitmap { get; set; }
|
public IStorage VirtualBlockBitmap { get; set; }
|
||||||
public IStorage FreeBlockBitmap { get; set; }
|
public IStorage FreeBlockBitmap { get; set; }
|
||||||
}
|
}
|
@ -2,8 +2,9 @@
|
|||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
|
using LibHac.FsSystem;
|
||||||
|
|
||||||
namespace LibHac.FsSystem.Save;
|
namespace LibHac.Tools.FsSystem.Save;
|
||||||
|
|
||||||
public class JournalStorage : IStorage
|
public class JournalStorage : IStorage
|
||||||
{
|
{
|
||||||
@ -161,4 +162,4 @@ public class JournalMapEntry
|
|||||||
{
|
{
|
||||||
public int PhysicalIndex { get; set; }
|
public int PhysicalIndex { get; set; }
|
||||||
public int VirtualIndex { get; set; }
|
public int VirtualIndex { get; set; }
|
||||||
}
|
}
|
@ -3,8 +3,9 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
|
using LibHac.FsSystem;
|
||||||
|
|
||||||
namespace LibHac.FsSystem.Save;
|
namespace LibHac.Tools.FsSystem.Save;
|
||||||
|
|
||||||
public class RemapStorage : IStorage
|
public class RemapStorage : IStorage
|
||||||
{
|
{
|
||||||
@ -270,4 +271,4 @@ public class RemapSegment
|
|||||||
public List<MapEntry> Entries { get; } = new List<MapEntry>();
|
public List<MapEntry> Entries { get; } = new List<MapEntry>();
|
||||||
public long Offset { get; internal set; }
|
public long Offset { get; internal set; }
|
||||||
public long Length { get; internal set; }
|
public long Length { get; internal set; }
|
||||||
}
|
}
|
@ -4,7 +4,7 @@ using LibHac.Fs;
|
|||||||
using LibHac.Fs.Fsa;
|
using LibHac.Fs.Fsa;
|
||||||
using LibHac.Util;
|
using LibHac.Util;
|
||||||
|
|
||||||
namespace LibHac.FsSystem.Save;
|
namespace LibHac.Tools.FsSystem.Save;
|
||||||
|
|
||||||
public class SaveDataDirectory : IDirectory
|
public class SaveDataDirectory : IDirectory
|
||||||
{
|
{
|
||||||
@ -85,4 +85,4 @@ public class SaveDataDirectory : IDirectory
|
|||||||
|
|
||||||
return Result.Success;
|
return Result.Success;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -4,7 +4,7 @@ using LibHac.Common;
|
|||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
using LibHac.Fs.Fsa;
|
using LibHac.Fs.Fsa;
|
||||||
|
|
||||||
namespace LibHac.FsSystem.Save;
|
namespace LibHac.Tools.FsSystem.Save;
|
||||||
|
|
||||||
public class SaveDataFile : IFile
|
public class SaveDataFile : IFile
|
||||||
{
|
{
|
||||||
@ -104,4 +104,4 @@ public class SaveDataFile : IFile
|
|||||||
{
|
{
|
||||||
return ResultFs.NotImplemented.Log();
|
return ResultFs.NotImplemented.Log();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -5,9 +5,10 @@ using LibHac.Common.Keys;
|
|||||||
using LibHac.Crypto;
|
using LibHac.Crypto;
|
||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
using LibHac.Fs.Fsa;
|
using LibHac.Fs.Fsa;
|
||||||
|
using LibHac.FsSystem;
|
||||||
using Path = LibHac.Fs.Path;
|
using Path = LibHac.Fs.Path;
|
||||||
|
|
||||||
namespace LibHac.FsSystem.Save;
|
namespace LibHac.Tools.FsSystem.Save;
|
||||||
|
|
||||||
public class SaveDataFileSystem : IFileSystem
|
public class SaveDataFileSystem : IFileSystem
|
||||||
{
|
{
|
||||||
@ -331,4 +332,4 @@ public class SaveDataFileSystem : IFileSystem
|
|||||||
|
|
||||||
base.Dispose();
|
base.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -2,10 +2,11 @@
|
|||||||
using LibHac.Common;
|
using LibHac.Common;
|
||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
using LibHac.Fs.Fsa;
|
using LibHac.Fs.Fsa;
|
||||||
|
using LibHac.FsSystem;
|
||||||
using LibHac.Util;
|
using LibHac.Util;
|
||||||
using Path = LibHac.Fs.Path;
|
using Path = LibHac.Fs.Path;
|
||||||
|
|
||||||
namespace LibHac.FsSystem.Save;
|
namespace LibHac.Tools.FsSystem.Save;
|
||||||
|
|
||||||
public class SaveDataFileSystemCore : IFileSystem
|
public class SaveDataFileSystemCore : IFileSystem
|
||||||
{
|
{
|
||||||
@ -283,4 +284,4 @@ public class SaveHeader
|
|||||||
BlockCount = reader.ReadInt64();
|
BlockCount = reader.ReadInt64();
|
||||||
BlockSize = reader.ReadInt64();
|
BlockSize = reader.ReadInt64();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,6 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace LibHac.FsSystem.Save;
|
namespace LibHac.Tools.FsSystem.Save;
|
||||||
|
|
||||||
public static class SaveExtensions
|
public static class SaveExtensions
|
||||||
{
|
{
|
||||||
@ -13,4 +13,4 @@ public static class SaveExtensions
|
|||||||
yield return (iterator.PhysicalBlock, iterator.CurrentSegmentSize);
|
yield return (iterator.PhysicalBlock, iterator.CurrentSegmentSize);
|
||||||
} while (iterator.MoveNext());
|
} while (iterator.MoveNext());
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace LibHac.FsSystem.Save;
|
namespace LibHac.Tools.FsSystem.Save;
|
||||||
|
|
||||||
internal ref struct SaveEntryKey
|
internal ref struct SaveEntryKey
|
||||||
{
|
{
|
||||||
@ -33,4 +33,4 @@ public struct SaveFindPosition
|
|||||||
public int NextDirectory;
|
public int NextDirectory;
|
||||||
/// <summary>The ID of the next file to be enumerated.</summary>
|
/// <summary>The ID of the next file to be enumerated.</summary>
|
||||||
public int NextFile;
|
public int NextFile;
|
||||||
}
|
}
|
@ -7,7 +7,7 @@ using LibHac.Common;
|
|||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
using LibHac.Util;
|
using LibHac.Util;
|
||||||
|
|
||||||
namespace LibHac.FsSystem.Save;
|
namespace LibHac.Tools.FsSystem.Save;
|
||||||
|
|
||||||
// todo: Change constraint to "unmanaged" after updating to
|
// todo: Change constraint to "unmanaged" after updating to
|
||||||
// a newer SDK https://github.com/dotnet/csharplang/issues/1937
|
// a newer SDK https://github.com/dotnet/csharplang/issues/1937
|
||||||
@ -376,4 +376,4 @@ internal class SaveFsList<T> where T : struct
|
|||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Size = 0x40)]
|
[StructLayout(LayoutKind.Sequential, Size = 0x40)]
|
||||||
private struct NameDummy { }
|
private struct NameDummy { }
|
||||||
}
|
}
|
@ -1,6 +1,6 @@
|
|||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
|
|
||||||
namespace LibHac.FsSystem.Save;
|
namespace LibHac.Tools.FsSystem.Save;
|
||||||
|
|
||||||
internal static class SaveResults
|
internal static class SaveResults
|
||||||
{
|
{
|
||||||
@ -125,4 +125,4 @@ internal static class SaveResults
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -10,7 +10,7 @@ using LibHac.Fs;
|
|||||||
using LibHac.Fs.Fsa;
|
using LibHac.Fs.Fsa;
|
||||||
using LibHac.Fs.Impl;
|
using LibHac.Fs.Impl;
|
||||||
using LibHac.FsSystem;
|
using LibHac.FsSystem;
|
||||||
using LibHac.FsSystem.Save;
|
using LibHac.Tools.FsSystem.Save;
|
||||||
using static hactoolnet.Print;
|
using static hactoolnet.Print;
|
||||||
using Path = System.IO.Path;
|
using Path = System.IO.Path;
|
||||||
|
|
||||||
@ -353,4 +353,4 @@ internal static class ProcessSave
|
|||||||
|
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -9,9 +9,9 @@ using LibHac.Fs;
|
|||||||
using LibHac.Fs.Fsa;
|
using LibHac.Fs.Fsa;
|
||||||
using LibHac.FsSystem;
|
using LibHac.FsSystem;
|
||||||
using LibHac.FsSystem.NcaUtils;
|
using LibHac.FsSystem.NcaUtils;
|
||||||
using LibHac.FsSystem.Save;
|
|
||||||
using LibHac.Ns;
|
using LibHac.Ns;
|
||||||
using LibHac.Tools.Fs;
|
using LibHac.Tools.Fs;
|
||||||
|
using LibHac.Tools.FsSystem.Save;
|
||||||
using Path = System.IO.Path;
|
using Path = System.IO.Path;
|
||||||
|
|
||||||
namespace hactoolnet;
|
namespace hactoolnet;
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
using LibHac.FsSystem;
|
using LibHac.FsSystem;
|
||||||
using LibHac.FsSystem.Save;
|
|
||||||
using LibHac.Tests.Fs;
|
using LibHac.Tests.Fs;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
@ -224,4 +223,4 @@ public class BufferedStorageTests
|
|||||||
var tester = new StorageTester(testerConfig);
|
var tester = new StorageTester(testerConfig);
|
||||||
tester.Run(0x100);
|
tester.Run(0x100);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user