From 41f689f0c16d7c9f87cccef425ebe4eb4f707799 Mon Sep 17 00:00:00 2001 From: pardeike-bot Date: Thu, 19 Dec 2024 19:23:09 +0000 Subject: [PATCH] Update documentation [skip ci] --- docs/api/HarmonyLib.AccessTools.html | 91 ++++++++++++------- docs/api/HarmonyLib.FileLog.html | 30 +++--- docs/api/index.html | 56 ++++++++++++ .../articles/patching-transpiler-matcher.html | 4 +- docs/manifest.json | 11 ++- 5 files changed, 139 insertions(+), 53 deletions(-) diff --git a/docs/api/HarmonyLib.AccessTools.html b/docs/api/HarmonyLib.AccessTools.html index b3c0589b..c66977d6 100644 --- a/docs/api/HarmonyLib.AccessTools.html +++ b/docs/api/HarmonyLib.AccessTools.html @@ -156,7 +156,7 @@

Properties Improve this Doc - View Source + View Source

IsMonoRuntime

@@ -187,7 +187,7 @@
Property Value
Improve this Doc - View Source + View Source

IsNetCoreRuntime

@@ -218,7 +218,7 @@
Property Value
Improve this Doc - View Source + View Source

IsNetFrameworkRuntime

@@ -371,7 +371,7 @@
Returns
Improve this Doc - View Source + View Source

CombinedHashCode(IEnumerable<Object>)

@@ -483,7 +483,7 @@
Returns
Improve this Doc - View Source + View Source

CreateInstance(Type)

@@ -533,7 +533,7 @@
Returns
Improve this Doc - View Source + View Source

CreateInstance<T>()

@@ -2724,7 +2724,7 @@
Returns
Improve this Doc - View Source + View Source

GetDefaultValue(Type)

@@ -2974,7 +2974,7 @@
Returns
Improve this Doc - View Source + View Source

GetOutsideCaller()

@@ -3311,7 +3311,7 @@
Returns
Improve this Doc - View Source + View Source

HarmonyDelegate<DelegateType>(Object)

@@ -3377,7 +3377,7 @@
Type Parameters
Remarks
-

This calls with the method and virtualCall arguments +

This calls MethodDelegate<DelegateType>(MethodInfo, Object, Boolean, Type[]) with the method and virtualCall arguments determined from the [HarmonyDelegate] attributes on DelegateType, and the given instance (for closed instance delegates).

@@ -3709,7 +3709,7 @@
Returns
Improve this Doc - View Source + View Source

IsClass(Type)

@@ -3825,7 +3825,7 @@
Type Parameters
Improve this Doc - View Source + View Source

IsFloatingPoint(Type)

@@ -3875,7 +3875,7 @@
Returns
Improve this Doc - View Source + View Source

IsInteger(Type)

@@ -3925,7 +3925,7 @@
Returns
Improve this Doc - View Source + View Source

IsNumber(Type)

@@ -3975,7 +3975,7 @@
Returns
Improve this Doc - View Source + View Source

IsOfNullableType<T>(T)

@@ -4041,7 +4041,7 @@
Type Parameters
Improve this Doc - View Source + View Source

IsStatic(MemberInfo)

@@ -4091,7 +4091,7 @@
Returns
Improve this Doc - View Source + View Source

IsStruct(Type)

@@ -4141,7 +4141,7 @@
Returns
Improve this Doc - View Source + View Source

IsValue(Type)

@@ -4191,7 +4191,7 @@
Returns
Improve this Doc - View Source + View Source

IsVoid(Type)

@@ -4241,7 +4241,7 @@
Returns
Improve this Doc - View Source + View Source

MakeDeepCopy(Object, Type, Func<String, Traverse, Traverse, Object>, String)

@@ -4309,7 +4309,7 @@
Returns
Improve this Doc - View Source + View Source

MakeDeepCopy<T>(Object)

@@ -4376,7 +4376,7 @@
Type Parameters
Improve this Doc - View Source + View Source

MakeDeepCopy<T>(Object, out T, Func<String, Traverse, Traverse, Object>, String)

@@ -4574,11 +4574,12 @@
Returns
Improve this Doc - View Source + View Source

MethodDelegate<DelegateType>(MethodInfo, Object, Boolean, Type[])

-
+

Creates a delegate to a given method

+
Declaration
@@ -4598,22 +4599,37 @@
Parameters
System.Reflection.MethodInfo method - +

The method to create a delegate from.

+ System.Object instance - +

Only applies for instance methods. If null (default), returned delegate is an open (a.k.a. unbound) instance delegate +where an instance is supplied as the first argument to the delegate invocation; else, delegate is a closed (a.k.a. bound) +instance delegate where the delegate invocation always applies to the given instance.

+ System.Boolean virtualCall - +

Only applies for instance methods. If true (default) and method is virtual, invocation of the delegate +calls the instance method virtually (the instance type's most-derived/overriden implementation of the method is called); +else, invocation of the delegate calls the exact specified method (this is useful for calling base class methods) +Note: if false and method is an interface method, an ArgumentException is thrown.

+ System.Type[] delegateArgs - +

Only applies for instance methods, and if argument instance is null. +This argument only matters if the target method signature contains a value type (such as struct or primitive types), +and your DelegateType argument is replaced by a non-value type +(usually object) instead of using said value type. +Use this if the generic arguments of DelegateType doesn't represent the delegate's +arguments, and calling this function fails +A delegate of given DelegateType to given method

+ @@ -4643,16 +4659,27 @@
Type Parameters
DelegateType - +

The delegate Type

+ +
Remarks
+
+Delegate invocation is more performant and more convenient to use than System.Reflection.MethodBase.Invoke(System.Object,System.Object[]) +at a one-time setup cost. + + +Works for both type of static and instance methods, both open and closed (a.k.a. unbound and bound) instance methods, +and both class and struct methods. + +
| Improve this Doc - View Source + View Source

MethodDelegate<DelegateType>(String, Object, Boolean)

@@ -5064,7 +5091,7 @@
Returns
Improve this Doc - View Source + View Source

RethrowException(Exception)

@@ -5784,7 +5811,7 @@
Type Parameters
Improve this Doc - View Source + View Source

ThrowMissingMemberException(Type, String[])

diff --git a/docs/api/HarmonyLib.FileLog.html b/docs/api/HarmonyLib.FileLog.html index 5b5cb4d5..76478ebb 100644 --- a/docs/api/HarmonyLib.FileLog.html +++ b/docs/api/HarmonyLib.FileLog.html @@ -94,7 +94,7 @@

Fields Improve this Doc - View Source + View Source

indentChar

The indent character. The default is tab

@@ -124,7 +124,7 @@
Field Value
Improve this Doc - View Source + View Source

indentLevel

The current indent level

@@ -156,7 +156,7 @@

Properties Improve this Doc - View Source + View Source

LogPath

@@ -187,7 +187,7 @@
Property Value
Improve this Doc - View Source + View Source

LogWriter

@@ -220,7 +220,7 @@

Methods Improve this Doc - View Source + View Source

ChangeIndent(Int32)

@@ -254,7 +254,7 @@
Parameters
Improve this Doc - View Source + View Source

Debug(String)

@@ -288,7 +288,7 @@
Parameters
Improve this Doc - View Source + View Source

FlushBuffer()

@@ -304,7 +304,7 @@
Declaration
Improve this Doc - View Source + View Source

GetBuffer(Boolean)

@@ -354,7 +354,7 @@
Returns
Improve this Doc - View Source + View Source

Log(String)

@@ -388,7 +388,7 @@
Parameters
Improve this Doc - View Source + View Source

LogBuffered(List<String>)

@@ -423,7 +423,7 @@
Parameters
Improve this Doc - View Source + View Source

LogBuffered(String)

@@ -458,7 +458,7 @@
Parameters
Improve this Doc - View Source + View Source

LogBytes(Int64, Int32)

@@ -498,7 +498,7 @@
Parameters
Improve this Doc - View Source + View Source

Reset()

@@ -514,7 +514,7 @@
Declaration
Improve this Doc - View Source + View Source

SetBuffer(List<String>)

@@ -554,7 +554,7 @@
Parameters
Improve this Doc
  • - View Source + View Source
  • diff --git a/docs/api/index.html b/docs/api/index.html index aeaa2863..4814bb09 100644 --- a/docs/api/index.html +++ b/docs/api/index.html @@ -69,6 +69,62 @@

    Harmony API

    +

    Use the navigation to the left to drill down into the Harmony API documentation.

    +

    Here is a selected list of classes:

    +

    Basics

    + +

    Targeting

    + +

    Attributes

    + +

    Additional patch class annotations

    + +

    Transpiling

    + +

    Helper classes

    +
    diff --git a/docs/articles/patching-transpiler-matcher.html b/docs/articles/patching-transpiler-matcher.html index 8ec62db3..d53cc107 100644 --- a/docs/articles/patching-transpiler-matcher.html +++ b/docs/articles/patching-transpiler-matcher.html @@ -97,7 +97,7 @@

    Use case

    var codeMatcher = new CodeMatcher(instructions /*, ILGenerator generator*/); codeMatcher.MatchStartForward( - CodeMatch.Calls(() => default(DamageHandler).Kill(default(Player))) + CodeMatch.Calls(() => default(DamageHandler).Kill(default)) ) .ThrowIfInvalid("Could not find call to DamageHandler.Kill") .RemoveInstruction() @@ -111,7 +111,7 @@

    Use case

    Using ThrowIfInvalid is for an example purposes. There is ThrowIfNotMatchForward which summarizes the successive calls of MatchStartForward and ThrowIfInvalid.

    codeMatcher.ThrowIfNotMatchForward("Could not find call to DamageHandler.Kill",
    -        CodeMatch.Calls(() => default(DamageHandler).Kill(default(Player)))
    +        CodeMatch.Calls(() => default(DamageHandler).Kill(default))
         )
         .RemoveInstruction()
         .InsertAndAdvance(
    diff --git a/docs/manifest.json b/docs/manifest.json
    index 7155f015..0d5951a0 100644
    --- a/docs/manifest.json
    +++ b/docs/manifest.json
    @@ -45,7 +45,7 @@
           "output": {
             ".html": {
               "relative_path": "api/HarmonyLib.AccessTools.html",
    -          "hash": "AsgPSrIgRv1FJgPNGsiyxemYhYRxRld5gV4RFKaojqw="
    +          "hash": "LblyYBN2hHuNU59q5HsbI3zcwjffyvw1cWfq4dOOHPQ="
             }
           },
           "is_incremental": false,
    @@ -237,7 +237,7 @@
           "output": {
             ".html": {
               "relative_path": "api/HarmonyLib.FileLog.html",
    -          "hash": "6UcTpxNGDkH9DpXBVYd/Eg5KxVAkE04/ShgKwNdMy1o="
    +          "hash": "P6ZLSkhPeqI0VWS6B/+gkd5orrKx5EqWAEQeik8/5bE="
             }
           },
           "is_incremental": false,
    @@ -796,12 +796,15 @@
           "version": ""
         },
         {
    +      "log_codes": [
    +        "InvalidFileLink"
    +      ],
           "type": "Conceptual",
           "source_relative_path": "api/index.md",
           "output": {
             ".html": {
               "relative_path": "api/index.html",
    -          "hash": "I/vleipmraMwEAu10QU0F41n51GgNETkPHREgKFmotI="
    +          "hash": "q54jrOh+eIz9Gtoyo7HVxboITEqzeTeF511gfz1CD0w="
             }
           },
           "is_incremental": false,
    @@ -969,7 +972,7 @@
           "output": {
             ".html": {
               "relative_path": "articles/patching-transpiler-matcher.html",
    -          "hash": "39fUvAYZ2Z43y5O8KuGm0VD5NjhRK1XBm2NskYfwPdQ="
    +          "hash": "xH8hHbMfznFjZPsG9MEqazpVMuyR9gjNgdN2j2VUTw0="
             }
           },
           "is_incremental": false,