Static Public Member Functions | Public Member Functions | Public Attributes | List of all members
CodeSpan Class Reference

Information on the span of some source code text. More...

#include <CodeSpan.hpp>

Collaboration diagram for CodeSpan:
[legend]

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 &copy)=default
 Create a code span by copying the supplied code span. More...
 
 CodeSpan (CodeSpan &&copy)=default
 Create a code span by moving the supplied code span. More...
 
CodeSpanoperator+= (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...
 
CodeSpanoperator= (const CodeSpan &rhs)=default
 Copy assign the supplied code span to the current code span. More...
 
CodeSpanoperator= (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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ CodeSpan() [1/5]

CodeSpan ( )
inline

Create a null code span.

◆ CodeSpan() [2/5]

CodeSpan ( unsigned int  lineStart_,
unsigned int  columnStart_,
unsigned int  lineEnd_,
unsigned int  columnEnd_ 
)
inline

Create a code span equal to the supplied start and end positions.

◆ CodeSpan() [3/5]

CodeSpan ( const CodePosition start_,
const CodePosition end_ 
)
inline

Create a code span equal to the supplied start and end positions.

◆ CodeSpan() [4/5]

CodeSpan ( const CodeSpan copy)
default

Create a code span by copying the supplied code span.

◆ CodeSpan() [5/5]

CodeSpan ( CodeSpan &&  copy)
default

Create a code span by moving the supplied code span.

Member Function Documentation

◆ emptyCodeSpanEnd()

static CodeSpan emptyCodeSpanEnd ( const CodeSpan previous)
inlinestatic

Create an empty code span equal to the end of the supplied code span.

Parameters
previousthe code span
Returns
an empty code span equal to the end of the supplied code span

◆ emptyCodeSpanStart()

static CodeSpan emptyCodeSpanStart ( const CodeSpan next)
inlinestatic

Create an empty code span equal to the start of the supplied code span.

Parameters
nextthe code span
Returns
an empty code span equal to the start of the supplied code span

◆ operator+=()

CodeSpan& operator+= ( const CodeSpan rhs)
inline

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.

Parameters
rhsthe code span to extend to
Returns
the current object

◆ operator<()

bool operator< ( const CodeSpan rhs) const
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.

◆ operator=() [1/2]

CodeSpan& operator= ( const CodeSpan rhs)
default

Copy assign the supplied code span to the current code span.

Parameters
rhsthe code span to assign from
Returns
the current object

◆ operator=() [2/2]

CodeSpan& operator= ( CodeSpan &&  rhs)
default

Move assign the supplied code span to the current code span.

Parameters
rhsthe code span to assign from
Returns
the current object

◆ operator==()

bool operator== ( const CodeSpan rhs) const
inline

Returns true if the current code span is equal to the supplied code span.

Parameters
rhsthe code span to compare
Returns
true if the current code span is equal to the supplied code span

◆ operator>()

bool operator> ( const CodeSpan rhs) const
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.

◆ totalCodeSpan()

static CodeSpan totalCodeSpan ( const CodeSpan start,
const CodeSpan end 
)
inlinestatic

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.

Parameters
startthe start code span
endthe end code span
Returns
a code span equal to the start of the first code span and the end of the end code span

Member Data Documentation

◆ end

The end position of the code span.

◆ start

CodePosition start

The start position of the code span.


The documentation for this class was generated from the following file: