Solution Explorer Filters in Visual Studio 2010

I am looking for syntax information in a new Visual Studio 2010 .vcxproj.filters file. Is there a way to do wildcard filtering based on more than just extension?

Here's the script:

We have a tool that writes a project file for Visual Studio 2005, defining all the messages in the application along with the associated generated classes. In the project file, we grouped C ++ files not only using h / cpp, but also using custom filters, so our project may look something like this:

  • posts ( <-- that the .vcproj file)
    • GENERATED_MSGS
      • COM
        • h
          • COMRequest.h
          • COMRequestAck.h
        • CPP
          • COMRequest.cpp
          • COMRequestAck.cpp
      • DATA
        • h
          • Datarequest.h
          • DATARequestAck.h
        • CPP
          • Datarequest.cpp
          • DatarequestAck.cpp
      • TO ORDER
        • h
        • caste
    • Header files
      • HandCraftedMessage1.h
      • HandCraftedMessage2.h
    • Source files
      • HandCraftedMessage1.cpp
      • HandCraftedMessage2.cpp
    • MyFileThatDefinesTheMessages.xml

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 displaying 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 creating the .vcxproj file using the message generation and modifying .filters file tool to use wildcards to put the files in the correct filter. For example, a file named ORDERRequest.h should go to the GENERATED_MSGS/ORDER/h filter. Is there a way I can define a template for this, so that ORDER * .h will go in one folder and COM * .h in another folder? I ran the <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> , but this is not flexible enough for me since I want to break it more than just an extension.

+4
source share

Source: https://habr.com/ru/post/1346643/


All Articles