Visual Studio 2010 中的解决方案资源管理器筛选器
我正在寻找有关新的 Visual Studio 2010 .vcxproj.filters 文件的语法信息。有没有一种方法可以不仅仅基于扩展名进行通配符过滤?
场景如下:
我们有一个工具,可以为 Visual Studio 2005 编写一个项目文件,定义应用程序中的所有消息以及关联的生成类。在项目文件中,我们不仅按 h/cpp 还按用户定义的过滤器对 C++ 文件进行分组,因此我们的项目可能如下所示:
- messages
( < ;-- 这是 .vcproj 文件)
- GENERATED_MSGS
- COM
- h
- COMRequest.h
- COMRequestAck.h
- cpp
- COMRequest.cpp
- COMRequestAck.cpp
- h
- 数据
- h
- DATARequest.h
- DATARequestAck.h
- cpp
- DATARequest.cpp
- DATARequestAck.cpp
- h
- 订单
- h
- cpp
- COM
- 头文件
- HandCraftedMessage1.h
- HandCraftedMessage2.h
- 源文件
- HandCraftedMessage1.cpp
- HandCraftedMessage2.cpp
- MyFileThatDefinesTheMessages.xml
- GENERATED_MSGS
筛选器(COM、DATA、ORDER 等)存储在 .vcproj 文件中:
...
<Files>
<Filter Name="GENERATED_MSGS">
<Filter Name="COM">
<Filter Name="COM">
<Filter Name="h">
<File RelativePath=".\COMRequest.h"/>
...
在 Visual Studio 2010 中,为项目定义的文件位于 .vcxproj 文件中,但如何显示它们的过滤器存储在 .vcxproj.filters 文件中。由于我们的过滤器始终由类名的第一部分确定,因此我希望只使用消息生成工具创建 .vcxproj 文件并修改 .filters 文件以使用通配符将文件放入正确的过滤器中。例如,名为 ORDERRequest.h
的文件应进入 GENERATED_MSGS/ORDER/h
过滤器。有没有一种方法可以定义通配符来执行此操作,以便 ORDER*.h 将进入一个文件夹,而 COM*.h 将进入另一个文件夹?我遇到过
标记,但这对于对我来说,因为我想将其分解,而不仅仅是通过扩展。
I'm looking for syntax information on the new Visual Studio 2010 .vcxproj.filters file. Is there a way to do wildcard filtering based on more than just the extension?
Here's the scenario:
We have a tool that writes a project file for Visual Studio 2005 defining all the messages in an application, along with the associated generated classes. In the project file, we grouped the C++ files not only by h/cpp, but also by user-defined filters, so our project might look something like this:
- messages
( <-- that's the .vcproj file)
- GENERATED_MSGS
- COM
- h
- COMRequest.h
- COMRequestAck.h
- cpp
- COMRequest.cpp
- COMRequestAck.cpp
- h
- DATA
- h
- DATARequest.h
- DATARequestAck.h
- cpp
- DATARequest.cpp
- DATARequestAck.cpp
- h
- ORDER
- h
- cpp
- COM
- Header Files
- HandCraftedMessage1.h
- HandCraftedMessage2.h
- Source Files
- HandCraftedMessage1.cpp
- HandCraftedMessage2.cpp
- MyFileThatDefinesTheMessages.xml
- GENERATED_MSGS
The filters (COM, DATA, ORDER, etc.) are stored in the .vcproj file:
...
<Files>
<Filter Name="GENERATED_MSGS">
<Filter Name="COM">
<Filter Name="COM">
<Filter Name="h">
<File RelativePath=".\COMRequest.h"/>
...
In Visual Studio 2010, the files defined for the project are in the .vcxproj file, but the filters for how to display them are stored in the .vcxproj.filters file. Since our filters are always determined by the first part of the class name, I was hoping to get away with only creating the .vcxproj file with message generation tool and modifying the .filters file to use wildcards to put the files in the correct filter. For instance, a file named ORDERRequest.h
should go into the GENERATED_MSGS/ORDER/h
filter. Is there a way I can define a wildcard to do this, so that ORDER*.h would go in one folder, while COM*.h would go in a different folder? I have run across the <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
tag, but this is not flexible enough for me, since I want to break it down more than just by extension.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论