mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2025-02-09 13:14:46 +01:00
Add U8Span properties for all nacp string fields
This commit is contained in:
parent
5f648300d5
commit
a2c64797a9
@ -71,18 +71,18 @@ public struct ApplicationControlProperty
|
|||||||
public AccessibleLaunchRequiredVersionValue AccessibleLaunchRequiredVersion;
|
public AccessibleLaunchRequiredVersionValue AccessibleLaunchRequiredVersion;
|
||||||
public Array3000<byte> Reserved3448;
|
public Array3000<byte> Reserved3448;
|
||||||
|
|
||||||
public U8Span IsbnString => new U8Span(Isbn.ItemsRo);
|
public readonly U8Span IsbnString => new U8Span(Isbn.ItemsRo);
|
||||||
public U8Span DisplayVersionString => new U8Span(DisplayVersion.ItemsRo);
|
public readonly U8Span DisplayVersionString => new U8Span(DisplayVersion.ItemsRo);
|
||||||
public U8Span ApplicationErrorCodeCategoryString => new U8Span(ApplicationErrorCodeCategory.ItemsRo);
|
public readonly U8Span ApplicationErrorCodeCategoryString => new U8Span(ApplicationErrorCodeCategory.ItemsRo);
|
||||||
public U8Span BcatPassphraseString => new U8Span(BcatPassphrase.ItemsRo);
|
public readonly U8Span BcatPassphraseString => new U8Span(BcatPassphrase.ItemsRo);
|
||||||
|
|
||||||
public struct ApplicationTitle
|
public struct ApplicationTitle
|
||||||
{
|
{
|
||||||
private Array512<byte> _name;
|
public Array512<byte> Name;
|
||||||
private Array256<byte> _publisher;
|
public Array256<byte> Publisher;
|
||||||
|
|
||||||
public U8SpanMutable Name => new U8SpanMutable(_name.Items);
|
public readonly U8Span NameString => new U8Span(Name.ItemsRo);
|
||||||
public U8SpanMutable Publisher => new U8SpanMutable(_publisher.Items);
|
public readonly U8Span PublisherString => new U8Span(Publisher.ItemsRo);
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct ApplicationNeighborDetectionClientConfiguration
|
public struct ApplicationNeighborDetectionClientConfiguration
|
||||||
|
@ -231,9 +231,9 @@ public class SwitchFs : IDisposable
|
|||||||
|
|
||||||
foreach (ref readonly ApplicationControlProperty.ApplicationTitle desc in title.Control.Value.Title.ItemsRo)
|
foreach (ref readonly ApplicationControlProperty.ApplicationTitle desc in title.Control.Value.Title.ItemsRo)
|
||||||
{
|
{
|
||||||
if (!desc.Name.IsEmpty())
|
if (!desc.NameString.IsEmpty())
|
||||||
{
|
{
|
||||||
title.Name = desc.Name.ToString();
|
title.Name = desc.NameString.ToString();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,8 +15,11 @@ public class TypeLayoutTests
|
|||||||
|
|
||||||
Assert.Equal(0x300, Unsafe.SizeOf<ApplicationTitle>());
|
Assert.Equal(0x300, Unsafe.SizeOf<ApplicationTitle>());
|
||||||
|
|
||||||
Assert.Equal(0x000, GetOffset(in s, in s.Name.Value[0]));
|
Assert.Equal(0x000, GetOffset(in s, in s.Name));
|
||||||
Assert.Equal(0x200, GetOffset(in s, in s.Publisher.Value[0]));
|
Assert.Equal(0x200, GetOffset(in s, in s.Publisher));
|
||||||
|
|
||||||
|
Assert.Equal(0x000, GetOffset(in s, in s.NameString.Value[0]));
|
||||||
|
Assert.Equal(0x200, GetOffset(in s, in s.PublisherString.Value[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user