Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microsoft Visual Studio (2008) - Filters in the Solution Explorer

In the Solution Explorer when working with C++ projects there is the standard filters of Header Files, Resource Files, and Source Files. What I'm wanting to accomplish is essentially Filters by folder.


Lets say the structure of the files was like this:

  • ../Folder1/Source1.cpp
  • ../Folder1/Header1.h
  • ../Folder1/Source2.cpp
  • ../Folder1/Header2.h
  • ../AnotherFolder/Source1.cpp
  • ../AnotherFolder/Header1.h
  • ../AnotherFolder/Source2.cpp
  • ../AnotherFolder/Header2.h
  • ../SomeOtherSource.cpp

In the Solution Explorer, it would look like:

  • Header Files/Header1.h
  • Header Files/Header1.h
  • Header Files/Header2.h
  • Header Files/Header2.h
  • Source Files/SomeOtherSource.cpp
  • Source Files/Source1.cpp
  • Source Files/Source1.cpp
  • Source Files/Source2.cpp
  • Source Files/Source2.cpp

And I would like to have it look like this:

  • Header Files/AnotherFolder/Header1.h
  • Header Files/AnotherFolder/Header2.h
  • Header Files/Folder1/Header1.h
  • Header Files/Folder1/Header2.h
  • Source Files/AnotherFolder/Source1.cpp
  • Source Files/AnotherFolder/Source2.cpp
  • Source Files/Folder1/Source1.cpp
  • Source Files/Folder1/Source2.cpp
  • Source Files/SomeOtherSource.cpp

How would this be accomplished?

like image 659
xian Avatar asked Oct 26 '22 06:10

xian


2 Answers

You are free to manually create folders yourself and move the files around. I agree this is a much more convenient way to arrange files but AFAIK there is no way to make VS do this automatically.

like image 106
shoosh Avatar answered Nov 08 '22 05:11

shoosh


You can create the Visual Studio Plugin to do this. I am not sure how you can access "Solution Explorer" programatically.

like image 37
Vinay Avatar answered Nov 08 '22 07:11

Vinay