Information on the span of some source code text. More...
#include <CodeSpan.hpp>
Static Public Member Functions | |
static CodeSpan | emptyCodeSpanEnd (const CodeSpan &previous) |
Create an empty code span equal to the end of the supplied code span. More... | |
static CodeSpan | emptyCodeSpanStart (const CodeSpan &next) |
Create an empty code span equal to the start of the supplied code span. More... | |
static CodeSpan | totalCodeSpan (const CodeSpan &start, const CodeSpan &end) |
Create a code span equal to the start of the first code span and the end of the end code span. More... | |
Public Member Functions | |
CodeSpan () | |
Create a null code span. More... | |
CodeSpan (unsigned int lineStart_, unsigned int columnStart_, unsigned int lineEnd_, unsigned int columnEnd_) | |
Create a code span equal to the supplied start and end positions. More... | |
CodeSpan (const CodePosition &start_, const CodePosition &end_) | |
Create a code span equal to the supplied start and end positions. More... | |
CodeSpan (const CodeSpan ©)=default | |
Create a code span by copying the supplied code span. More... | |
CodeSpan (CodeSpan &©)=default | |
Create a code span by moving the supplied code span. More... | |
CodeSpan & | operator+= (const CodeSpan &rhs) |
Extend the current code span to the end of the supplied code span. More... | |
bool | operator< (const CodeSpan &rhs) const |
Is this code span less than the supplied code span? More... | |
CodeSpan & | operator= (const CodeSpan &rhs)=default |
Copy assign the supplied code span to the current code span. More... | |
CodeSpan & | operator= (CodeSpan &&rhs)=default |
Move assign the supplied code span to the current code span. More... | |
bool | operator== (const CodeSpan &rhs) const |
Returns true if the current code span is equal to the supplied code span. More... | |
bool | operator> (const CodeSpan &rhs) const |
Is this code span greater than the supplied code span? More... | |
Public Attributes | |
CodePosition | end |
The end position of the code span. More... | |
CodePosition | start |
The start position of the code span. More... | |
Information on the span of some source code text.
An instance of this structure should be accompanied by a URI for full identification of the source code span.
|
inline |
Create a null code span.
|
inline |
Create a code span equal to the supplied start and end positions.
|
inline |
Create a code span equal to the supplied start and end positions.
Create an empty code span equal to the end of the supplied code span.
previous | the code span |
Create an empty code span equal to the start of the supplied code span.
next | the code span |
Extend the current code span to the end of the supplied code span.
It is the responsibility of the caller to ensure that the supplied code span originate from the same source file.
rhs | the code span to extend to |
|
inline |
Is this code span less than the supplied code span?
As one code span can contain another code span, the definition of less than that is used here is wholy with respect to the start point of the code span.
Copy assign the supplied code span to the current code span.
rhs | the code span to assign from |
Move assign the supplied code span to the current code span.
rhs | the code span to assign from |
|
inline |
Returns true if the current code span is equal to the supplied code span.
rhs | the code span to compare |
|
inline |
Is this code span greater than the supplied code span?
As one code span can contain another code span, the definition of greater than that is used here is wholy with respect to the start point of the code span.
Create a code span equal to the start of the first code span and the end of the end code span.
It is the responsibility of the caller to ensure that both code spans originate from the same source file.
start | the start code span |
end | the end code span |
CodePosition end |
The end position of the code span.
CodePosition start |
The start position of the code span.