A character position inside a text/string that is being evaluated. More...
#include <elamvalue.h>
Public Member Functions | |
Position (const QPair< int, int > &p) | |
converts a pair of ints to a position More... | |
Position (const QPoint &p) | |
converts a QPoint to a position - x is interpreted as column, y as line More... | |
Position (int line, int col) | |
instantiates a position from line and column More... | |
Position (int col) | |
instantiates a position from column only, line is assumed to be "1" More... | |
Position () | |
instantiates an invalid position More... | |
Position (const Position &p) | |
copy constructor More... | |
Position & | operator= (const Position &p) |
copies a position More... | |
int | line () const |
returns the line of this position or -1 if the position is invalid More... | |
int | column () const |
returns the column of this position or -1 if the position is invalid More... | |
bool | isValid () const |
true if this position is valid More... | |
operator QPair< int, int > () const | |
transparently converts to a pair of ints More... | |
operator QPoint () const | |
transparently converts to a QPoint, with x=column and y=line More... | |
operator QString () const | |
converts to a human readable QString More... | |
A character position inside a text/string that is being evaluated.
A position consists of line and column. The top left position in a text is assumed to be line 1 column 1. Any position with line and/or column less than zero is considered invalid.
This class is completely inline and as such should be quite fast.
|
inline |
converts a pair of ints to a position
|
inline |
converts a QPoint to a position - x is interpreted as column, y as line
|
inline |
instantiates a position from line and column
|
inline |
instantiates a position from column only, line is assumed to be "1"
|
inline |
instantiates an invalid position
|
inline |
copy constructor
|
inline |
returns the column of this position or -1 if the position is invalid
|
inline |
true if this position is valid
|
inline |
returns the line of this position or -1 if the position is invalid
|
inline |
transparently converts to a pair of ints
|
inline |
transparently converts to a QPoint, with x=column and y=line
|
inlineexplicit |
converts to a human readable QString