Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QQmlSA::SourceLocation Class Reference

\inmodule QtQmlCompiler More...

#include <qqmlsasourcelocation.h>

Collaboration diagram for QQmlSA::SourceLocation:

Public Member Functions

 SourceLocation (quint32 offset=0, quint32 length=0, quint32 line=0, quint32 column=0)
 Constructs a new SourceLocation with values given by offset, length, line, and column.
 SourceLocation (const SourceLocation &)
 Creates a copy of other.
 SourceLocation (SourceLocation &&other) noexcept
 Move-Constructs a SourceLocation from other.
SourceLocationoperator= (const SourceLocation &)
 Assigns other to this SourceLocation.
SourceLocationoperator= (SourceLocation &&other) noexcept
 Move-assigns other to this SourceLocation.
 ~SourceLocation ()
 Destructs this SourceLocation instance.
bool isValid () const
 Returns true is this SourceLocation is valid, false otherwise.
quint32 begin () const
 Returns the offset of the beginning of this source location.
quint32 end () const
 Returns the offset of the end of this source location.
quint32 offset () const
 Returns the offset of the beginning of this source location.
quint32 length () const
 Returns the length of this source location.
quint32 startLine () const
 Returns the line number containing the beginning of this source location.
quint32 startColumn () const
 Returns the column number containing the beginning of this source location.
SourceLocation startZeroLengthLocation () const
 Returns a source location of lenth zero pointing to the beginning of this source location.
SourceLocation endZeroLengthLocation (QStringView text) const
 Returns a source location of lenth zero pointing to the end of this source location pointing to text.

Friends

class QT_PREPEND_NAMESPACE (QQmlSA::SourceLocationPrivate)
qsizetype qHash (const SourceLocation &location, qsizetype seed=0)
 Returns the hash value for location, using seed to seed the calculation.
bool operator== (const SourceLocation &lhs, const SourceLocation &rhs)
 Returns true if lhs equals rhs, and false otherwise.
bool operator!= (const SourceLocation &lhs, const SourceLocation &rhs)
 Returns true if lhs does not equal rhs, and false otherwise.

Detailed Description

\inmodule QtQmlCompiler

Represents a location or region in the source code.

Definition at line 22 of file qqmlsasourcelocation.h.

Constructor & Destructor Documentation

◆ SourceLocation() [1/3]

QQmlSA::SourceLocation::SourceLocation ( quint32 offset = 0,
quint32 length = 0,
quint32 line = 0,
quint32 column = 0 )
explicit

Constructs a new SourceLocation with values given by offset, length, line, and column.

Definition at line 27 of file qqmlsasourcelocation.cpp.

◆ SourceLocation() [2/3]

QQmlSA::SourceLocation::SourceLocation ( const SourceLocation & )
default

Creates a copy of other.

◆ SourceLocation() [3/3]

QQmlSA::SourceLocation::SourceLocation ( SourceLocation && other)
inlinenoexcept

Move-Constructs a SourceLocation from other.

Definition at line 30 of file qqmlsasourcelocation.h.

◆ ~SourceLocation()

QQmlSA::SourceLocation::~SourceLocation ( )
default

Destructs this SourceLocation instance.

Member Function Documentation

◆ begin()

quint32 QQmlSA::SourceLocation::begin ( ) const

Returns the offset of the beginning of this source location.

Definition at line 69 of file qqmlsasourcelocation.cpp.

◆ end()

quint32 QQmlSA::SourceLocation::end ( ) const

Returns the offset of the end of this source location.

Definition at line 77 of file qqmlsasourcelocation.cpp.

◆ endZeroLengthLocation()

QQmlSA::SourceLocation QQmlSA::SourceLocation::endZeroLengthLocation ( QStringView text) const

Returns a source location of lenth zero pointing to the end of this source location pointing to text.

Definition at line 132 of file qqmlsasourcelocation.cpp.

◆ isValid()

bool QQmlSA::SourceLocation::isValid ( ) const

Returns true is this SourceLocation is valid, false otherwise.

Definition at line 61 of file qqmlsasourcelocation.cpp.

◆ length()

quint32 QQmlSA::SourceLocation::length ( ) const

Returns the length of this source location.

Definition at line 93 of file qqmlsasourcelocation.cpp.

◆ offset()

quint32 QQmlSA::SourceLocation::offset ( ) const

Returns the offset of the beginning of this source location.

Definition at line 85 of file qqmlsasourcelocation.cpp.

◆ operator=() [1/2]

QQmlSA::SourceLocation & QQmlSA::SourceLocation::operator= ( const SourceLocation & )
default

Assigns other to this SourceLocation.

◆ operator=() [2/2]

SourceLocation & QQmlSA::SourceLocation::operator= ( SourceLocation && other)
inlinenoexcept

Move-assigns other to this SourceLocation.

Definition at line 36 of file qqmlsasourcelocation.h.

◆ startColumn()

quint32 QQmlSA::SourceLocation::startColumn ( ) const

Returns the column number containing the beginning of this source location.

Definition at line 109 of file qqmlsasourcelocation.cpp.

◆ startLine()

quint32 QQmlSA::SourceLocation::startLine ( ) const

Returns the line number containing the beginning of this source location.

Definition at line 101 of file qqmlsasourcelocation.cpp.

◆ startZeroLengthLocation()

QQmlSA::SourceLocation QQmlSA::SourceLocation::startZeroLengthLocation ( ) const

Returns a source location of lenth zero pointing to the beginning of this source location.

Definition at line 118 of file qqmlsasourcelocation.cpp.

◆ operator!=

bool operator!= ( const SourceLocation & lhs,
const SourceLocation & rhs )
friend

Returns true if lhs does not equal rhs, and false otherwise.

See \l {SourceLocation::operator==} for when two source locations are considered equal.

Definition at line 67 of file qqmlsasourcelocation.h.

◆ operator==

bool operator== ( const SourceLocation & lhs,
const SourceLocation & rhs )
friend

Returns true if lhs equals rhs, and false otherwise.

Two SourceLocations are considered equal if they have the same values for their offset, length, line, and column members.

Definition at line 62 of file qqmlsasourcelocation.h.

◆ qHash

qsizetype qHash ( const SourceLocation & location,
qsizetype seed = 0 )
friend

Returns the hash value for location, using seed to seed the calculation.

Definition at line 57 of file qqmlsasourcelocation.h.

◆ QT_PREPEND_NAMESPACE

class QT_PREPEND_NAMESPACE ( QQmlSA::SourceLocationPrivate )
friend

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