Smdn.Reflection.ReverseGeneratingはリフレクションにより型名・型宣言・メンバー宣言などをC#コードへ逆生成したり、アセンブリの公開APIのリストを生成する.NETライブラリです。 また、その派生であるMSBuildタスクコマンドラインツールも公開しています。

This software is released under the MIT License. 本ライブラリはMITライセンスでリリースされています。

最近のリリース一覧

すべてのリリースと変更内容の詳細はGitHubリポジトリのReleasesよりご覧ください。

Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks (MSBuildタスク)

Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasksは指定されたアセンブリの公開APIのリストをC#コードで生成するためのMSBuildタスクです。 以下のようなAPIリストを生成することができます。

具体的な使用方法についてはリポジトリのREADMEおよびexamplesを参照してください。

Smdn.Fundamental.Uuidから生成したAPIリスト。

// Smdn.Fundamental.Uuid.dll (Smdn.Fundamental.Uuid-3.1.0)
//   Name: Smdn.Fundamental.Uuid
//   AssemblyVersion: 3.1.0.0
//   InformationalVersion: 3.1.0+ae4a97a93ac395fe5044a3c8ed3ba4411533bc12
//   TargetFramework: .NETCoreApp,Version=v6.0
//   Configuration: Release

using System;
using System.Net.NetworkInformation;
using System.Security.Cryptography;
using Smdn;
using Smdn.Formats.UniversallyUniqueIdentifiers;

namespace Smdn {
  [TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")]
  public enum UuidVersion : byte {
    NameBasedMD5Hash = 3,
    NameBasedSHA1Hash = 5,
    None = 0,
    RandomNumber = 4,
    TimeBased = 1,
    Version1 = 1,
    Version2 = 2,
    Version3 = 3,
    Version4 = 4,
    Version5 = 5,
  }

  [TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")]
  [StructLayout(LayoutKind.Explicit, Pack = 1)]
  public readonly struct Uuid :
    IComparable,
    IComparable<Guid>,
    IComparable<Uuid>,
    IEquatable<Guid>,
    IEquatable<Uuid>,
    ISpanFormattable
  {
    public enum Namespace : int {
      RFC4122Dns = 1806153744,
      RFC4122IsoOid = 1806153746,
      RFC4122Url = 1806153745,
      RFC4122X500 = 1806153748,
    }

    public enum Variant : byte {
      MicrosoftReserved = 192,
      NCSReserved = 0,
      RFC4122 = 128,
      Reserved = 224,
    }

    public static readonly Uuid Nil; // = "00000000-0000-0000-0000-000000000000"
    public static readonly Uuid RFC4122NamespaceDns; // = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
    public static readonly Uuid RFC4122NamespaceIsoOid; // = "6ba7b812-9dad-11d1-80b4-00c04fd430c8"
    public static readonly Uuid RFC4122NamespaceUrl; // = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"
    public static readonly Uuid RFC4122NamespaceX500; // = "6ba7b814-9dad-11d1-80b4-00c04fd430c8"

    public static Uuid CreateFromRandomNumber() {}
    public static Uuid CreateFromRandomNumber(RandomNumberGenerator rng) {}
    public static Uuid CreateFromRandomNumber(ReadOnlySpan<byte> randomNumber) {}
    public static Uuid CreateFromRandomNumber(byte[] randomNumber) {}
    public static Uuid CreateNameBased(ReadOnlySpan<byte> name, Uuid namespaceId, UuidVersion version) {}
    public static Uuid CreateNameBased(ReadOnlySpan<byte> name, Uuid.Namespace ns, UuidVersion version) {}
    public static Uuid CreateNameBased(Uri url, UuidVersion version) {}
    public static Uuid CreateNameBased(byte[] name, Uuid namespaceId, UuidVersion version) {}
    public static Uuid CreateNameBased(byte[] name, Uuid.Namespace ns, UuidVersion version) {}
    public static Uuid CreateNameBased(string name, Uuid namespaceId, UuidVersion version) {}
    public static Uuid CreateNameBased(string name, Uuid.Namespace ns, UuidVersion version) {}
    public static Uuid CreateNameBasedMD5(ReadOnlySpan<byte> name, Uuid.Namespace ns) {}
    public static Uuid CreateNameBasedMD5(Uri url) {}
    public static Uuid CreateNameBasedMD5(byte[] name, Uuid.Namespace ns) {}
    public static Uuid CreateNameBasedMD5(string name, Uuid.Namespace ns) {}
    public static Uuid CreateNameBasedSHA1(ReadOnlySpan<byte> name, Uuid.Namespace ns) {}
    public static Uuid CreateNameBasedSHA1(Uri url) {}
    public static Uuid CreateNameBasedSHA1(byte[] name, Uuid.Namespace ns) {}
    public static Uuid CreateNameBasedSHA1(string name, Uuid.Namespace ns) {}
    public static Uuid CreateTimeBased() {}
    public static Uuid CreateTimeBased(DateTime timestamp, int clock) {}
    public static Uuid CreateTimeBased(DateTime timestamp, int clock, PhysicalAddress node) {}
    public static Uuid CreateTimeBased(DateTime timestamp, int clock, byte[] node) {}
    public static Uuid CreateTimeBased(PhysicalAddress node) {}
    public static Uuid CreateTimeBased(byte[] node) {}
    public static Uuid NewUuid() {}
    public static Uuid Parse(ReadOnlySpan<char> s, IFormatProvider provider = null) {}
    public static Uuid Parse(string s, IFormatProvider provider = null) {}
    public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider provider, out Uuid result) {}
    public static bool TryParse(ReadOnlySpan<char> s, out Uuid result) {}
    public static bool TryParse(string s, IFormatProvider provider, out Uuid result) {}
    public static bool operator == (Uuid x, Uuid y) {}
    public static explicit operator Guid(Uuid @value) {}
    public static explicit operator Uuid(Guid @value) {}
    public static bool operator > (Uuid x, Uuid y) {}
    public static bool operator >= (Uuid x, Uuid y) {}
    public static bool operator != (Uuid x, Uuid y) {}
    public static bool operator < (Uuid x, Uuid y) {}
    public static bool operator <= (Uuid x, Uuid y) {}

    public Uuid(Guid guidValue) {}
    public Uuid(ReadOnlySpan<byte> octets) {}
    public Uuid(ReadOnlySpan<byte> octets, bool isBigEndian) {}
    public Uuid(byte[] octets) {}
    public Uuid(byte[] octets, bool isBigEndian) {}
    public Uuid(byte[] octets, int index, bool isBigEndian = true) {}
    public Uuid(string uuid) {}
    public Uuid(uint time_low, ushort time_mid, ushort time_hi_and_version, byte clock_seq_hi_and_reserved, byte clock_seq_low, PhysicalAddress node) {}
    public Uuid(uint time_low, ushort time_mid, ushort time_hi_and_version, byte clock_seq_hi_and_reserved, byte clock_seq_low, ReadOnlySpan<byte> node) {}
    public Uuid(uint time_low, ushort time_mid, ushort time_hi_and_version, byte clock_seq_hi_and_reserved, byte clock_seq_low, byte node0, byte node1, byte node2, byte node3, byte node4, byte node5) {}
    public Uuid(uint time_low, ushort time_mid, ushort time_hi_and_version, byte clock_seq_hi_and_reserved, byte clock_seq_low, byte[] node) {}

    public int Clock { get; }
    public byte ClockSeqHighAndReserved { get; }
    public byte ClockSeqLow { get; }
    public string IEEE802MacAddress { get; }
    public byte[] Node { get; }
    public PhysicalAddress PhysicalAddress { get; }
    public ushort TimeHighAndVersion { get; }
    public uint TimeLow { get; }
    public ushort TimeMid { get; }
    public DateTime Timestamp { get; }
    public Uuid.Variant VariantField { get; }
    public UuidVersion Version { get; }

    public int CompareTo(Guid other) {}
    public int CompareTo(Uuid other) {}
    public int CompareTo(object obj) {}
    public bool Equals(Guid other) {}
    public bool Equals(Uuid other) {}
    public override bool Equals(object obj) {}
    public void GetBytes(byte[] buffer, int startIndex) {}
    public void GetBytes(byte[] buffer, int startIndex, bool asBigEndian) {}
    public override int GetHashCode() {}
    public byte[] ToByteArray() {}
    public byte[] ToByteArray(bool asBigEndian) {}
    public Guid ToGuid() {}
    public override string ToString() {}
    public string ToString(string format) {}
    public string ToString(string format, IFormatProvider formatProvider) {}
    public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider provider = null) {}
    public bool TryWriteBytes(Span<byte> destination, bool asBigEndian) {}
    public void WriteBytes(Span<byte> destination, bool asBigEndian) {}
  }
}

namespace Smdn.Formats.UniversallyUniqueIdentifiers {
  [TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")]
  public abstract class UuidGenerator {
    public static UuidGenerator CreateTimeBased() {}
    public static UuidGenerator CreateTimeBased(DateTimeOffset timeStamp) {}
    public static UuidGenerator CreateTimeBased(DateTimeOffset timeStamp, Func<ushort> clockSequenceSource) {}
    public static UuidGenerator CreateTimeBased(DateTimeOffset timeStamp, int clockSequence) {}
    public static UuidGenerator CreateTimeBased(DateTimeOffset timeStamp, int clockSequence, Node node) {}
    public static UuidGenerator CreateTimeBased(DateTimeOffset timeStamp, int clockSequence, PhysicalAddress node) {}
    public static UuidGenerator CreateTimeBased(Func<ulong> timeStampSource) {}
    public static UuidGenerator CreateTimeBased(Func<ulong> timeStampSource, Func<ushort> clockSequenceSource) {}
    public static UuidGenerator CreateTimeBased(Func<ulong> timeStampSource, Func<ushort> clockSequenceSource, Node node) {}
    public static UuidGenerator CreateTimeBased(Func<ulong> timeStampSource, int clockSequence) {}
    public static UuidGenerator CreateTimeBased(Func<ulong> timeStampSource, int clockSequence, Node node) {}

    protected UuidGenerator() {}

    public abstract Uuid GenerateNext();
  }

  [TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")]
  [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 6)]
  public readonly struct Node :
    IComparable,
    IComparable<Node>,
    IEquatable<Node>,
    ISpanFormattable
  {
    public static Node CreateRandom() {}
    public static Node Parse(ReadOnlySpan<char> s, IFormatProvider provider = null) {}
    public static Node Parse(string s, IFormatProvider provider = null) {}
    public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider provider, out Node result) {}
    public static bool TryParse(ReadOnlySpan<char> s, out Node result) {}
    public static bool TryParse(string s, IFormatProvider provider, out Node result) {}
    public static bool TryParse(string s, out Node result) {}
    public static bool operator == (Node x, Node y) {}
    public static bool operator > (Node x, Node y) {}
    public static bool operator >= (Node x, Node y) {}
    public static bool operator != (Node x, Node y) {}
    public static bool operator < (Node x, Node y) {}
    public static bool operator <= (Node x, Node y) {}

    public Node(PhysicalAddress physicalAddress) {}

    public int CompareTo(Node other) {}
    public int CompareTo(object obj) {}
    public bool Equals(Node other) {}
    public override bool Equals(object obj) {}
    public override int GetHashCode() {}
    public PhysicalAddress ToPhysicalAddress() {}
    public override string ToString() {}
    public string ToString(string format, IFormatProvider formatProvider = null) {}
    public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider provider) {}
    public bool TryWriteBytes(Span<byte> destination) {}
    public void WriteBytes(Span<byte> destination) {}
  }
}

Smdn.Fundamental.UInt24nから生成したAPIリスト。

// Smdn.Fundamental.UInt24n.dll (Smdn.Fundamental.UInt24n-3.0.3.1)
//   Name: Smdn.Fundamental.UInt24n
//   AssemblyVersion: 3.0.3.1
//   InformationalVersion: 3.0.3.1+0f838f8a06f48ffc1ddbe92fcdcbcfa93a9cdbdc
//   TargetFramework: .NETCoreApp,Version=v6.0
//   Configuration: Release

using System;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using Smdn;

namespace Smdn {
  [TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")]
  [StructLayout(LayoutKind.Explicit, Pack = 1)]
  public struct UInt24 :
    IComparable,
    IComparable<UInt24>,
    IComparable<int>,
    IComparable<uint>,
    IConvertible,
    IEquatable<UInt24>,
    IEquatable<int>,
    IEquatable<uint>,
    ISpanFormattable
  {
    public static readonly UInt24 MaxValue; // = "16777215"
    public static readonly UInt24 MinValue; // = "0"
    public static readonly UInt24 One; // = "1"
    public static readonly UInt24 Zero; // = "0"

    public static UInt24 Abs(UInt24 @value) {}
    public static UInt24 Clamp(UInt24 @value, UInt24 min, UInt24 max) {}
    public static (UInt24 Quotient, UInt24 Remainder) DivRem(UInt24 left, UInt24 right) {}
    public static bool IsPow2(UInt24 @value) {}
    public static int LeadingZeroCount(UInt24 @value) {}
    public static int Log2(UInt24 @value) {}
    public static UInt24 Max(UInt24 x, UInt24 y) {}
    public static UInt24 Min(UInt24 x, UInt24 y) {}
    public static UInt24 Parse(ReadOnlySpan<char> s, NumberStyles style = NumberStyles.Integer, IFormatProvider provider = null) {}
    public static UInt24 Parse(string s, IFormatProvider provider = null) {}
    public static UInt24 Parse(string s, NumberStyles style, IFormatProvider provider = null) {}
    public static int PopCount(UInt24 @value) {}
    public static UInt24 RotateLeft(UInt24 @value, int rotateAmount) {}
    public static UInt24 RotateRight(UInt24 @value, int rotateAmount) {}
    public static UInt24 Sign(UInt24 @value) {}
    public static int TrailingZeroCount(UInt24 @value) {}
    public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider provider, out UInt24 result) {}
    public static bool TryParse(ReadOnlySpan<char> s, NumberStyles style, IFormatProvider provider, out UInt24 result) {}
    public static bool TryParse(ReadOnlySpan<char> s, out UInt24 result) {}
    public static bool TryParse([NotNullWhen(true)] string s, IFormatProvider provider, out UInt24 result) {}
    public static bool TryParse([NotNullWhen(true)] string s, NumberStyles style, IFormatProvider provider, out UInt24 result) {}
    public static bool TryParse([NotNullWhen(true)] string s, out UInt24 result) {}
    public static UInt24 operator + (UInt24 left, UInt24 right) {}
    public static UInt24 operator & (UInt24 left, UInt24 right) {}
    public static UInt24 operator | (UInt24 left, UInt24 right) {}
    public static UInt24 operator -- (UInt24 @value) {}
    public static UInt24 operator / (UInt24 left, UInt24 right) {}
    public static bool operator == (UInt24 x, UInt24 y) {}
    public static UInt24 operator ^ (UInt24 left, UInt24 right) {}
    public static explicit operator UInt24(int val) {}
    public static explicit operator UInt24(short val) {}
    public static explicit operator UInt24(uint val) {}
    public static explicit operator UInt24(ushort val) {}
    public static explicit operator int(UInt24 val) {}
    public static explicit operator short(UInt24 val) {}
    public static explicit operator uint(UInt24 val) {}
    public static explicit operator ushort(UInt24 val) {}
    public static bool operator > (UInt24 x, UInt24 y) {}
    public static bool operator >= (UInt24 x, UInt24 y) {}
    public static UInt24 operator ++ (UInt24 @value) {}
    public static bool operator != (UInt24 x, UInt24 y) {}
    public static UInt24 operator << (UInt24 @value, int shiftAmount) {}
    public static bool operator < (UInt24 x, UInt24 y) {}
    public static bool operator <= (UInt24 x, UInt24 y) {}
    public static UInt24 operator % (UInt24 left, UInt24 right) {}
    public static UInt24 operator * (UInt24 left, UInt24 right) {}
    public static UInt24 operator ~ (UInt24 @value) {}
    public static UInt24 operator >> (UInt24 @value, int shiftAmount) {}
    public static UInt24 operator - (UInt24 left, UInt24 right) {}
    public static UInt24 operator - (UInt24 @value) {}
    public static UInt24 operator + (UInt24 @value) {}

    [FieldOffset(0)]
    public byte Byte0;
    [FieldOffset(1)]
    public byte Byte1;
    [FieldOffset(2)]
    public byte Byte2;

    public UInt24(ReadOnlySpan<byte> @value, bool isBigEndian = false) {}
    public UInt24(byte[] @value, bool isBigEndian = false) {}
    public UInt24(byte[] @value, int startIndex, bool isBigEndian = false) {}

    public int CompareTo(UInt24 other) {}
    public int CompareTo(int other) {}
    public int CompareTo(object obj) {}
    public int CompareTo(uint other) {}
    public bool Equals(UInt24 other) {}
    public bool Equals(int other) {}
    public bool Equals(uint other) {}
    public override bool Equals(object obj) {}
    public override int GetHashCode() {}
    TypeCode IConvertible.GetTypeCode() {}
    bool IConvertible.ToBoolean(IFormatProvider provider) {}
    byte IConvertible.ToByte(IFormatProvider provider) {}
    char IConvertible.ToChar(IFormatProvider provider) {}
    DateTime IConvertible.ToDateTime(IFormatProvider provider) {}
    decimal IConvertible.ToDecimal(IFormatProvider provider) {}
    double IConvertible.ToDouble(IFormatProvider provider) {}
    short IConvertible.ToInt16(IFormatProvider provider) {}
    int IConvertible.ToInt32(IFormatProvider provider) {}
    long IConvertible.ToInt64(IFormatProvider provider) {}
    sbyte IConvertible.ToSByte(IFormatProvider provider) {}
    float IConvertible.ToSingle(IFormatProvider provider) {}
    string IConvertible.ToString(IFormatProvider provider) {}
    object IConvertible.ToType(Type conversionType, IFormatProvider provider) {}
    ushort IConvertible.ToUInt16(IFormatProvider provider) {}
    uint IConvertible.ToUInt32(IFormatProvider provider) {}
    ulong IConvertible.ToUInt64(IFormatProvider provider) {}
    public int ToInt32() {}
    public override string ToString() {}
    public string ToString(IFormatProvider formatProvider) {}
    public string ToString(string format) {}
    public string ToString(string format, IFormatProvider formatProvider) {}
    public uint ToUInt32() {}
    public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider provider) {}
  }

  [TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")]
  [StructLayout(LayoutKind.Explicit, Pack = 1)]
  public struct UInt48 :
    IComparable,
    IComparable<UInt48>,
    IComparable<long>,
    IComparable<ulong>,
    IConvertible,
    IEquatable<UInt48>,
    IEquatable<long>,
    IEquatable<ulong>,
    ISpanFormattable
  {
    public static readonly UInt48 MaxValue; // = "281474976710655"
    public static readonly UInt48 MinValue; // = "0"
    public static readonly UInt48 One; // = "1"
    public static readonly UInt48 Zero; // = "0"

    public static UInt48 Abs(UInt48 @value) {}
    public static UInt48 Clamp(UInt48 @value, UInt48 min, UInt48 max) {}
    public static (UInt48 Quotient, UInt48 Remainder) DivRem(UInt48 left, UInt48 right) {}
    public static bool IsPow2(UInt48 @value) {}
    public static int LeadingZeroCount(UInt48 @value) {}
    public static int Log2(UInt48 @value) {}
    public static UInt48 Max(UInt48 x, UInt48 y) {}
    public static UInt48 Min(UInt48 x, UInt48 y) {}
    public static UInt48 Parse(ReadOnlySpan<char> s, NumberStyles style = NumberStyles.Integer, IFormatProvider provider = null) {}
    public static UInt48 Parse(string s, IFormatProvider provider = null) {}
    public static UInt48 Parse(string s, NumberStyles style, IFormatProvider provider = null) {}
    public static int PopCount(UInt48 @value) {}
    public static UInt48 RotateLeft(UInt48 @value, int rotateAmount) {}
    public static UInt48 RotateRight(UInt48 @value, int rotateAmount) {}
    public static UInt48 Sign(UInt48 @value) {}
    public static int TrailingZeroCount(UInt48 @value) {}
    public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider provider, out UInt48 result) {}
    public static bool TryParse(ReadOnlySpan<char> s, NumberStyles style, IFormatProvider provider, out UInt48 result) {}
    public static bool TryParse(ReadOnlySpan<char> s, out UInt48 result) {}
    public static bool TryParse([NotNullWhen(true)] string s, IFormatProvider provider, out UInt48 result) {}
    public static bool TryParse([NotNullWhen(true)] string s, NumberStyles style, IFormatProvider provider, out UInt48 result) {}
    public static bool TryParse([NotNullWhen(true)] string s, out UInt48 result) {}
    public static UInt48 operator + (UInt48 left, UInt48 right) {}
    public static UInt48 operator & (UInt48 left, UInt48 right) {}
    public static UInt48 operator | (UInt48 left, UInt48 right) {}
    public static UInt48 operator -- (UInt48 @value) {}
    public static UInt48 operator / (UInt48 left, UInt48 right) {}
    public static bool operator == (UInt48 x, UInt48 y) {}
    public static UInt48 operator ^ (UInt48 left, UInt48 right) {}
    public static explicit operator UInt48(int val) {}
    public static explicit operator UInt48(long val) {}
    public static explicit operator UInt48(uint val) {}
    public static explicit operator UInt48(ulong val) {}
    public static explicit operator int(UInt48 val) {}
    public static explicit operator long(UInt48 val) {}
    public static explicit operator uint(UInt48 val) {}
    public static explicit operator ulong(UInt48 val) {}
    public static bool operator > (UInt48 x, UInt48 y) {}
    public static bool operator >= (UInt48 x, UInt48 y) {}
    public static UInt48 operator ++ (UInt48 @value) {}
    public static bool operator != (UInt48 x, UInt48 y) {}
    public static UInt48 operator << (UInt48 @value, int shiftAmount) {}
    public static bool operator < (UInt48 x, UInt48 y) {}
    public static bool operator <= (UInt48 x, UInt48 y) {}
    public static UInt48 operator % (UInt48 left, UInt48 right) {}
    public static UInt48 operator * (UInt48 left, UInt48 right) {}
    public static UInt48 operator ~ (UInt48 @value) {}
    public static UInt48 operator >> (UInt48 @value, int shiftAmount) {}
    public static UInt48 operator - (UInt48 left, UInt48 right) {}
    public static UInt48 operator - (UInt48 @value) {}
    public static UInt48 operator + (UInt48 @value) {}

    [FieldOffset(0)]
    public byte Byte0;
    [FieldOffset(1)]
    public byte Byte1;
    [FieldOffset(2)]
    public byte Byte2;
    [FieldOffset(3)]
    public byte Byte3;
    [FieldOffset(4)]
    public byte Byte4;
    [FieldOffset(5)]
    public byte Byte5;

    public UInt48(ReadOnlySpan<byte> @value, bool isBigEndian = false) {}
    public UInt48(byte[] @value, bool isBigEndian = false) {}
    public UInt48(byte[] @value, int startIndex, bool isBigEndian = false) {}

    public int CompareTo(UInt48 other) {}
    public int CompareTo(long other) {}
    public int CompareTo(object obj) {}
    public int CompareTo(ulong other) {}
    public bool Equals(UInt48 other) {}
    public bool Equals(long other) {}
    public bool Equals(ulong other) {}
    public override bool Equals(object obj) {}
    public override int GetHashCode() {}
    TypeCode IConvertible.GetTypeCode() {}
    bool IConvertible.ToBoolean(IFormatProvider provider) {}
    byte IConvertible.ToByte(IFormatProvider provider) {}
    char IConvertible.ToChar(IFormatProvider provider) {}
    DateTime IConvertible.ToDateTime(IFormatProvider provider) {}
    decimal IConvertible.ToDecimal(IFormatProvider provider) {}
    double IConvertible.ToDouble(IFormatProvider provider) {}
    short IConvertible.ToInt16(IFormatProvider provider) {}
    int IConvertible.ToInt32(IFormatProvider provider) {}
    long IConvertible.ToInt64(IFormatProvider provider) {}
    sbyte IConvertible.ToSByte(IFormatProvider provider) {}
    float IConvertible.ToSingle(IFormatProvider provider) {}
    string IConvertible.ToString(IFormatProvider provider) {}
    object IConvertible.ToType(Type conversionType, IFormatProvider provider) {}
    ushort IConvertible.ToUInt16(IFormatProvider provider) {}
    uint IConvertible.ToUInt32(IFormatProvider provider) {}
    ulong IConvertible.ToUInt64(IFormatProvider provider) {}
    public long ToInt64() {}
    public override string ToString() {}
    public string ToString(IFormatProvider formatProvider) {}
    public string ToString(string format) {}
    public string ToString(string format, IFormatProvider formatProvider) {}
    public ulong ToUInt64() {}
    public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider provider) {}
  }
}

Smdn.Reflection.ReverseGeneratingから生成したAPIリスト。

// Smdn.Reflection.ReverseGenerating.dll (Smdn.Reflection.ReverseGenerating-1.1.3)
//   Name: Smdn.Reflection.ReverseGenerating
//   AssemblyVersion: 1.1.3.0
//   InformationalVersion: 1.1.3+f6167551bdfd2449c464509449137c454604db0f
//   TargetFramework: .NETCoreApp,Version=v6.0
//   Configuration: Release
#nullable enable annotations

using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using Smdn.Reflection;
using Smdn.Reflection.ReverseGenerating;

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

  public enum AttributeSectionFormat : int {
    Discrete = 1,
    List = 0,
  }

  public enum MethodBodyOption : int {
    EmptyImplementation = 1,
    None = 0,
    ThrowNotImplementedException = 2,
    ThrowNull = 3,
  }

  public static class CSharpFormatter {
    public static string EscapeString(string s, bool escapeSingleQuote = false, bool escapeDoubleQuote = false) {}
    public static string FormatAccessibility(Accessibility accessibility) {}
    public static string FormatParameter(ParameterInfo p, NullabilityInfoContext? nullabilityInfoContext, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
    public static string FormatParameter(ParameterInfo p, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
    public static string FormatParameterList(MethodBase m, NullabilityInfoContext? nullabilityInfoContext, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
    public static string FormatParameterList(MethodBase m, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
    public static string FormatParameterList(ParameterInfo[] parameterList, NullabilityInfoContext? nullabilityInfoContext, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
    public static string FormatParameterList(ParameterInfo[] parameterList, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
    public static string FormatSpecialNameMethod(MethodBase methodOrConstructor, out MethodSpecialName nameType) {}
    public static string FormatTypeName(this EventInfo ev, NullabilityInfoContext? nullabilityInfoContext, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
    public static string FormatTypeName(this EventInfo ev, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
    public static string FormatTypeName(this FieldInfo f, NullabilityInfoContext? nullabilityInfoContext, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
    public static string FormatTypeName(this FieldInfo f, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
    public static string FormatTypeName(this ParameterInfo p, NullabilityInfoContext? nullabilityInfoContext, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
    public static string FormatTypeName(this ParameterInfo p, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
    public static string FormatTypeName(this PropertyInfo p, NullabilityInfoContext? nullabilityInfoContext, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
    public static string FormatTypeName(this PropertyInfo p, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
    public static string FormatTypeName(this Type t, ICustomAttributeProvider? attributeProvider = null, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
    public static string FormatValueDeclaration(object? val, Type typeOfValue, bool typeWithNamespace = true, bool findConstantField = false, bool useDefaultLiteral = false) {}
    public static bool IsLanguagePrimitiveType(Type t, [MaybeNullWhen(false)] out string? primitiveTypeName) {}
    public static IEnumerable<string> ToNamespaceList(Type t) {}
  }

  public static class Generator {
    public static IEnumerable<string> GenerateAttributeList(ICustomAttributeProvider attributeProvider, ISet<string>? referencingNamespaces, GeneratorOptions options) {}
    public static IEnumerable<string> GenerateExplicitBaseTypeAndInterfaces(Type t, ISet<string>? referencingNamespaces, GeneratorOptions options) {}
    [Obsolete("Use GenerateGenericParameterConstraintDeclaration instead.")]
    public static string GenerateGenericArgumentConstraintDeclaration(Type genericArgument, ISet<string>? referencingNamespaces, GeneratorOptions options) {}
    public static string GenerateGenericParameterConstraintDeclaration(Type genericParameter, ISet<string>? referencingNamespaces, GeneratorOptions options) {}
    public static string? GenerateMemberDeclaration(MemberInfo member, ISet<string>? referencingNamespaces, GeneratorOptions options) {}
    public static string GenerateTypeDeclaration(Type t, ISet<string>? referencingNamespaces, GeneratorOptions options) {}
    public static IEnumerable<string> GenerateTypeDeclarationWithExplicitBaseTypeAndInterfaces(Type t, ISet<string>? referencingNamespaces, GeneratorOptions options) {}
  }

  public class GeneratorOptions : ICloneable {
    public class AttributeDeclarationOptions {
      public AttributeDeclarationOptions() {}

      public AttributeSectionFormat AccessorFormat { get; set; }
      public AttributeSectionFormat AccessorParameterFormat { get; set; }
      public AttributeSectionFormat BackingFieldFormat { get; set; }
      public AttributeSectionFormat DelegateParameterFormat { get; set; }
      public AttributeSectionFormat GenericParameterFormat { get; set; }
      public AttributeSectionFormat MethodParameterFormat { get; set; }
      public bool OmitAttributeSuffix { get; set; }
      public AttributeTypeFilter? TypeFilter { get; set; }
      public bool WithDeclaringTypeName { get; set; }
      public bool WithNamedArguments { get; set; }
      public bool WithNamespace { get; set; }
    }

    public class MemberDeclarationOptions {
      public MemberDeclarationOptions() {}

      public MethodBodyOption AccessorBody { get; set; }
      public MethodBodyOption MethodBody { get; set; }
      public NullabilityInfoContext? NullabilityInfoContext { get; set; }
      public bool OmitEndOfStatement { get; set; }
      public bool WithAccessibility { get; set; }
      public bool WithDeclaringTypeName { get; set; }
      public bool WithEnumTypeName { get; set; }
      public bool WithNamespace { get; set; }
    }

    public class ParameterDeclarationOptions {
      public ParameterDeclarationOptions() {}

      public bool WithDeclaringTypeName { get; set; }
      public bool WithNamespace { get; set; }
    }

    public class TypeDeclarationOptions {
      public TypeDeclarationOptions() {}

      public NullabilityInfoContext? NullabilityInfoContext { get; set; }
      public bool OmitEndOfStatement { get; set; }
      public bool WithAccessibility { get; set; }
      public bool WithDeclaringTypeName { get; set; }
      public bool WithNamespace { get; set; }
    }

    public class ValueDeclarationOptions {
      public ValueDeclarationOptions() {}

      public bool UseDefaultLiteral { get; set; }
      public bool WithDeclaringTypeName { get; set; }
      public bool WithNamespace { get; set; }
    }

    public GeneratorOptions() {}

    public GeneratorOptions.AttributeDeclarationOptions AttributeDeclaration { get; init; }
    public bool IgnorePrivateOrAssembly { get; set; }
    public string? Indent { get; set; }
    public GeneratorOptions.MemberDeclarationOptions MemberDeclaration { get; init; }
    public GeneratorOptions.ParameterDeclarationOptions ParameterDeclaration { get; init; }
    public bool TranslateLanguagePrimitiveTypeDeclaration { get; set; }
    public GeneratorOptions.TypeDeclarationOptions TypeDeclaration { get; init; }
    public GeneratorOptions.ValueDeclarationOptions ValueDeclaration { get; init; }

    public virtual GeneratorOptions Clone() {}
    object ICloneable.Clone() {}
  }
}

Smdn.Reflection.ReverseGenerating.ListApi (コマンドラインツール)

Smdn.Reflection.ReverseGenerating.ListApiは指定されたアセンブリから公開APIのリストをC#コードで生成するための.NETコマンドラインツールです。

使用するには、まずdotnet tool installを使ってインストールしてください。

インストール
dotnet tool install -g Smdn.Reflection.ReverseGenerating.ListApi

その後、list-apiコマンドを実行することでAPIリストの生成を行うことができます。

実行方法
list-api Program/bin/Release/net6.0/Program.dll

その他詳細についてはlist-api --helpを実行するか、リポジトリのREADMEを参照してください。

Smdn.Reflection.ReverseGenerating

Smdn.Reflection.ReverseGeneratingは型名・型宣言・メンバー宣言をC#コードに逆生成するためのライブラリです。

Smdn.Reflection.ReverseGeneratingは上記MSBuildタスクおよびコマンドラインツールのコアライブラリとして使用しています。 また、本サイトでは以下のような.NET APIドキュメントへのリンク生成にも使用しています。

使用例については、リポジトリのexamplesディレクトリを参照してください。

各種情報・リンク

リポジトリ

ソースコードの参照・入手はGitHub smdn/Smdn.Reflection.ReverseGeneratingにて行えます。

NuGetパッケージ

NuGetパッケージはNuGet Galleryより入手できます。

不具合・要望・質問等

不具合の報告、ライブラリに対する要望や質問等はIssues、コードの修正案や改善案はPull requestsへお願いします。