Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
bingbingbingbing
mono
提交
8471a16d
M
mono
项目概览
bingbingbingbing
/
mono
与 Fork 源项目一致
从无法访问的项目Fork
通知
35
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mono
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
8471a16d
编写于
2月 21, 2014
作者:
L
Levi Bard
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add utility function for finding all classes with a given name (case- and namespace-insensitive).
Case 585394.
上级
4bf72cc0
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
32 addition
and
0 deletion
+32
-0
msvc/mono.def
msvc/mono.def
+1
-0
unity/unity_utils.c
unity/unity_utils.c
+31
-0
未找到文件。
msvc/mono.def
浏览文件 @
8471a16d
...
...
@@ -52,6 +52,7 @@ mono_unity_class_is_interface
mono_unity_class_is_abstract
mono_backtrace_from_context
mono_unity_thread_clear_domain_fields
mono_unity_get_all_classes_with_name_case
;Exports that should have been here, but I dont understand why they're not.
mono_security_enable_core_clr
...
...
unity/unity_utils.c
浏览文件 @
8471a16d
...
...
@@ -9,7 +9,10 @@
#include <mono/metadata/tabledefs.h>
#include <mono/metadata/class-internals.h>
#include <mono/metadata/object-internals.h>
#include <mono/metadata/metadata-internals.h>
#include <mono/metadata/threads.h>
#include <mono/metadata/tokentype.h>
#include <mono/utils/mono-string.h>
#include <glib.h>
...
...
@@ -155,3 +158,31 @@ void mono_unity_thread_clear_domain_fields (void)
MonoThread
*
thread
=
mono_thread_current
();
thread
->
principal
=
NULL
;
}
// classes_ref is a preallocated array of *length_ref MonoClass*
// returned classes are stored in classes_ref, number of stored classes is stored in length_ref
// return value is number of classes found (which may be greater than number of classes stored)
unsigned
mono_unity_get_all_classes_with_name_case
(
MonoImage
*
image
,
const
char
*
name
,
MonoClass
**
classes_ref
,
unsigned
*
length_ref
)
{
MonoClass
*
klass
;
MonoTableInfo
*
tdef
=
&
image
->
tables
[
MONO_TABLE_TYPEDEF
];
int
i
,
count
;
guint32
attrs
,
visibility
;
unsigned
length
=
0
;
/* (yoinked from icall.c) we start the count from 1 because we skip the special type <Module> */
for
(
i
=
1
;
i
<
tdef
->
rows
;
++
i
)
{
klass
=
mono_class_get
(
image
,
(
i
+
1
)
|
MONO_TOKEN_TYPE_DEF
);
if
(
klass
&&
klass
->
name
&&
0
==
mono_utf8_strcasecmp
(
klass
->
name
,
name
))
{
if
(
length
<
*
length_ref
)
classes_ref
[
length
]
=
klass
;
++
length
;
}
}
if
(
length
<
*
length_ref
)
*
length_ref
=
length
;
return
length
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录