Public Member Functions | Public Attributes | List of all members
CodePosition Class Reference

A position in a piece of multi-line text. More...

#include <CodeSpan.hpp>

Public Member Functions

 CodePosition ()
 Create a null code position (line and colunn equal to 0). More...
 
 CodePosition (unsigned int line_, unsigned int column_)
 Create a code position with the supplied line and colunn values. More...
 
 CodePosition (const CodePosition &copy)=default
 Create a code position by copying the supplied code position. More...
 
bool operator< (const CodePosition &rhs) const
 Does this code position come before the supplied code position? More...
 
CodePositionoperator= (const CodePosition &copy)=default
 Assign the code position by copying the supplied code position line and column values. More...
 
bool operator== (const CodePosition &rhs) const
 Is this code position equal to the supplied code position? More...
 
bool operator> (const CodePosition &rhs) const
 Does this code position come after the supplied code position? More...
 

Public Attributes

unsigned int column
 The column of the code position (1-indexed). More...
 
unsigned int line
 The line of the code position (1-indexed). More...
 

Detailed Description

A position in a piece of multi-line text.

The values are 1-indexed.

Constructor & Destructor Documentation

◆ CodePosition() [1/3]

CodePosition ( )
inline

Create a null code position (line and colunn equal to 0).

◆ CodePosition() [2/3]

CodePosition ( unsigned int  line_,
unsigned int  column_ 
)
inline

Create a code position with the supplied line and colunn values.

◆ CodePosition() [3/3]

CodePosition ( const CodePosition copy)
default

Create a code position by copying the supplied code position.

Member Function Documentation

◆ operator<()

bool operator< ( const CodePosition rhs) const
inline

Does this code position come before the supplied code position?

◆ operator=()

CodePosition& operator= ( const CodePosition copy)
default

Assign the code position by copying the supplied code position line and column values.

Returns
the current object

◆ operator==()

bool operator== ( const CodePosition rhs) const
inline

Is this code position equal to the supplied code position?

◆ operator>()

bool operator> ( const CodePosition rhs) const
inline

Does this code position come after the supplied code position?

Member Data Documentation

◆ column

unsigned int column

The column of the code position (1-indexed).

◆ line

unsigned int line

The line of the code position (1-indexed).


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