Code example for StringWriter

Methods: toStringwrite

0
        off= contents.indexOf("_guard", off+1); //$NON-NLS-1$
        assertChange(ch, cpp, off, 6, "WELT"); //$NON-NLS-1$
    } 
     
    public void testMacroParameters() throws Exception { 
        StringWriter writer = new StringWriter();
        writer.write("int var;                  \n"); //$NON-NLS-1$
        writer.write("#define M1(var) var       \n"); //$NON-NLS-1$
        writer.write("#define M2(var, x) (var+x)*var  \n"); //$NON-NLS-1$
        writer.write("#define M3 var            \n"); //$NON-NLS-1$
        String contents = writer.toString();
        IFile cpp= importFile("test.cpp", contents ); //$NON-NLS-1$
         
        int offset1= contents.indexOf("var"); //$NON-NLS-1$
        Change ch= getRefactorChanges(cpp, offset1, "xxx");  //$NON-NLS-1$
        assertTotalChanges(1, 1, 0, ch);
    } 
 
    public void testRenameMacroAsMacroArgument() throws Exception { 
        StringWriter writer = new StringWriter();
Contextual code suggestions in your IDE  Get Codota for Java