Esempio n. 1
0
    public void LoadDefaults()
    {
        working = true;
        
        // bracket Style options
        bracketStyle = Style.STYLE_NONE;

        // tabs / spaces options
        indentType = Indent.INDENT_TABS;
        alignPointers = Align.ALIGN_NONE;
        minConditionalOption = Mincond.MINCOND_TWO;
        fileMode = AstyleFilemode.CPP;
        indentLength = 4;

        // indentation options
        classIndent        = false;
        switchIndent = false;
        caseIndent = false;
        namespaceIndent = false;
        labelIndent = false;
        preprocessorIndent = false;
        col1CommentIndent = false;
        maxInStatementIndent = 40;
        

        // padding options
        breakHeaderBlocks  = false;
        breakClosingBlocks = false;
        padOperators = true;
        padParensOutside   = false;
        padParensInside    = false;
        padHeaders         = false;
        unpadParens        = true;
        deleteEmptyLines   = false;
        fillEmptyLines     = false;

        // formatting options
        breakCloseBrackets = false;
        breakElseIfs       = false;
        addBrackets        = false;
        addOneLineBrackets = false;
        breakOneLineStmts  = false;
        breakOneLineBlocks = false;
        convertTabs        = false;
        
    }
Esempio n. 2
0
 /// Set fileMode and call the AStyleMain function in Artistic Style.
 public String FormatSource(String textIn, AstyleFilemode fileModeArg)
 {   // set file mode before formatting source
     fileMode = fileModeArg;
     String textOut = FormatSource(textIn);
     return textOut;
 }
Esempio n. 3
0
 /// Set the fileMode variable from the input file extension.
 public void SetFileMode(String fileName)
 {
     fileMode = AstyleFilemode.CPP;
     if (fileName.EndsWith(".java"))
         fileMode = AstyleFilemode.JAVA;
     else if (fileName.EndsWith(".cs"))
         fileMode = AstyleFilemode.SHARP;
 }