mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2025-02-09 13:14:46 +01:00
Move RomFs
This commit is contained in:
parent
aa153980be
commit
34faf2b468
@ -1,7 +1,7 @@
|
|||||||
using LibHac.Common;
|
using LibHac.Common;
|
||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
using LibHac.Fs.Fsa;
|
using LibHac.Fs.Fsa;
|
||||||
using LibHac.FsSystem.RomFs;
|
using LibHac.Tools.FsSystem.RomFs;
|
||||||
|
|
||||||
namespace LibHac.FsSrv.FsCreator;
|
namespace LibHac.FsSrv.FsCreator;
|
||||||
|
|
||||||
@ -13,4 +13,4 @@ public class RomFileSystemCreator : IRomFileSystemCreator
|
|||||||
outFileSystem.Reset(new RomFsFileSystem(ref romFsStorage));
|
outFileSystem.Reset(new RomFsFileSystem(ref romFsStorage));
|
||||||
return Result.Success;
|
return Result.Success;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -10,8 +10,8 @@ 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.RomFs;
|
|
||||||
using LibHac.Spl;
|
using LibHac.Spl;
|
||||||
|
using LibHac.Tools.FsSystem.RomFs;
|
||||||
|
|
||||||
namespace LibHac.Tools.FsSystem.NcaUtils;
|
namespace LibHac.Tools.FsSystem.NcaUtils;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
|
||||||
namespace LibHac;
|
namespace LibHac.Tools.FsSystem.RomFs;
|
||||||
|
|
||||||
internal static class HashHelpers
|
internal static class HashHelpers
|
||||||
{
|
{
|
||||||
@ -103,4 +103,4 @@ internal static class HashHelpers
|
|||||||
|
|
||||||
return min;
|
return min;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -2,9 +2,10 @@
|
|||||||
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.RomFs;
|
namespace LibHac.Tools.FsSystem.RomFs;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents the file table used by the RomFS format.
|
/// Represents the file table used by the RomFS format.
|
||||||
@ -384,4 +385,4 @@ public class HierarchicalRomFileTable<T> where T : unmanaged
|
|||||||
public int NextSibling;
|
public int NextSibling;
|
||||||
public T Info;
|
public T Info;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -5,9 +5,10 @@ using System.Linq;
|
|||||||
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;
|
||||||
|
|
||||||
namespace LibHac.FsSystem.RomFs;
|
namespace LibHac.Tools.FsSystem.RomFs;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Builds a RomFS from a collection of files.
|
/// Builds a RomFS from a collection of files.
|
||||||
@ -113,4 +114,4 @@ public class RomFsBuilder
|
|||||||
fileLength += table.Length;
|
fileLength += table.Length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -3,9 +3,10 @@ using System.Collections.Generic;
|
|||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
|
using LibHac.FsSystem;
|
||||||
using LibHac.Util;
|
using LibHac.Util;
|
||||||
|
|
||||||
namespace LibHac.FsSystem.RomFs;
|
namespace LibHac.Tools.FsSystem.RomFs;
|
||||||
|
|
||||||
internal class RomFsDictionary<T> where T : unmanaged
|
internal class RomFsDictionary<T> where T : unmanaged
|
||||||
{
|
{
|
||||||
@ -296,4 +297,4 @@ internal class RomFsDictionary<T> where T : unmanaged
|
|||||||
public int Next;
|
public int Next;
|
||||||
public int KeyLength;
|
public int KeyLength;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -2,9 +2,10 @@
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
using LibHac.Fs.Fsa;
|
using LibHac.Fs.Fsa;
|
||||||
|
using LibHac.FsSystem;
|
||||||
using LibHac.Util;
|
using LibHac.Util;
|
||||||
|
|
||||||
namespace LibHac.FsSystem.RomFs;
|
namespace LibHac.Tools.FsSystem.RomFs;
|
||||||
|
|
||||||
public class RomFsDirectory : IDirectory
|
public class RomFsDirectory : IDirectory
|
||||||
{
|
{
|
||||||
@ -85,4 +86,4 @@ public class RomFsDirectory : IDirectory
|
|||||||
|
|
||||||
return Result.Success;
|
return Result.Success;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace LibHac.FsSystem.RomFs;
|
namespace LibHac.Tools.FsSystem.RomFs;
|
||||||
|
|
||||||
internal ref struct RomEntryKey
|
internal ref struct RomEntryKey
|
||||||
{
|
{
|
||||||
@ -32,9 +32,7 @@ internal ref struct RomEntryKey
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo: Change constraint to "unmanaged" after updating to
|
internal ref struct RomKeyValuePair<T> where T : unmanaged
|
||||||
// a newer SDK https://github.com/dotnet/csharplang/issues/1937
|
|
||||||
internal ref struct RomKeyValuePair<T> where T : struct
|
|
||||||
{
|
{
|
||||||
public RomEntryKey Key;
|
public RomEntryKey Key;
|
||||||
public int Offset;
|
public int Offset;
|
||||||
@ -58,4 +56,4 @@ public struct FindPosition
|
|||||||
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;
|
||||||
}
|
}
|
@ -3,7 +3,7 @@ using LibHac.Common;
|
|||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
using LibHac.Fs.Fsa;
|
using LibHac.Fs.Fsa;
|
||||||
|
|
||||||
namespace LibHac.FsSystem.RomFs;
|
namespace LibHac.Tools.FsSystem.RomFs;
|
||||||
|
|
||||||
public class RomFsFile : IFile
|
public class RomFsFile : IFile
|
||||||
{
|
{
|
||||||
@ -67,4 +67,4 @@ public class RomFsFile : IFile
|
|||||||
{
|
{
|
||||||
return RomFsFileSystem.ConvertRomFsDriverPrivateResult(result);
|
return RomFsFileSystem.ConvertRomFsDriverPrivateResult(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -2,8 +2,9 @@
|
|||||||
using LibHac.Common;
|
using LibHac.Common;
|
||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
using LibHac.Fs.Fsa;
|
using LibHac.Fs.Fsa;
|
||||||
|
using LibHac.FsSystem;
|
||||||
|
|
||||||
namespace LibHac.FsSystem.RomFs;
|
namespace LibHac.Tools.FsSystem.RomFs;
|
||||||
|
|
||||||
public class RomFsFileSystem : IFileSystem
|
public class RomFsFileSystem : IFileSystem
|
||||||
{
|
{
|
||||||
@ -317,4 +318,4 @@ public class RomfsHeader
|
|||||||
FileMetaTableSize = func();
|
FileMetaTableSize = func();
|
||||||
DataOffset = func();
|
DataOffset = func();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,7 +1,7 @@
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
using LibHac.FsSystem;
|
using LibHac.FsSystem;
|
||||||
using LibHac.FsSystem.RomFs;
|
using LibHac.Tools.FsSystem.RomFs;
|
||||||
|
|
||||||
namespace hactoolnet;
|
namespace hactoolnet;
|
||||||
|
|
||||||
@ -60,4 +60,4 @@ internal static class ProcessFsBuild
|
|||||||
|
|
||||||
ctx.Logger.LogMessage($"Finished writing {ctx.Options.OutFile}");
|
ctx.Logger.LogMessage($"Finished writing {ctx.Options.OutFile}");
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,7 +1,7 @@
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
using LibHac.FsSystem;
|
using LibHac.FsSystem;
|
||||||
using LibHac.FsSystem.RomFs;
|
using LibHac.Tools.FsSystem.RomFs;
|
||||||
|
|
||||||
namespace hactoolnet;
|
namespace hactoolnet;
|
||||||
|
|
||||||
@ -42,4 +42,4 @@ internal static class ProcessRomfs
|
|||||||
romfs.Extract(ctx.Options.RomfsOutDir, ctx.Logger);
|
romfs.Extract(ctx.Options.RomfsOutDir, ctx.Logger);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,5 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using LibHac.FsSystem.RomFs;
|
using LibHac.Tools.FsSystem.RomFs;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace LibHac.Tests;
|
namespace LibHac.Tests;
|
||||||
@ -200,4 +200,4 @@ public class RomFsTests
|
|||||||
Assert.Equal(itemC2, actualItemC2);
|
Assert.Equal(itemC2, actualItemC2);
|
||||||
Assert.Equal(itemC3, actualItemC3);
|
Assert.Equal(itemC3, actualItemC3);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user