Skip to content

Commit fdb3354

Browse files
jeffhandleylambdageek
authored andcommitted
Update System.Formats.Nrbf ref sources and restore package description (dotnet#108430)
* Restore System.Formats.Nrbf package description alongside package README * Add missing struct members to ref source * Update ref to match dotnet msbuild /t:GenerateReferenceAssemblySource * Remove 'EnableDefaultPackageReadmeFile' since 'true' is the default
1 parent 704d4d9 commit fdb3354

File tree

3 files changed

+38
-36
lines changed

3 files changed

+38
-36
lines changed

src/libraries/System.Formats.Nrbf/ref/System.Formats.Nrbf.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ namespace System.Formats.Nrbf
99
public abstract partial class ArrayRecord : System.Formats.Nrbf.SerializationRecord
1010
{
1111
internal ArrayRecord() { }
12+
public virtual long FlattenedLength { get { throw null; } }
1213
public override System.Formats.Nrbf.SerializationRecordId Id { get { throw null; } }
1314
public abstract System.ReadOnlySpan<int> Lengths { get; }
14-
public virtual long FlattenedLength { get; }
1515
public int Rank { get { throw null; } }
16-
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("The code for an array of the specified type might not be available.")]
16+
[System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute("The code for an array of the specified type might not be available.")]
1717
public System.Array GetArray(System.Type expectedArrayType, bool allowNulls = true) { throw null; }
1818
}
1919
public abstract partial class ClassRecord : System.Formats.Nrbf.SerializationRecord
@@ -46,11 +46,11 @@ internal ClassRecord() { }
4646
}
4747
public static partial class NrbfDecoder
4848
{
49-
public static System.Formats.Nrbf.SerializationRecord Decode(System.IO.Stream payload, out System.Collections.Generic.IReadOnlyDictionary<System.Formats.Nrbf.SerializationRecordId, System.Formats.Nrbf.SerializationRecord> recordMap, System.Formats.Nrbf.PayloadOptions options=null, bool leaveOpen=false) { throw null; }
50-
public static System.Formats.Nrbf.SerializationRecord Decode(System.IO.Stream payload, System.Formats.Nrbf.PayloadOptions? options=null, bool leaveOpen=false) { throw null; }
51-
public static System.Formats.Nrbf.ClassRecord DecodeClassRecord(System.IO.Stream payload, System.Formats.Nrbf.PayloadOptions? options=null, bool leaveOpen=false) { throw null; }
52-
public static bool StartsWithPayloadHeader(System.ReadOnlySpan<byte> bytes) { throw null; }
49+
public static System.Formats.Nrbf.SerializationRecord Decode(System.IO.Stream payload, out System.Collections.Generic.IReadOnlyDictionary<System.Formats.Nrbf.SerializationRecordId, System.Formats.Nrbf.SerializationRecord> recordMap, System.Formats.Nrbf.PayloadOptions? options = null, bool leaveOpen = false) { throw null; }
50+
public static System.Formats.Nrbf.SerializationRecord Decode(System.IO.Stream payload, System.Formats.Nrbf.PayloadOptions? options = null, bool leaveOpen = false) { throw null; }
51+
public static System.Formats.Nrbf.ClassRecord DecodeClassRecord(System.IO.Stream payload, System.Formats.Nrbf.PayloadOptions? options = null, bool leaveOpen = false) { throw null; }
5352
public static bool StartsWithPayloadHeader(System.IO.Stream stream) { throw null; }
53+
public static bool StartsWithPayloadHeader(System.ReadOnlySpan<byte> bytes) { throw null; }
5454
}
5555
public sealed partial class PayloadOptions
5656
{
@@ -77,8 +77,9 @@ internal SerializationRecord() { }
7777
public abstract System.Reflection.Metadata.TypeName TypeName { get; }
7878
public bool TypeNameMatches(System.Type type) { throw null; }
7979
}
80-
public partial struct SerializationRecordId : System.IEquatable<System.Formats.Nrbf.SerializationRecordId>
80+
public readonly partial struct SerializationRecordId : System.IEquatable<System.Formats.Nrbf.SerializationRecordId>
8181
{
82+
private readonly int _dummyPrimitive;
8283
public bool Equals(System.Formats.Nrbf.SerializationRecordId other) { throw null; }
8384
public override bool Equals(object? obj) { throw null; }
8485
public override int GetHashCode() { throw null; }

src/libraries/System.Formats.Nrbf/src/System.Formats.Nrbf.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
<EnableDefaultItems>true</EnableDefaultItems>
66
<CLSCompliant>false</CLSCompliant>
77
<IsPackable>true</IsPackable>
8+
<PackageDescription>Provides a safe reader for .NET Remoting Binary Format (NRBF) payloads.</PackageDescription>
89

910
<!-- Disabling baseline validation since this is a brand new package.
1011
Once this package has shipped a stable version, the following line
1112
should be removed in order to re-enable validation. -->
1213
<DisablePackageBaselineValidation>true</DisablePackageBaselineValidation>
13-
<EnableDefaultPackageReadmeFile>true</EnableDefaultPackageReadmeFile>
1414
</PropertyGroup>
1515
<ItemGroup>
1616
<Compile Include="$(CommonPath)System\Experimentals.cs"

src/libraries/System.Reflection.Metadata/ref/System.Reflection.Metadata.cs

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,19 @@ void System.Collections.IEnumerator.Reset() { }
157157
void System.IDisposable.Dispose() { }
158158
}
159159
}
160+
public sealed partial class AssemblyNameInfo
161+
{
162+
public AssemblyNameInfo(string name, System.Version? version = null, string? cultureName = null, System.Reflection.AssemblyNameFlags flags = System.Reflection.AssemblyNameFlags.None, System.Collections.Immutable.ImmutableArray<byte> publicKeyOrToken = default(System.Collections.Immutable.ImmutableArray<byte>)) { }
163+
public string? CultureName { get { throw null; } }
164+
public System.Reflection.AssemblyNameFlags Flags { get { throw null; } }
165+
public string FullName { get { throw null; } }
166+
public string Name { get { throw null; } }
167+
public System.Collections.Immutable.ImmutableArray<byte> PublicKeyOrToken { get { throw null; } }
168+
public System.Version? Version { get { throw null; } }
169+
public static System.Reflection.Metadata.AssemblyNameInfo Parse(System.ReadOnlySpan<char> assemblyName) { throw null; }
170+
public System.Reflection.AssemblyName ToAssemblyName() { throw null; }
171+
public static bool TryParse(System.ReadOnlySpan<char> assemblyName, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Reflection.Metadata.AssemblyNameInfo? result) { throw null; }
172+
}
160173
public readonly partial struct AssemblyReference
161174
{
162175
private readonly object _dummy;
@@ -2408,25 +2421,11 @@ public readonly partial struct TypeLayout
24082421
public int PackingSize { get { throw null; } }
24092422
public int Size { get { throw null; } }
24102423
}
2411-
public sealed partial class AssemblyNameInfo
2412-
{
2413-
public AssemblyNameInfo(string name, System.Version? version = null, string? cultureName = null, System.Reflection.AssemblyNameFlags flags = AssemblyNameFlags.None,
2414-
Collections.Immutable.ImmutableArray<byte> publicKeyOrToken = default) { }
2415-
public string Name { get { throw null; } }
2416-
public string? CultureName { get { throw null; } }
2417-
public string FullName { get { throw null; } }
2418-
public System.Version? Version { get { throw null; } }
2419-
public System.Reflection.AssemblyNameFlags Flags { get { throw null; } }
2420-
public System.Collections.Immutable.ImmutableArray<byte> PublicKeyOrToken { get { throw null; } }
2421-
public static System.Reflection.Metadata.AssemblyNameInfo Parse(System.ReadOnlySpan<char> assemblyName) { throw null; }
2422-
public static bool TryParse(System.ReadOnlySpan<char> assemblyName, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Reflection.Metadata.AssemblyNameInfo? result) { throw null; }
2423-
public System.Reflection.AssemblyName ToAssemblyName() { throw null; }
2424-
}
24252424
public sealed partial class TypeName
24262425
{
24272426
internal TypeName() { }
2427+
public System.Reflection.Metadata.AssemblyNameInfo? AssemblyName { get { throw null; } }
24282428
public string AssemblyQualifiedName { get { throw null; } }
2429-
public AssemblyNameInfo? AssemblyName { get { throw null; } }
24302429
public System.Reflection.Metadata.TypeName DeclaringType { get { throw null; } }
24312430
public string FullName { get { throw null; } }
24322431
public bool IsArray { get { throw null; } }
@@ -2438,19 +2437,19 @@ internal TypeName() { }
24382437
public bool IsSZArray { get { throw null; } }
24392438
public bool IsVariableBoundArrayType { get { throw null; } }
24402439
public string Name { get { throw null; } }
2441-
public static System.Reflection.Metadata.TypeName Parse(System.ReadOnlySpan<char> typeName, System.Reflection.Metadata.TypeNameParseOptions? options = null) { throw null; }
2442-
public static bool TryParse(System.ReadOnlySpan<char> typeName, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Reflection.Metadata.TypeName? result, System.Reflection.Metadata.TypeNameParseOptions? options = null) { throw null; }
24432440
public int GetArrayRank() { throw null; }
2441+
public System.Reflection.Metadata.TypeName GetElementType() { throw null; }
24442442
public System.Collections.Immutable.ImmutableArray<System.Reflection.Metadata.TypeName> GetGenericArguments() { throw null; }
24452443
public System.Reflection.Metadata.TypeName GetGenericTypeDefinition() { throw null; }
2446-
public System.Reflection.Metadata.TypeName GetElementType() { throw null; }
24472444
public int GetNodeCount() { throw null; }
2448-
public System.Reflection.Metadata.TypeName MakeSZArrayTypeName() { throw null; }
24492445
public System.Reflection.Metadata.TypeName MakeArrayTypeName(int rank) { throw null; }
24502446
public System.Reflection.Metadata.TypeName MakeByRefTypeName() { throw null; }
24512447
public System.Reflection.Metadata.TypeName MakeGenericTypeName(System.Collections.Immutable.ImmutableArray<System.Reflection.Metadata.TypeName> typeArguments) { throw null; }
24522448
public System.Reflection.Metadata.TypeName MakePointerTypeName() { throw null; }
2453-
public System.Reflection.Metadata.TypeName WithAssemblyName(AssemblyNameInfo? assemblyName) { throw null; }
2449+
public System.Reflection.Metadata.TypeName MakeSZArrayTypeName() { throw null; }
2450+
public static System.Reflection.Metadata.TypeName Parse(System.ReadOnlySpan<char> typeName, System.Reflection.Metadata.TypeNameParseOptions? options = null) { throw null; }
2451+
public static bool TryParse(System.ReadOnlySpan<char> typeName, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Reflection.Metadata.TypeName? result, System.Reflection.Metadata.TypeNameParseOptions? options = null) { throw null; }
2452+
public System.Reflection.Metadata.TypeName WithAssemblyName(System.Reflection.Metadata.AssemblyNameInfo? assemblyName) { throw null; }
24542453
}
24552454
public sealed partial class TypeNameParseOptions
24562455
{
@@ -2675,11 +2674,11 @@ public readonly partial struct FieldTypeEncoder
26752674
{
26762675
private readonly object _dummy;
26772676
private readonly int _dummyPrimitive;
2678-
public FieldTypeEncoder(System.Reflection.Metadata.BlobBuilder builder) { throw null; }
2677+
public FieldTypeEncoder(System.Reflection.Metadata.BlobBuilder builder) { throw null; }
26792678
public System.Reflection.Metadata.BlobBuilder Builder { get { throw null; } }
26802679
public System.Reflection.Metadata.Ecma335.CustomModifiersEncoder CustomModifiers() { throw null; }
26812680
public System.Reflection.Metadata.Ecma335.SignatureTypeEncoder Type(bool isByRef = false) { throw null; }
2682-
public void TypedReference() { throw null; }
2681+
public void TypedReference() { }
26832682
}
26842683
public readonly partial struct FixedArgumentsEncoder
26852684
{
@@ -3120,8 +3119,10 @@ public void UInt64() { }
31203119
public void UIntPtr() { }
31213120
public void VoidPointer() { }
31223121
}
3123-
public readonly struct SwitchInstructionEncoder
3122+
public readonly partial struct SwitchInstructionEncoder
31243123
{
3124+
private readonly object _dummy;
3125+
private readonly int _dummyPrimitive;
31253126
public void Branch(System.Reflection.Metadata.Ecma335.LabelHandle label) { }
31263127
}
31273128
public enum TableIndex : byte
@@ -3337,14 +3338,14 @@ public enum Machine : ushort
33373338
MipsFpu16 = (ushort)1126,
33383339
Tricore = (ushort)1312,
33393340
Ebc = (ushort)3772,
3340-
Amd64 = (ushort)34404,
3341-
M32R = (ushort)36929,
3342-
Arm64 = (ushort)43620,
3343-
LoongArch32 = (ushort)25138,
3344-
LoongArch64 = (ushort)25188,
33453341
RiscV32 = (ushort)20530,
33463342
RiscV64 = (ushort)20580,
33473343
RiscV128 = (ushort)20776,
3344+
LoongArch32 = (ushort)25138,
3345+
LoongArch64 = (ushort)25188,
3346+
Amd64 = (ushort)34404,
3347+
M32R = (ushort)36929,
3348+
Arm64 = (ushort)43620,
33483349
}
33493350
public partial class ManagedPEBuilder : System.Reflection.PortableExecutable.PEBuilder
33503351
{

0 commit comments

Comments
 (0)