mirror of
https://github.com/SabreTools/SabreTools.Models.git
synced 2026-02-06 05:35:33 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ca58343c30 | ||
|
|
2f637e0012 | ||
|
|
80172942fd | ||
|
|
aa0960b42f | ||
|
|
2554f64277 | ||
|
|
4c5c960915 | ||
|
|
1cb49163dd |
@@ -4,7 +4,7 @@ namespace SabreTools.Models.Charts
|
||||
{
|
||||
/// <see href="https://github.com/TheNathannator/GuitarGame_ChartFormats/tree/main/doc/FileFormats/song.ini"/>
|
||||
/// <remarks>[song]/[Song]</remarks>
|
||||
internal class SongIni
|
||||
public class SongIni
|
||||
{
|
||||
#region Song/Chart Metadata
|
||||
|
||||
|
||||
16
SabreTools.Models/Charts/Tier.cs
Normal file
16
SabreTools.Models/Charts/Tier.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
namespace SabreTools.Models.Charts
|
||||
{
|
||||
/// <see href="https://github.com/TheNathannator/GuitarGame_ChartFormats/blob/main/doc/FileFormats/Other/Frets%20on%20Fire%20X/Careers.md"/>
|
||||
public class Tier
|
||||
{
|
||||
/// <summary>
|
||||
/// Display name of the tier.
|
||||
/// </summary>
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Name used for associating a song with this tier, and for checking unlock requirements.
|
||||
/// </summary>
|
||||
public string? UnlockId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SabreTools.Models.Charts
|
||||
{
|
||||
/// <see href="https://github.com/TheNathannator/GuitarGame_ChartFormats/blob/main/doc/FileFormats/Other/Frets%20on%20Fire%20X/Careers.md"/>
|
||||
/// <remarks>[titles]</remarks>
|
||||
internal class TitlesIni
|
||||
public class TitlesIni
|
||||
{
|
||||
/// <summary>
|
||||
/// A space-separated list of .ini sections to include in the career.
|
||||
@@ -13,9 +11,8 @@ namespace SabreTools.Models.Charts
|
||||
public string[]? SectionList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// `name` - Display name of the tier.
|
||||
/// `unlock_id` - Name used for associating a song with this tier, and for checking unlock requirements.
|
||||
/// This entry points to other sections that should be used as part of the career.
|
||||
/// </summary>
|
||||
public Dictionary<string, (string? Name, string? UnlockId)>? Sections { get; set; }
|
||||
public Tier[]? Sections { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<Version>1.4.9</Version>
|
||||
<Version>1.4.10</Version>
|
||||
<WarningsNotAsErrors>CS0618</WarningsNotAsErrors>
|
||||
|
||||
<!-- Package Properties -->
|
||||
@@ -39,15 +39,6 @@
|
||||
<None Include="../README.md" Pack="true" PackagePath="" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Support for old .NET versions -->
|
||||
<ItemGroup
|
||||
Condition="$(TargetFramework.StartsWith(`net2`)) OR $(TargetFramework.StartsWith(`net3`))">
|
||||
<PackageReference Include="MinValueTupleBridge" Version="0.2.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="$(TargetFramework.StartsWith(`net4`))">
|
||||
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SabreTools.Models.TAR
|
||||
{
|
||||
public sealed class Archive
|
||||
{
|
||||
/// <summary>
|
||||
/// File header
|
||||
/// 1 or more entries
|
||||
/// </summary>
|
||||
public Header? Header { get; set; }
|
||||
public List<Entry>? Entries { get; set; }
|
||||
}
|
||||
}
|
||||
7
SabreTools.Models/TAR/Block.cs
Normal file
7
SabreTools.Models/TAR/Block.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace SabreTools.Models.TAR
|
||||
{
|
||||
public sealed class Block
|
||||
{
|
||||
public readonly byte[] Data = new byte[512];
|
||||
}
|
||||
}
|
||||
17
SabreTools.Models/TAR/Entry.cs
Normal file
17
SabreTools.Models/TAR/Entry.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SabreTools.Models.TAR
|
||||
{
|
||||
public sealed class Entry
|
||||
{
|
||||
/// <summary>
|
||||
/// Entry header
|
||||
/// </summary>
|
||||
public Header? Header { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 0 or more blocks representing the content
|
||||
/// </summary>
|
||||
public List<Block>? Blocks { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,85 +1,117 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.TAR
|
||||
{
|
||||
/// <see href="https://www.ibm.com/docs/en/aix/7.3?topic=files-tarh-file"/>
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
|
||||
public sealed class Header
|
||||
{
|
||||
/// <summary>
|
||||
/// File name
|
||||
/// File name without a forward slash
|
||||
/// </summary>
|
||||
public string? FileName { get; set; }
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 100)]
|
||||
public string? FileName;
|
||||
|
||||
/// <summary>
|
||||
/// File mode
|
||||
/// </summary>
|
||||
public Mode Mode { get; set; }
|
||||
/// <remarks>Octal string representation</remarks>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)]
|
||||
public byte[]? Mode;
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// Owner's numeric user ID
|
||||
/// </summary>
|
||||
public uint UID { get; set; }
|
||||
/// <remarks>Octal string representation</remarks>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)]
|
||||
public byte[]? UID;
|
||||
|
||||
/// <summary>
|
||||
/// Owner's numeric user ID
|
||||
/// <summary>
|
||||
/// Owner's numeric group ID
|
||||
/// </summary>
|
||||
public uint GID { get; set; }
|
||||
/// <remarks>Octal string representation</remarks>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)]
|
||||
public byte[]? GID;
|
||||
|
||||
/// <summary>
|
||||
/// File size in bytes
|
||||
/// </summary>
|
||||
public ulong Size { get; set; }
|
||||
/// <remarks>Octal string representation</remarks>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)]
|
||||
public byte[]? Size;
|
||||
|
||||
/// <summary>
|
||||
/// Last modification time in numeric Unix time format
|
||||
/// </summary>
|
||||
public ulong ModifiedTime { get; set; }
|
||||
/// <remarks>Octal string representation</remarks>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)]
|
||||
public byte[]? ModifiedTime;
|
||||
|
||||
/// <summary>
|
||||
/// Checksum for header record
|
||||
/// </summary>
|
||||
public ushort Checksum { get; set; }
|
||||
/// <remarks>Octal string representation</remarks>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)]
|
||||
public byte[]? Checksum;
|
||||
|
||||
/// <summary>
|
||||
/// Link indicator (file type) / Type flag
|
||||
/// </summary>
|
||||
public TypeFlag TypeFlag { get; set; }
|
||||
public TypeFlag TypeFlag;
|
||||
|
||||
/// <summary>
|
||||
/// Name of linked file
|
||||
/// Linked path name or file name
|
||||
/// </summary>
|
||||
public string? LinkName { get; set; }
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 100)]
|
||||
public string? LinkName;
|
||||
|
||||
#region USTAR Extension
|
||||
|
||||
/// <summary>
|
||||
/// UStar indicator, "ustar", then NUL
|
||||
/// </summary>
|
||||
public string? Magic { get; set; }
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 6)]
|
||||
public string? Magic;
|
||||
|
||||
/// <summary>
|
||||
/// UStar version, "00"
|
||||
/// </summary>
|
||||
public string? Version { get; set; }
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 3)]
|
||||
public string? Version;
|
||||
|
||||
/// <summary>
|
||||
/// Owner user name
|
||||
/// </summary>
|
||||
public string? UserName { get; set; }
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
|
||||
public string? UserName;
|
||||
|
||||
/// <summary>
|
||||
/// Owner group name
|
||||
/// </summary>
|
||||
public string? GroupName { get; set; }
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
|
||||
public string? GroupName;
|
||||
|
||||
/// <summary>
|
||||
/// Device major number
|
||||
/// </summary>
|
||||
public string? DevMajor { get; set; }
|
||||
/// <remarks>Octal string representation(?)</remarks>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)]
|
||||
public string? DevMajor;
|
||||
|
||||
/// <summary>
|
||||
/// Device minor number
|
||||
/// </summary>
|
||||
public string? DevMinor { get; set; }
|
||||
/// <remarks>Octal string representation(?)</remarks>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)]
|
||||
public string? DevMinor;
|
||||
|
||||
/// <summary>
|
||||
/// Filename prefix
|
||||
/// Path name without trailing slashes
|
||||
/// </summary>
|
||||
public string? Prefix { get; set; }
|
||||
/// <remarks>155 bytes</remarks>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 155)]
|
||||
public string? Prefix;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user