MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / init

Method init

other_src/astyle/src/ASEnhancer.cpp:56–97  ·  view source on GitHub ↗

* initialize the ASEnhancer. * * init() is called each time an ASFormatter object is initialized. */

Source from the content-addressed store, hash-verified

54 * init() is called each time an ASFormatter object is initialized.
55 */
56void ASEnhancer::init(int fileType,
57 int _indentLength,
58 string _indentString,
59 bool _caseIndent,
60 bool _preprocessorIndent,
61 bool _emptyLineFill)
62{
63 // formatting variables from ASFormatter and ASBeautifier
64 ASBase::init(fileType);
65 indentLength = _indentLength;
66 if (_indentString == "\t")
67 useTabs = true;
68 else
69 useTabs = false;
70
71 caseIndent = _caseIndent;
72 preprocessorIndent = _preprocessorIndent;
73 emptyLineFill = _emptyLineFill;
74 quoteChar = '\'';
75
76 // unindent variables
77 lineNumber = 0;
78 bracketCount = 0;
79 isInComment = false;
80 isInQuote = false;
81 switchDepth = 0;
82 lookingForCaseBracket = false;
83 unindentNextLine = false;
84 shouldIndentLine = false;
85
86 // switch struct and vector
87 sw.switchBracketCount = 0;
88 sw.unindentDepth = 0;
89 sw.unindentCase = false;
90 switchStack.clear();
91
92 // other variables
93 nextLineIsEventIndent = false;
94 isInEventTable = false;
95 nextLineIsDeclareIndent = false;
96 isInDeclareSection = false;
97}
98
99/**
100 * additional formatting for line of source code.

Callers 15

formatCinToCoutMethod · 0.45
formatFileMethod · 0.45
AStyleMainFunction · 0.45
parse_afmFunction · 0.45
t42_parser_initFunction · 0.45
t42_parse_encodingFunction · 0.45
t42_parse_charstringsFunction · 0.45
FT_CMap_NewFunction · 0.45
cid_parser_newFunction · 0.45
cid_slot_load_glyphFunction · 0.45
T1_Compute_Max_AdvanceFunction · 0.45

Calls 2

initFunction · 0.50
clearMethod · 0.45

Tested by 1

parse_afmFunction · 0.36