Skip to content

Commit b014c00

Browse files
authored
Merge pull request #2 from smdn/releases/Smdn.Reflection.ReverseGenerating-1.1.0-1657376811
Release main/Smdn.Reflection.ReverseGenerating-1.1.0
2 parents 074a83a + c5755c7 commit b014c00

5 files changed

+398
-65
lines changed
Lines changed: 62 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,104 @@
1-
// Smdn.Reflection.ReverseGenerating.dll (Smdn.Reflection.ReverseGenerating-1.0.5)
1+
// Smdn.Reflection.ReverseGenerating.dll (Smdn.Reflection.ReverseGenerating-1.1.0)
22
// Name: Smdn.Reflection.ReverseGenerating
3-
// AssemblyVersion: 1.0.5.0
4-
// InformationalVersion: 1.0.5+dd9591cbed8623f61349f46c833f14f1578db406
3+
// AssemblyVersion: 1.1.0.0
4+
// InformationalVersion: 1.1.0+074a83ab64ee9e829c2f3835cf0c03af8af0f59d
55
// TargetFramework: .NETFramework,Version=v4.5
66
// Configuration: Release
77

88
using System;
99
using System.Collections.Generic;
1010
using System.Reflection;
11+
using System.Runtime.CompilerServices;
1112
using Smdn.Reflection;
1213
using Smdn.Reflection.ReverseGenerating;
1314

1415
namespace Smdn.Reflection.ReverseGenerating {
1516
public delegate bool AttributeTypeFilter(Type type, ICustomAttributeProvider attributeProvider);
1617

18+
public enum AttributeSectionFormat : int {
19+
Discrete = 1,
20+
List = 0,
21+
}
22+
1723
public enum MethodBodyOption : int {
1824
EmptyImplementation = 1,
1925
None = 0,
2026
ThrowNotImplementedException = 2,
27+
ThrowNull = 3,
2128
}
2229

30+
[Nullable(byte.MinValue)]
31+
[NullableContext(1)]
2332
public static class CSharpFormatter {
2433
public static string EscapeString(string s, bool escapeSingleQuote = false, bool escapeDoubleQuote = false) {}
2534
public static string FormatAccessibility(Accessibility accessibility) {}
2635
public static string FormatParameter(ParameterInfo p, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
2736
public static string FormatParameterList(MethodBase m, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
2837
public static string FormatParameterList(ParameterInfo[] parameterList, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
2938
public static string FormatSpecialNameMethod(MethodBase methodOrConstructor, out MethodSpecialName nameType) {}
30-
public static string FormatTypeName(this Type t, ICustomAttributeProvider attributeProvider = null, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
31-
public static string FormatValueDeclaration(object val, Type typeOfValue, bool typeWithNamespace = true, bool findConstantField = false, bool useDefaultLiteral = false) {}
39+
public static string FormatTypeName(this EventInfo ev, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
40+
public static string FormatTypeName(this FieldInfo f, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
41+
public static string FormatTypeName(this ParameterInfo p, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
42+
public static string FormatTypeName(this PropertyInfo p, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
43+
public static string FormatTypeName(this Type t, [Nullable(2)] ICustomAttributeProvider attributeProvider = null, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
44+
public static string FormatValueDeclaration([Nullable(2)] object val, Type typeOfValue, bool typeWithNamespace = true, bool findConstantField = false, bool useDefaultLiteral = false) {}
3245
public static bool IsLanguagePrimitiveType(Type t, out string primitiveTypeName) {}
3346
public static IEnumerable<string> ToNamespaceList(Type t) {}
3447
}
3548

49+
[Nullable(byte.MinValue)]
50+
[NullableContext(1)]
3651
public static class Generator {
37-
public static IEnumerable<string> GenerateAttributeList(ICustomAttributeProvider attributeProvider, ISet<string> referencingNamespaces, GeneratorOptions options) {}
38-
public static IEnumerable<string> GenerateExplicitBaseTypeAndInterfaces(Type t, ISet<string> referencingNamespaces, GeneratorOptions options) {}
39-
public static string GenerateGenericArgumentConstraintDeclaration(Type genericArgument, ISet<string> referencingNamespaces, GeneratorOptions options) {}
40-
public static string GenerateMemberDeclaration(MemberInfo member, ISet<string> referencingNamespaces, GeneratorOptions options) {}
41-
public static string GenerateTypeDeclaration(Type t, ISet<string> referencingNamespaces, GeneratorOptions options) {}
42-
public static IEnumerable<string> GenerateTypeDeclarationWithExplicitBaseTypeAndInterfaces(Type t, ISet<string> referencingNamespaces, GeneratorOptions options) {}
52+
public static IEnumerable<string> GenerateAttributeList(ICustomAttributeProvider attributeProvider, [Nullable] ISet<string> referencingNamespaces, GeneratorOptions options) {}
53+
public static IEnumerable<string> GenerateExplicitBaseTypeAndInterfaces(Type t, [Nullable] ISet<string> referencingNamespaces, GeneratorOptions options) {}
54+
public static string GenerateGenericArgumentConstraintDeclaration(Type genericArgument, [Nullable] ISet<string> referencingNamespaces, GeneratorOptions options) {}
55+
[return: Nullable(2)] public static string GenerateMemberDeclaration(MemberInfo member, [Nullable] ISet<string> referencingNamespaces, GeneratorOptions options) {}
56+
public static string GenerateTypeDeclaration(Type t, [Nullable] ISet<string> referencingNamespaces, GeneratorOptions options) {}
57+
public static IEnumerable<string> GenerateTypeDeclarationWithExplicitBaseTypeAndInterfaces(Type t, [Nullable] ISet<string> referencingNamespaces, GeneratorOptions options) {}
4358
}
4459

45-
public class GeneratorOptions {
60+
[Nullable(byte.MinValue)]
61+
[NullableContext(1)]
62+
public class GeneratorOptions : ICloneable {
63+
[Nullable(byte.MinValue)]
64+
[NullableContext(2)]
4665
public class AttributeDeclarationOptions {
4766
public AttributeDeclarationOptions() {}
4867

68+
public AttributeSectionFormat AccessorFormat { get; set; }
69+
public AttributeSectionFormat AccessorParameterFormat { get; set; }
70+
public AttributeSectionFormat BackingFieldFormat { get; set; }
71+
public AttributeSectionFormat DelegateParameterFormat { get; set; }
72+
public AttributeSectionFormat GenericParameterFormat { get; set; }
73+
public AttributeSectionFormat MethodParameterFormat { get; set; }
74+
public bool OmitAttributeSuffix { get; set; }
4975
public AttributeTypeFilter TypeFilter { get; set; }
76+
public bool WithDeclaringTypeName { get; set; }
5077
public bool WithNamedArguments { get; set; }
5178
public bool WithNamespace { get; set; }
5279
}
5380

81+
[NullableContext(byte.MinValue)]
5482
public class MemberDeclarationOptions {
5583
public MemberDeclarationOptions() {}
5684

85+
public MethodBodyOption AccessorBody { get; set; }
5786
public MethodBodyOption MethodBody { get; set; }
5887
public bool OmitEndOfStatement { get; set; }
5988
public bool WithAccessibility { get; set; }
6089
public bool WithDeclaringTypeName { get; set; }
6190
public bool WithNamespace { get; set; }
6291
}
6392

93+
[NullableContext(byte.MinValue)]
94+
public class ParameterDeclarationOptions {
95+
public ParameterDeclarationOptions() {}
96+
97+
public bool WithDeclaringTypeName { get; set; }
98+
public bool WithNamespace { get; set; }
99+
}
100+
101+
[NullableContext(byte.MinValue)]
64102
public class TypeDeclarationOptions {
65103
public TypeDeclarationOptions() {}
66104

@@ -70,21 +108,29 @@ public TypeDeclarationOptions() {}
70108
public bool WithNamespace { get; set; }
71109
}
72110

111+
[NullableContext(byte.MinValue)]
73112
public class ValueDeclarationOptions {
74113
public ValueDeclarationOptions() {}
75114

76115
public bool UseDefaultLiteral { get; set; }
116+
public bool WithDeclaringTypeName { get; set; }
117+
public bool WithNamespace { get; set; }
77118
}
78119

79120
public GeneratorOptions() {}
80121

81-
public GeneratorOptions.AttributeDeclarationOptions AttributeDeclaration { get; }
122+
public GeneratorOptions.AttributeDeclarationOptions AttributeDeclaration { get; init; }
82123
public bool IgnorePrivateOrAssembly { get; set; }
124+
[Nullable(2)]
83125
public string Indent { get; set; }
84-
public GeneratorOptions.MemberDeclarationOptions MemberDeclaration { get; }
126+
public GeneratorOptions.MemberDeclarationOptions MemberDeclaration { get; init; }
127+
public GeneratorOptions.ParameterDeclarationOptions ParameterDeclaration { get; init; }
85128
public bool TranslateLanguagePrimitiveTypeDeclaration { get; set; }
86-
public GeneratorOptions.TypeDeclarationOptions TypeDeclaration { get; }
87-
public GeneratorOptions.ValueDeclarationOptions ValueDeclaration { get; }
129+
public GeneratorOptions.TypeDeclarationOptions TypeDeclaration { get; init; }
130+
public GeneratorOptions.ValueDeclarationOptions ValueDeclaration { get; init; }
131+
132+
public virtual GeneratorOptions Clone() {}
133+
object ICloneable.Clone() {}
88134
}
89135
}
90136

Lines changed: 62 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,104 @@
1-
// Smdn.Reflection.ReverseGenerating.dll (Smdn.Reflection.ReverseGenerating-1.0.5)
1+
// Smdn.Reflection.ReverseGenerating.dll (Smdn.Reflection.ReverseGenerating-1.1.0)
22
// Name: Smdn.Reflection.ReverseGenerating
3-
// AssemblyVersion: 1.0.5.0
4-
// InformationalVersion: 1.0.5+dd9591cbed8623f61349f46c833f14f1578db406
3+
// AssemblyVersion: 1.1.0.0
4+
// InformationalVersion: 1.1.0+074a83ab64ee9e829c2f3835cf0c03af8af0f59d
55
// TargetFramework: .NETFramework,Version=v4.7
66
// Configuration: Release
77

88
using System;
99
using System.Collections.Generic;
1010
using System.Reflection;
11+
using System.Runtime.CompilerServices;
1112
using Smdn.Reflection;
1213
using Smdn.Reflection.ReverseGenerating;
1314

1415
namespace Smdn.Reflection.ReverseGenerating {
1516
public delegate bool AttributeTypeFilter(Type type, ICustomAttributeProvider attributeProvider);
1617

18+
public enum AttributeSectionFormat : int {
19+
Discrete = 1,
20+
List = 0,
21+
}
22+
1723
public enum MethodBodyOption : int {
1824
EmptyImplementation = 1,
1925
None = 0,
2026
ThrowNotImplementedException = 2,
27+
ThrowNull = 3,
2128
}
2229

30+
[Nullable(byte.MinValue)]
31+
[NullableContext(1)]
2332
public static class CSharpFormatter {
2433
public static string EscapeString(string s, bool escapeSingleQuote = false, bool escapeDoubleQuote = false) {}
2534
public static string FormatAccessibility(Accessibility accessibility) {}
2635
public static string FormatParameter(ParameterInfo p, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
2736
public static string FormatParameterList(MethodBase m, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
2837
public static string FormatParameterList(ParameterInfo[] parameterList, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
2938
public static string FormatSpecialNameMethod(MethodBase methodOrConstructor, out MethodSpecialName nameType) {}
30-
public static string FormatTypeName(this Type t, ICustomAttributeProvider attributeProvider = null, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
31-
public static string FormatValueDeclaration(object val, Type typeOfValue, bool typeWithNamespace = true, bool findConstantField = false, bool useDefaultLiteral = false) {}
39+
public static string FormatTypeName(this EventInfo ev, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
40+
public static string FormatTypeName(this FieldInfo f, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
41+
public static string FormatTypeName(this ParameterInfo p, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
42+
public static string FormatTypeName(this PropertyInfo p, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
43+
public static string FormatTypeName(this Type t, [Nullable(2)] ICustomAttributeProvider attributeProvider = null, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
44+
public static string FormatValueDeclaration([Nullable(2)] object val, Type typeOfValue, bool typeWithNamespace = true, bool findConstantField = false, bool useDefaultLiteral = false) {}
3245
public static bool IsLanguagePrimitiveType(Type t, out string primitiveTypeName) {}
3346
public static IEnumerable<string> ToNamespaceList(Type t) {}
3447
}
3548

49+
[Nullable(byte.MinValue)]
50+
[NullableContext(1)]
3651
public static class Generator {
37-
public static IEnumerable<string> GenerateAttributeList(ICustomAttributeProvider attributeProvider, ISet<string> referencingNamespaces, GeneratorOptions options) {}
38-
public static IEnumerable<string> GenerateExplicitBaseTypeAndInterfaces(Type t, ISet<string> referencingNamespaces, GeneratorOptions options) {}
39-
public static string GenerateGenericArgumentConstraintDeclaration(Type genericArgument, ISet<string> referencingNamespaces, GeneratorOptions options) {}
40-
public static string GenerateMemberDeclaration(MemberInfo member, ISet<string> referencingNamespaces, GeneratorOptions options) {}
41-
public static string GenerateTypeDeclaration(Type t, ISet<string> referencingNamespaces, GeneratorOptions options) {}
42-
public static IEnumerable<string> GenerateTypeDeclarationWithExplicitBaseTypeAndInterfaces(Type t, ISet<string> referencingNamespaces, GeneratorOptions options) {}
52+
public static IEnumerable<string> GenerateAttributeList(ICustomAttributeProvider attributeProvider, [Nullable] ISet<string> referencingNamespaces, GeneratorOptions options) {}
53+
public static IEnumerable<string> GenerateExplicitBaseTypeAndInterfaces(Type t, [Nullable] ISet<string> referencingNamespaces, GeneratorOptions options) {}
54+
public static string GenerateGenericArgumentConstraintDeclaration(Type genericArgument, [Nullable] ISet<string> referencingNamespaces, GeneratorOptions options) {}
55+
[return: Nullable(2)] public static string GenerateMemberDeclaration(MemberInfo member, [Nullable] ISet<string> referencingNamespaces, GeneratorOptions options) {}
56+
public static string GenerateTypeDeclaration(Type t, [Nullable] ISet<string> referencingNamespaces, GeneratorOptions options) {}
57+
public static IEnumerable<string> GenerateTypeDeclarationWithExplicitBaseTypeAndInterfaces(Type t, [Nullable] ISet<string> referencingNamespaces, GeneratorOptions options) {}
4358
}
4459

45-
public class GeneratorOptions {
60+
[Nullable(byte.MinValue)]
61+
[NullableContext(1)]
62+
public class GeneratorOptions : ICloneable {
63+
[Nullable(byte.MinValue)]
64+
[NullableContext(2)]
4665
public class AttributeDeclarationOptions {
4766
public AttributeDeclarationOptions() {}
4867

68+
public AttributeSectionFormat AccessorFormat { get; set; }
69+
public AttributeSectionFormat AccessorParameterFormat { get; set; }
70+
public AttributeSectionFormat BackingFieldFormat { get; set; }
71+
public AttributeSectionFormat DelegateParameterFormat { get; set; }
72+
public AttributeSectionFormat GenericParameterFormat { get; set; }
73+
public AttributeSectionFormat MethodParameterFormat { get; set; }
74+
public bool OmitAttributeSuffix { get; set; }
4975
public AttributeTypeFilter TypeFilter { get; set; }
76+
public bool WithDeclaringTypeName { get; set; }
5077
public bool WithNamedArguments { get; set; }
5178
public bool WithNamespace { get; set; }
5279
}
5380

81+
[NullableContext(byte.MinValue)]
5482
public class MemberDeclarationOptions {
5583
public MemberDeclarationOptions() {}
5684

85+
public MethodBodyOption AccessorBody { get; set; }
5786
public MethodBodyOption MethodBody { get; set; }
5887
public bool OmitEndOfStatement { get; set; }
5988
public bool WithAccessibility { get; set; }
6089
public bool WithDeclaringTypeName { get; set; }
6190
public bool WithNamespace { get; set; }
6291
}
6392

93+
[NullableContext(byte.MinValue)]
94+
public class ParameterDeclarationOptions {
95+
public ParameterDeclarationOptions() {}
96+
97+
public bool WithDeclaringTypeName { get; set; }
98+
public bool WithNamespace { get; set; }
99+
}
100+
101+
[NullableContext(byte.MinValue)]
64102
public class TypeDeclarationOptions {
65103
public TypeDeclarationOptions() {}
66104

@@ -70,21 +108,29 @@ public TypeDeclarationOptions() {}
70108
public bool WithNamespace { get; set; }
71109
}
72110

111+
[NullableContext(byte.MinValue)]
73112
public class ValueDeclarationOptions {
74113
public ValueDeclarationOptions() {}
75114

76115
public bool UseDefaultLiteral { get; set; }
116+
public bool WithDeclaringTypeName { get; set; }
117+
public bool WithNamespace { get; set; }
77118
}
78119

79120
public GeneratorOptions() {}
80121

81-
public GeneratorOptions.AttributeDeclarationOptions AttributeDeclaration { get; }
122+
public GeneratorOptions.AttributeDeclarationOptions AttributeDeclaration { get; init; }
82123
public bool IgnorePrivateOrAssembly { get; set; }
124+
[Nullable(2)]
83125
public string Indent { get; set; }
84-
public GeneratorOptions.MemberDeclarationOptions MemberDeclaration { get; }
126+
public GeneratorOptions.MemberDeclarationOptions MemberDeclaration { get; init; }
127+
public GeneratorOptions.ParameterDeclarationOptions ParameterDeclaration { get; init; }
85128
public bool TranslateLanguagePrimitiveTypeDeclaration { get; set; }
86-
public GeneratorOptions.TypeDeclarationOptions TypeDeclaration { get; }
87-
public GeneratorOptions.ValueDeclarationOptions ValueDeclaration { get; }
129+
public GeneratorOptions.TypeDeclarationOptions TypeDeclaration { get; init; }
130+
public GeneratorOptions.ValueDeclarationOptions ValueDeclaration { get; init; }
131+
132+
public virtual GeneratorOptions Clone() {}
133+
object ICloneable.Clone() {}
88134
}
89135
}
90136

0 commit comments

Comments
 (0)