Is there a way to do that the "swap header/source" feature works globally (ie. not for a specific project but whatever be the loaded project) when I want to take a look at the wxWidgets code. What to add in the global C::B settings ?
Hm, pretty uninformative question. But swap header/source works globally if the header and source are in the same directory, for wx they aren't so this feature is always broken.
From the point you know the wxWidgets tree structure, I effectively asked my question a little bit implicitely ; we could say the obfuscated way ;D But, you're right, oBFusCATed, the explicit question is well :
How to do that the header/source swapping feature works against wxWidgets source code, considering that its interface and implementation files are in differents locations ?
By improving the feature, simple as this :)
Check the option "Use one parser for all workspace", so that all your data/tokens were stored in a single database.Quote from: oBFusCATed on September 04, 2012, 07:48:43 PM
swap header/source works globally if the header and source are in the same directory
They will work if the cpp and h files were in different directory, but have the same short/base name like:
c:/aaa/bbb/ccc/xyz.cpp
d:/eee/fff/xyz.h
ollydbg: no it doesn't work, tested many times at least on linux.
Quote from: oBFusCATed on September 05, 2012, 02:12:57 AM
ollydbg: no it doesn't work, tested many times at least on linux.
OK, I will check it.
Quote from: ollydbg on September 05, 2012, 02:15:21 AM
Quote from: oBFusCATed on September 05, 2012, 02:12:57 AM
ollydbg: no it doesn't work, tested many times at least on linux.
OK, I will check it.
Hi, oBF, you are right, I look at the source code, it was in:
bool EditorManager::SwapActiveHeaderSource()
But I see a lot of hacks here.
I think the correct way was:
Using the CodeCompletion-plugin, we have
TokenFilenamesMap m_FilenamesMap;This contains all the file names parsed by CC, but the name is recorded in fullname style. Then we can do a search by the "base short name".
This would also be a hack, because it will not work, of there are fseveral fles with the same name.
And it would rely on cc, and I don't think a core-comoponent can safely rely on a plugin.
Probably we can make it use it as an additional source. But first we need public interface to the CC.
Yeah, brains are active here 8)
Maybe a stupidity, but why not let the C::B user to indicate the base directory for headers and the one for implementations. For example, in wxWidgets, it could be :
"[wxWidgets-base]\include" for .h
"[wxWidgets-base]\src" for .cpp
Then search recursively from the appropriated base and show dialog-box (for the user to choose) if there're several files with same filename. Of course, recursive search can be long, but only for big trees (so, big projects and/or libs).
-
EDIT : also, this recursive searching would be engaged only if .h and .cpp are not in the same directory (this to not slow down current behavior).