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; }
/// 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; }
/// 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; }