Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
|
This class sends a result or an error when going out of scope. More...
#include <qqmlbasemodule_p.h>
Public Member Functions | |
ResponseScopeGuard (Result &results, ResponseCallback &callback) | |
void | setError (const QQmlLSUtilsErrorMessage &error) |
template<typename... T> | |
bool | setErrorFrom (const std::variant< T... > &variant) |
bool | setErrorFrom (const std::optional< QQmlLSUtilsErrorMessage > &error) |
~ResponseScopeGuard () | |
Public Attributes | |
std::variant< Result *, QQmlLSUtilsErrorMessage > | m_response |
ResponseCallback & | m_callback |
This class sends a result or an error when going out of scope.
It has a helper method setErrorFrom
that sets an error from variant and optionals.
Definition at line 54 of file qqmlbasemodule_p.h.
|
inline |
Definition at line 61 of file qqmlbasemodule_p.h.
|
inline |
Definition at line 101 of file qqmlbasemodule_p.h.
References error, ResponseScopeGuard< Result, ResponseCallback >::m_callback, and ResponseScopeGuard< Result, ResponseCallback >::m_response.
|
inline |
Definition at line 67 of file qqmlbasemodule_p.h.
References error, and ResponseScopeGuard< Result, ResponseCallback >::m_response.
Referenced by QQmlDocumentFormatting::process(), QQmlHover::process(), QQmlRenameSymbolSupport::process(), ResponseScopeGuard< Result, ResponseCallback >::setErrorFrom(), and ResponseScopeGuard< Result, ResponseCallback >::setErrorFrom().
|
inline |
\internal Note: use it as follows: \badcode if (scopeGuard.setErrorFrom(xxx)) {
do early exit } xxx was not an error, continue
Definition at line 92 of file qqmlbasemodule_p.h.
References error, and ResponseScopeGuard< Result, ResponseCallback >::setError().
|
inline |
Definition at line 70 of file qqmlbasemodule_p.h.
References ResponseScopeGuard< Result, ResponseCallback >::setError(), and variant.
Referenced by QQmlFindUsagesSupport::process(), QmlGoToDefinitionSupport::process(), QmlGoToTypeDefinitionSupport::process(), and QQmlRenameSymbolSupport::process().
ResponseCallback& ResponseScopeGuard< Result, ResponseCallback >::m_callback |
Definition at line 59 of file qqmlbasemodule_p.h.
Referenced by ResponseScopeGuard< Result, ResponseCallback >::~ResponseScopeGuard().
std::variant<Result *, QQmlLSUtilsErrorMessage> ResponseScopeGuard< Result, ResponseCallback >::m_response |
Definition at line 58 of file qqmlbasemodule_p.h.
Referenced by ResponseScopeGuard< Result, ResponseCallback >::~ResponseScopeGuard(), and ResponseScopeGuard< Result, ResponseCallback >::setError().