Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Refactoring via API: how to get the refactored file/content?


I am performing some refactorings via CDT Refactoring API, as can be seen below:

        StringWriter writer = new StringWriter();

        writer.write("void f1() {         \n);

        writer.write("  int x;              \n");

        writer.write("  }                       \n”);

        String content = writer.toString();

        IFile cFile= importF(“example.c", contents );

        int offset= contents.indexOf(“x");        

        RefactoringStatus status= checkConditions(cFile, offset, y);


But I don’t know how can I see the refactored content, in other words, I dont know how can I see the result of the refactoring:

        "void f1() {);

        "  int y;"

        "  } ”

 Is via the CRenameProcessor class? I am not realising how can I do that. 

Thanks a lot.


Gustavo Wagner
Skype/Redes Sociais: gugawag

Back to the top