* initialize the ASEnhancer. * * init() is called each time an ASFormatter object is initialized. */
| 50 | * init() is called each time an ASFormatter object is initialized. |
| 51 | */ |
| 52 | void ASEnhancer::init(int _fileType, |
| 53 | int _indentLength, |
| 54 | int _tabLength, |
| 55 | bool _useTabs, |
| 56 | bool _forceTab, |
| 57 | bool _caseIndent, |
| 58 | bool _preprocessorIndent, |
| 59 | bool _emptyLineFill) |
| 60 | { |
| 61 | // formatting variables from ASFormatter and ASBeautifier |
| 62 | ASBase::init(_fileType); |
| 63 | indentLength = _indentLength; |
| 64 | tabLength = _tabLength; |
| 65 | useTabs = _useTabs; |
| 66 | forceTab = _forceTab; |
| 67 | caseIndent = _caseIndent; |
| 68 | preprocessorIndent = _preprocessorIndent; |
| 69 | emptyLineFill = _emptyLineFill; |
| 70 | quoteChar = '\''; |
| 71 | |
| 72 | // unindent variables |
| 73 | lineNumber = 0; |
| 74 | bracketCount = 0; |
| 75 | isInComment = false; |
| 76 | isInQuote = false; |
| 77 | switchDepth = 0; |
| 78 | lookingForCaseBracket = false; |
| 79 | unindentNextLine = false; |
| 80 | shouldUnindentLine = false; |
| 81 | shouldUnindentComment = false; |
| 82 | |
| 83 | // switch struct and vector |
| 84 | sw.switchBracketCount = 0; |
| 85 | sw.unindentDepth = 0; |
| 86 | sw.unindentCase = false; |
| 87 | switchStack.clear(); |
| 88 | |
| 89 | // other variables |
| 90 | nextLineIsEventIndent = false; |
| 91 | isInEventTable = false; |
| 92 | nextLineIsDeclareIndent = false; |
| 93 | isInDeclareSection = false; |
| 94 | } |
| 95 | |
| 96 | /** |
| 97 | * additional formatting for line of source code. |
no outgoing calls
no test coverage detected