简体   繁体   English

如何从单声道的c ++中获取某个类中所有方法的列表?

[英]How can I get a list of all methods in a certain class from c++ in mono?

I've loaded my assembly "monoass.dll" using 我已经加载了我的程序集“monoass.dll”

mono_domain_assembly_open(domain, "C:/monoass.dll");

then I found my class which name is "MainClass" using 然后我发现我的班级名称是“MainClass”使用

mono_class_from_name(mono_assembly_get_image(ass), "monoass", "MainClass"); // where "monoass" is the name of namespace

then I need to find all methods in "MainClass" class as MonoMethod** array. 那么我需要在“MainClass”类中找到MonoMethod MonoMethod**数组中的所有方法 How can I do this? 我怎样才能做到这一点?

Mono version is: Mono-3.2.3 单声道版本是:Mono-3.2.3

Additional questions: 其他问题:

1) How can I output the MonoMethod 's name, arguments and return value to the console? 1)如何将MonoMethod的名称,参数和返回值输出到控制台? Is there any mono_method_to_string(MonoMethod* method) function? 有没有mono_method_to_string(MonoMethod *方法)函数?

2) How can I get all namespaces in my assembly (and print each name to the console) and then for each namespace get the array of all clases which are in the namespace? 2)如何在程序集中获取所有名称空间(并将每个名称打印到控制台),然后为每个名称空间获取名称空间中所有clases的数组?

you can get all methods like this: 你可以得到这样的所有方法:

void* iter = NULL;
MonoMethod* method;
while(method = mono_class_get_methods(mono_class, &iter))
{
    cout << mono_method_full_name(method, 1);
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我如何制作某个类的列表,但仍允许使用其所有参数C#在列表中允许该类的扩展 - How can I make a list of a certain class, but still allow extensions of the class to be allowed in the list with all of their parameters C# 如何覆盖类中所有属性的get和set方法? - How can I override get and set methods for all properties in a class? 如何有效地将 C 风格的函数(对于 Mono)绑定到 C++ 风格的类方法 - How to efficiently bind C-style function (for Mono) to C++ style class methods 如何从Mono for Android应用程序获取网络文件列表? - How can I get a list of network files from my mono for android application? 如何从Mono上的自定义列表视图获取文本数据 - How can i get the Text data from a Custom List View on Mono for android 我们如何在 C# 中从 C++ DLL 中获取所有方法? - How do we get all methods from C++ DLL in C#? 我如何通过Cpython从Mono调用C#? - How can i call C# from Cpython by mono? 如何在我的C程序中单声道AOT生成的SO文件中使用方法? - How can I use methods in the SO files produced by mono AOT in my C program? C#从类的方法中获取所有返回值 - C# Get all return values from methods of a class c#:如何验证按特定顺序调用方法? - c#: How can I verify methods are called in a certain order?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM