Here is the filter of my project in Visual Studio shown in Solution Explorer : -
ProjectName1 == References, External Dependencies, Header Files, Resource Files == Source Files ==== myFilter01 ------ Kh (system folder = `D:\ProjectName1\Kh`) ------ K.cpp (system folder = `D:\ProjectName1\K.cpp`) ==== myFilter02 ====== subFilter2_1 --------- Bh (system folder = `D:\ProjectName1\Bh`) --------- B.cpp (system folder = `D:\ProjectName1\B.cpp`) ========= subFilter2_2 ----------- Ch (system folder = `D:\ProjectName1\Ch`) ----------- C.cpp (system folder = `D:\ProjectName1\C.cpp`) ProjectName2 == ... (some existing filter/files)
(In the real case, all filters contain many sub-filters and files.)
Question
How to do:
- move all
.h and .cpp files ( B and C ) inside myFilter02 to the ProjectName2 folder (for example, D:\ProjectName2 ) - does not change the appearance of the filter (e.g.
C must remain in subFilter2_1\subFilter2_2 ) - and do it in a few clicks (i.e. it does not depend on the number of files / subfilters), i.e.
O(1)
Here is the expected result: -
ProjectName1 == References, External Dependencies, Header Files, Resource Files == Source Files ==== myFilter01 ------ Kh (system folder = `D:\ProjectName1\Kh` ) ------ K.cpp (system folder = `D:\ProjectName1\K.cpp` ) ==== myFilter02 ProjectName2 == ... (some existing filter/files) == subFilter2_1 ----- Bh (system folder = `D:\ProjectName2\Bh` ) ----- B.cpp (system folder = `D:\ProjectName2\B.cpp` ) ===== subFilter2_2 ------- Ch (system folder = `D:\ProjectName2\Ch` ) ------- C.cpp (system folder = `D:\ProjectName2\C.cpp` )
This can be done manually for each sub-sub-filter + add existing files, but it is very tiring.
I tried right-clicking the filter / files, but did not find such a function.
I currently do not use any Microsoft source / storage (just in case this is related).
Note. Normal drag-and-drop on filters does not transfer files to another folder .
It just makes the moved files be a shortcut to the original location ( D:\ProjectName1\ ).
Hotkey? Plugin? Script?
Do I need to create a program to perform this specific task?
A few days after the request, I encoded it using C ++ using RapidXML ~ 500-1000 lines.
I need to edit .vcxproj.filters and .vcxproj both projects and move some system files.
I still cannot find the answer to this question.
Edit
(After receiving advice from Hans Passan and Prab, thanks!)
I want to use a filter rather than a folder for the following reasons: -
- Source control is easier because all source files are in the same directory.
- In Visual Studio, I can move files around various filters a little easier than around folders .
- With the filter, I do not need to extend
#include "../myFilter01/Kh" or add additional directories for each folder. I can just #include "Kh" . - If I change the location of the file in the filter , I do not need to reorganize it.
In case of changing the folder , I have to use the refactoring code. - I can use a very strange character, for example.
=βββmyFilter01βββ= for filters, but not for the folder. This is my taste.
I do not want
- Use a folder instead of a filter: In addition to the difficulties of creating many folders and manually moving my
.cpp/.h files, I will experience the above disadvantages. - Use a folder with the same structure as the filter: I need to synchronize it manually (tedious all the time). I still get some of the above disadvantages.
In general, using a folder instead of a filter causes me more new problems than it solves.
c ++ visual-studio
javaLover
source share