Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

several issues with "open #include file ..."

<< < (3/7) > >>

killerbot:
 :lol:  :P
Problem 1 is solved, in a next post I will describe my analysis of the second problem (but have to go now).

Attached is the modified file : nativeparser(new.cpp), thanks to Urxae for the tip.

What did I do :
I check to see which compiler it is, when it is the GNU GCC compiler, i'll do my little magic. I find out the compiler's internal include diectories, and add them to the toher include dir's list.
I create a temporary file for this purpose which I delete afterwards.

The modified code can be found between the lines :
      // start of new stuff by Lieven de Cock
      // end of new stuff by Lieven de Cock
together with an include at the top for the regex functions.

There's one TODO left, I just create the temp file, without checking where we are (and if we can actually create a file at that place), maybe we should check the environment for the temp dir (does that exist in linux ??). On windows I saw that the temp file showed up next to the Cb executable and then nicely disappears. ;-)

So to summarize, these adjustments to the code allow you for GCC projects to "open include file" the C++ headers.

Yiannis,
I hope this code is OK for you ?

Note : I think a better place for these steps might be in the autodetection of the gnu compiler, and then add them to the include dir's list which is also visible in the GUI. So in that case my earliest idea fo a solution will still work even for other version of the gnu compiler. Yiannis, I leave this up to you. ;-)

Cheers (as promised further analysis for the second problem coming up),
Lieven


[attachment deleted by admin]

MortenMacFly:

--- Quote from: killerbot on November 26, 2005, 05:01:04 pm ---There's one TODO left, [...]

--- End quote ---
Just a hint: I never did very much with wxWidgets but I believe that there is a wxTempFile that does the job: http://www.wxwidgets.org/manuals/2.6.1/wx_wxtempfile.html.

Morten.

killerbot:
Thanks for the wxTempFile info, I just looked at the explanation. I am afraid it won't help for the TODO, since there's no file to replace, si no guarantee that we are at a writable position.
Nevertheless, interesting function, I just learned some more stuff , thank you.

MortenMacFly:

--- Quote from: killerbot on November 26, 2005, 07:20:00 pm ---Nevertheless, interesting function, I just learned some more stuff , thank you.

--- End quote ---
...you might want to learn even more:  :)
http://www.wxwindows.org/manuals/2.6.2/wx_wxfilename.html#wxfilenameassigntempfilename

Morten.

mandrav:

--- Quote ---There's one TODO left, I just create the temp file, without checking where we are (and if we can actually create a file at that place), maybe we should check the environment for the temp dir (does that exist in linux ??). On windows I saw that the temp file showed up next to the Cb executable and then nicely disappears.
--- End quote ---

You should use wxFileName::CreateTempFileName() ;)
As for the patch, I 'll have a look at it, thanks.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version