Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » How to stop inserting same include stmt more than once
How to stop inserting same include stmt more than once [message #1817915] Tue, 03 December 2019 05:51
Ming Cheng is currently offline Ming ChengFriend
Messages: 19
Registered: December 2019
Junior Member
I don't know why the following code does not work as expected:

Void GenerateCPPSrc()
{
....
/*IInclude inc = tu.getInclude("QfixLogger.h");
JOptionPane.showMessageDialog( null, "1" );
if (false == inc.exists()) {
JOptionPane.showMessageDialog( null, "1.1" );
tu.createInclude("QfixLogger.h", false, null, monitor);
JOptionPane.showMessageDialog( null, "1.2" );
} else {
JOptionPane.showMessageDialog( null, "2" );
}*/
.....
}

If my file does not have QfixLogger.h, I can see 1, but no 1.1/1.2, neither 2.
If I don't do inc.exists() checking, and I call GenerateCPPSrc more than 1 time, then I can see several "#include "QfixLogger.h" " in my file.
Previous Topic:How to add "//" and "/* ... */" style comments into a ITranslatorUnit?
Next Topic:hello world with eclipse c/c++
Goto Forum:
  


Current Time: Thu Apr 25 22:08:46 GMT 2024

Powered by FUDForum. Page generated in 0.02660 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top