MD::WithPosition Class
class MD::WithPositionBase for any thing with start and end position. More...
| Header: | #include <md4qt/doc.h> |
| CMake: | find_package(md4qt REQUIRED COMPONENTS md4qt)target_link_libraries(mytarget PRIVATE md4qt::md4qt) |
| Inherited By: |
Public Functions
| WithPosition() | |
| WithPosition(qsizetype startColumn, qsizetype startLine, qsizetype endColumn, qsizetype endLine) | |
| void | applyPositions(const MD::WithPosition &other) |
| qsizetype | endColumn() const |
| qsizetype | endLine() const |
| bool | isNullPositions() const |
| void | setEndColumn(qsizetype c) |
| void | setEndLine(qsizetype l) |
| void | setStartColumn(qsizetype c) |
| void | setStartLine(qsizetype l) |
| qsizetype | startColumn() const |
| qsizetype | startLine() const |
Related Non-Members
| bool | operator==(const MD::WithPosition &l, const MD::WithPosition &r) |
Detailed Description
Such information may be needed for syntax highlighters, for example.
Note: Start position of the document has coordinates (0, 0).
Member Function Documentation
[constexpr noexcept] WithPosition::WithPosition()
Default constructor.
All positions will be set to -1.
WithPosition::WithPosition(qsizetype startColumn, qsizetype startLine, qsizetype endColumn, qsizetype endLine)
Initializing constructor with all positions.
startColumn Start column.
startLine Start line.
endColumn End column.
endLine End line.
void WithPosition::applyPositions(const MD::WithPosition &other)
Apply positions to this from other.
other Positions to apply.
qsizetype WithPosition::endColumn() const
Returns end column.
See also setEndColumn().
qsizetype WithPosition::endLine() const
Returns end line.
See also setEndLine().
bool WithPosition::isNullPositions() const
Returns whether this positions is null (not set).
void WithPosition::setEndColumn(qsizetype c)
Set end column.
c New value.
See also endColumn().
void WithPosition::setEndLine(qsizetype l)
Set end line.
l New value.
See also endLine().
void WithPosition::setStartColumn(qsizetype c)
Set start column.
c New value.
See also startColumn().
void WithPosition::setStartLine(qsizetype l)
Set start line.
l New value.
See also startLine().
qsizetype WithPosition::startColumn() const
Returns start column.
See also setStartColumn().
qsizetype WithPosition::startLine() const
Returns start line.
See also setStartLine().
Related Non-Members
bool operator==(const MD::WithPosition &l, const MD::WithPosition &r)
Returns whether both are equal.
l Left operand.
r Right operand.