|
clang 22.0.0git
|
Represents the spaces at the start of a line, keeping track of what the spaces are for. More...
#include "/work/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/Format/ContinuationIndenter.h"
Public Member Functions | |
| IndentationAndAlignment | addPadding (unsigned Spaces) const |
| Add spaces for right-justifying the token. | |
| IndentationAndAlignment | operator+ (unsigned Spaces) const |
| Adding indentation is more common than padding. So the operator does that. | |
| IndentationAndAlignment | operator- (unsigned Spaces) const |
| IndentationAndAlignment & | operator+= (unsigned Spaces) |
| IndentationAndAlignment (unsigned Total, unsigned IndentedFrom) | |
| IndentationAndAlignment (unsigned Spaces) | |
| bool | operator< (const IndentationAndAlignment &Other) const |
Public Attributes | |
| unsigned | Total |
| unsigned | IndentedFrom |
| The column that the position of the start of the line is calculated from. | |
Represents the spaces at the start of a line, keeping track of what the spaces are for.
Definition at line 48 of file ContinuationIndenter.h.
| clang::format::IndentationAndAlignment::IndentationAndAlignment | ( | unsigned | Total, |
| unsigned | IndentedFrom ) |
Definition at line 263 of file ContinuationIndenter.cpp.
References IndentedFrom, and Total.
Referenced by addPadding(), operator+(), operator+=(), operator-(), and operator<().
| clang::format::IndentationAndAlignment::IndentationAndAlignment | ( | unsigned | Spaces | ) |
Definition at line 267 of file ContinuationIndenter.cpp.
References IndentedFrom, and Total.
| IndentationAndAlignment clang::format::IndentationAndAlignment::addPadding | ( | unsigned | Spaces | ) | const |
Add spaces for right-justifying the token.
The IndentedFrom field does not change.
This example in Objective-C shows why the field should not change. The token xx is right-justified with this method to align the : symbols. The : symbols should remain aligned through the step that aligns assignments. That step uses the IndentedFrom field to tell what lines to move. Not changing the field in this method ensures that the 2 lines move together.
[x // xxxx:0 xx:0];
Definition at line 244 of file ContinuationIndenter.cpp.
References IndentationAndAlignment(), IndentedFrom, and Total.
| IndentationAndAlignment clang::format::IndentationAndAlignment::operator+ | ( | unsigned | Spaces | ) | const |
Adding indentation is more common than padding. So the operator does that.
Definition at line 249 of file ContinuationIndenter.cpp.
References IndentationAndAlignment(), and Total.
| IndentationAndAlignment & clang::format::IndentationAndAlignment::operator+= | ( | unsigned | Spaces | ) |
Definition at line 258 of file ContinuationIndenter.cpp.
References IndentationAndAlignment().
| IndentationAndAlignment clang::format::IndentationAndAlignment::operator- | ( | unsigned | Spaces | ) | const |
Definition at line 254 of file ContinuationIndenter.cpp.
References IndentationAndAlignment(), and Total.
| bool clang::format::IndentationAndAlignment::operator< | ( | const IndentationAndAlignment & | Other | ) | const |
Definition at line 270 of file ContinuationIndenter.cpp.
References IndentationAndAlignment(), IndentedFrom, clang::format::Other, and Total.
| unsigned clang::format::IndentationAndAlignment::IndentedFrom |
The column that the position of the start of the line is calculated from.
It can be more than Total.
Definition at line 53 of file ContinuationIndenter.h.
Referenced by addPadding(), IndentationAndAlignment(), IndentationAndAlignment(), and operator<().
| unsigned clang::format::IndentationAndAlignment::Total |
Definition at line 49 of file ContinuationIndenter.h.
Referenced by addPadding(), IndentationAndAlignment(), IndentationAndAlignment(), operator+(), operator-(), and operator<().