| 369 | } |
| 370 | |
| 371 | void FormatBuilder::WriteIndent() { |
| 372 | auto topLevelIndent = _state.GetCurrentIndent(); |
| 373 | switch (_state.GetStyle().indent_style) { |
| 374 | case IndentStyle::Space: { |
| 375 | if (topLevelIndent.SpaceSize != 0) { |
| 376 | auto oldSize = _formattedText.size(); |
| 377 | _formattedText.resize(oldSize + topLevelIndent.SpaceSize, ' '); |
| 378 | } |
| 379 | break; |
| 380 | } |
| 381 | case IndentStyle::Tab: { |
| 382 | if (topLevelIndent.TabSize != 0) { |
| 383 | auto oldSize = _formattedText.size(); |
| 384 | _formattedText.resize(oldSize + topLevelIndent.TabSize, '\t'); |
| 385 | } |
| 386 | if (topLevelIndent.SpaceSize != 0) { |
| 387 | auto oldSize = _formattedText.size(); |
| 388 | _formattedText.resize(oldSize + topLevelIndent.SpaceSize, ' '); |
| 389 | } |
| 390 | break; |
| 391 | } |
| 392 | } |
| 393 | _state.CurrentWidth() += topLevelIndent.SpaceSize + topLevelIndent.TabSize * _state.GetStyle().tab_width; |
| 394 | } |
| 395 | |
| 396 | void FormatBuilder::WriteChar(char ch) { |
| 397 | _state.CurrentWidth()++; |
nothing calls this directly
no test coverage detected