diff options
Diffstat (limited to 'src/qmlcompiler/qqmlsasourcelocation.cpp')
| -rw-r--r-- | src/qmlcompiler/qqmlsasourcelocation.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/qmlcompiler/qqmlsasourcelocation.cpp b/src/qmlcompiler/qqmlsasourcelocation.cpp index bc22d1b93a..021d2a0032 100644 --- a/src/qmlcompiler/qqmlsasourcelocation.cpp +++ b/src/qmlcompiler/qqmlsasourcelocation.cpp @@ -18,16 +18,45 @@ static_assert(SourceLocationPrivate::sizeOfSourceLocation() == sizeof(SourceLoca \brief Represents a location or region in the source code. */ + +/*! + Constructs a new SourceLocation with values given by \a offset, \a length, + \a line, and \a column. + */ QQmlSA::SourceLocation::SourceLocation(quint32 offset, quint32 length, quint32 line, quint32 column) { new (m_data) QQmlJS::SourceLocation{ offset, length, line, column }; } // explicitly defaulted out-of-line for PIMPL +/*! + Creates a copy of \a other. + */ QQmlSA::SourceLocation::SourceLocation(const SourceLocation &other) = default; + +/*! + \fn SourceLocation::SourceLocation(SourceLocation &&other) noexcept + Move-Constructs a SourceLocation from \a other. + */ + +/*! + Assigns \a other to this SourceLocation. + */ QQmlSA::SourceLocation & QQmlSA::SourceLocation::operator=(const QQmlSA::SourceLocation &other) = default; + +/*! + \fn SourceLocation &SourceLocation::operator=(SourceLocation &&other) noexcept + Move-assigns \a other to this SourceLocation. + */ + +/*! + Destructs this SourceLocation instance. + */ SourceLocation::~SourceLocation() = default; +/*! + Returns \c true is this SourceLocation is valid, \c false otherwise. + */ bool QQmlSA::SourceLocation::isValid() const { return QQmlSA::SourceLocationPrivate::sourceLocation(*this).isValid(); @@ -108,6 +137,23 @@ QQmlSA::SourceLocation QQmlSA::SourceLocation::endZeroLengthLocation(QStringView return saLocation; } +/*! + \fn friend qsizetype SourceLocation::qHash(const SourceLocation &location, qsizetype seed) + Returns the hash value for \a location, using \a seed to seed the calculation. + */ + +/*! + \fn friend bool SourceLocation::operator==(const SourceLocation &lhs, const SourceLocation &rhs) + Returns true if \a lhs equals \a rhs, and \c false otherwise. + Two SourceLocations are considered equal if they have the same values for + their offset, length, line, and column members. + */ +/*! + \fn friend bool SourceLocation::operator!=(const SourceLocation &lhs, const SourceLocation &rhs) + Returns true if \a lhs does not equal \a rhs, and \c false otherwise. + See \l {SourceLocation::operator==} for when two source locations are considered equal. + */ + qsizetype QQmlSA::SourceLocation::qHashImpl(const SourceLocation &location, qsizetype seed) { return qHash(QQmlSA::SourceLocationPrivate::sourceLocation(location), seed); |
