CopperSpice API
1.9.2
|
The QSourceLocation class identifies a location in a resource by URI, line, and column. More...
Public Methods | |
QSourceLocation () | |
QSourceLocation (const QSourceLocation &other) | |
QSourceLocation (const QUrl &url, int line=-1, int column=-1) | |
~QSourceLocation () | |
qint64 | column () const |
bool | isNull () const |
qint64 | line () const |
bool | operator!= (const QSourceLocation &other) const |
QSourceLocation & | operator= (const QSourceLocation &other) |
bool | operator== (const QSourceLocation &other) const |
void | setColumn (qint64 newColumn) |
void | setLine (qint64 newLine) |
void | setUri (const QUrl &newUri) |
QUrl | uri () const |
Related Functions | |
These are not member functions | |
QDebug | operator<< (QDebug debug, const QSourceLocation &sourceLocation) |
uint | qHash (const QSourceLocation &location) |
The QSourceLocation class identifies a location in a resource by URI, line, and column. QSourceLocation is a simple value based class that has three properties, uri(), line(), and column(), that, taken together, identify a certain point in a resource, e.g., a file or an in-memory document.
The methods line() and column() refer to character counts (not byte counts), and they both start from 1 as opposed to 0.
QSourceLocation::QSourceLocation | ( | ) |
Construct a QSourceLocation that does not identify anything at all. For a default constructed QSourceLocation(), isNull() returns true
.
QSourceLocation::QSourceLocation | ( | const QSourceLocation & | other | ) |
Constructs a QSourceLocation that is a copy of other.
QSourceLocation::QSourceLocation | ( | const QUrl & | url, |
int | line = -1 , |
||
int | column = -1 |
||
) |
Constructs a QSourceLocation with url, line and column.
QSourceLocation::~QSourceLocation | ( | ) |
Destructor.
qint64 QSourceLocation::column | ( | ) | const |
Returns the current column number. The column number refers to the count of characters, not bytes. The first column is column 1, not 0. The default value is -1, indicating the column number is unknown.
bool QSourceLocation::isNull | ( | ) | const |
Returns true
if this QSourceLocation does not identify anything.
For a default constructed QSourceLocation, this function returns true
. The same applies for any other QSourceLocation whose uri() is invalid.
qint64 QSourceLocation::line | ( | ) | const |
Returns the current line number. The first line number is 1, not 0. The default value is -1, indicating the line number is unknown.
bool QSourceLocation::operator!= | ( | const QSourceLocation & | other | ) | const |
Returns the opposite of applying operator==() for this QXmlName and other.
QSourceLocation & QSourceLocation::operator= | ( | const QSourceLocation & | other | ) |
Assigns this QSourceLocation instance to other.
bool QSourceLocation::operator== | ( | const QSourceLocation & | other | ) | const |
void QSourceLocation::setColumn | ( | qint64 | newColumn | ) |
Sets the column number to newColumn. 0 is an invalid column number. The first column number is 1.
void QSourceLocation::setLine | ( | qint64 | newLine | ) |
Sets the line number to newLine. 0 is an invalid line number. The first line number is 1.
QUrl QSourceLocation::uri | ( | ) | const |
Returns the resource that this QSourceLocation refers to. For example, the resource could be a file in the local file system, if the URI scheme is file
.
Prints sourceLocation to the debug stream debug.