使用 Visual studio .ncb 文件进行反射

发布于 2024-08-27 05:07:03 字数 210 浏览 8 评论 0原文

我正在用 C++ 开发可视化游戏关卡编辑器。 为此,我希望反射(RTTI)机制在运行时了解类属性。 我目前正在为此使用 PDB 文件。但是使用 PDB,我无法检索实际的代码行以获取针对该属性给出的注释格式的额外信息。 Visual Studio 使用 NCB 文件来获取情报。 那么使用 NCB 代替 PDB 会是更好的主意吗? 如果是,如何从 NCB 文件中检索信息? 有没有类似DIA SDK的SDK?

I am developing visual game level editor in C++.
For this I want reflection(RTTI) mechanism to know class attributes at runtime.
I am currently using PDB files for this.But using PDB I couldn't retrieve actual code line for extra information in commented format which is given for that attribute.
Visual studio uses NCB files for intelligence.
So will it be better idea to use NCB instead PDB?
If yes,How to retrieve information from NCB files?
Is there any SDK like DIA SDK?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

兮子 2024-09-03 05:07:03

NCB 文件格式并未公开记录,并且会随 Visual Studio 的每个版本而变化。随着即将推出的 VS2010(大约一周半后发布),它将完全消失,取而代之的是一种新的基于 SQL 的格式,这种格式应该更容易使用。 Microsoft 还实现了一个 API,用于与解析器中的 Intellisense 数据集成。

The NCB file format isn't publicly documented and changes with every version of Visual Studio. With the upcoming VS2010 (due out in about a week and a half), it's going away entirely in favor of a new SQL-based format that should be much easier to work with. Microsoft is also implementing an API for integrating with the Intellisense data from the parser.

注定孤独终老 2024-09-03 05:07:03

我真的不会依赖 .ncb 文件进行反射。这些文件用于智能感知,并且仅用于智能感知。它们可能会在没有警告的情况下发生变化,不是最新的,或者你有什么......

你可以做一些宏黑客来获得你寻求的反射(比如将你的变量/方法推入某个容器,并同时声明它)。或使用像 Qt 这样的框架(这是我一直在关卡编辑器中使用的框架)。

I really wouldn't rely on the .ncb files for reflection. Those files are meant for intellisense, and only intellisense. They could change without warning, not be up to date, or what have you...

You could do some macro hackery to get the reflection you seek (something like push your variables/methods into some container, and declare it simultaneously)... or use a framework like Qt (which is what I've been using for my level editor).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文