7#include <QtCore/QCborMap>
8#include <QtCore/QMutex>
9#include <QtCore/QMutexLocker>
152 && (
res.location.startLine != 0 ||
res.location.startColumn != 0)) {
153 res.location.offset = -1;
154 res.location.length = 1;
175 if (!canonicalFilePath.
isEmpty()) {
176 sink(canonicalFilePath);
239 if (g1.size() < g2.size())
241 if (g1.size() < g2.size())
243 for (
int i = 0;
i < g1.size(); ++
i) {
244 int c = std::strcmp(g1.at(
i).groupId().data(), g2.at(
i).groupId().data());
254 if (
level == Level::Fatal)
263 if (
level == Level::Fatal)
306 bool doubleRegister =
false;
313 doubleRegister =
true;
340 s(u
"Unregistered error ");
386 if (
path.length() == 0)
387 path =
el.canonicalPath();
389 file =
el.canonicalFilePath();
428 if (
path.length()>0) {
528#include "moc_qqmldomerrormessage_p.cpp"
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
constexpr char toLatin1() const noexcept
Returns the Latin-1 character equivalent to the QChar, or 0.
static constexpr QChar fromLatin1(char c) noexcept
Converts the Latin-1 character c to its equivalent QChar.
constexpr bool isEmpty() const noexcept
A Sink is a function that accepts a QStringView as input.
void dumpId(Sink sink) const
QLatin1String groupId() const
void dump(Sink sink) const
QString groupName() const
Represents a set of tags grouping a set of related error messages.
ErrorMessage info(QString message) const
void dump(Sink sink) const
ErrorMessage warning(QString message) const
QVector< ErrorGroup > groups
void dumpId(Sink sink) const
static int cmp(const ErrorGroups &g1, const ErrorGroups &g2)
ErrorMessage debug(QString message) const
void fatal(Dumper msg, Path element=Path(), QStringView canonicalFilePath=u"", SourceLocation location=SourceLocation()) const
ErrorMessage errorMessage(Dumper msg, ErrorLevel level, Path element=Path(), QString canonicalFilePath=QString(), SourceLocation location=SourceLocation()) const
QCborArray toCbor() const
ErrorMessage error(QString message) const
Represents an error message connected to the dom.
ErrorMessage & withPath(const Path &)
ErrorMessage & withErrorId(QLatin1String errorId)
static void visitRegisteredMessages(function_ref< bool(ErrorMessage)> visitor)
ErrorMessage & withLocation(SourceLocation)
ErrorMessage handle(const ErrorHandler &errorHandler=nullptr)
static QLatin1String msg(const char *errorId, ErrorMessage err)
static ErrorMessage load(QLatin1String errorId)
ErrorMessage & withItem(DomItem)
ErrorMessage & withFile(QString)
ErrorMessage(QString message, ErrorGroups errorGroups, Level level=Level::Warning, Path path=Path(), QString file=QString(), SourceLocation location=SourceLocation(), QLatin1String errorId=QLatin1String(""))
Represents and maintains a mapping between elements and their location in a file.
static const FileLocations * fileLocationsOf(DomItem &)
void dump(Sink sink) const
const_iterator cbegin() const noexcept
constexpr bool isEmpty() const noexcept
Returns whether this string view is empty - that is, whether {size() == 0}.
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QSet< QString >::iterator it
void errorHandlerHandler(const ErrorMessage &msg, ErrorHandler *h=nullptr)
static QHash< QLatin1String, StorableMsg > & registry()
std::function< void(const ErrorMessage &)> ErrorHandler
void silentError(const ErrorMessage &)
Error handler that ignores all errors (excluding fatal ones)
void dumpErrorLevel(Sink s, ErrorLevel level)
Dumps a string describing the given error level (ErrorLevel::Error -> Error,...)
void errorToQDebug(const ErrorMessage &error)
writes an ErrorMessage to QDebug
ErrorLevel errorLevelFromQtMsgType(QtMsgType msgType)
static ErrorGroups myErrors()
void defaultErrorHandler(const ErrorMessage &error)
Calls the default error handler (by default errorToQDebug)
void sinkInt(Sink s, T i)
void setDefaultErrorHandler(ErrorHandler h)
Sets the default error handler.
QString dumperToString(Dumper writer)
Converts a dumper to a string.
static QBasicMutex * registryMutex()
void dumperToQDebug(Dumper dumper, QDebug debug)
Combined button and popup list for selecting options.
DBusConnection const char DBusError * error
#define Q_LOGGING_CATEGORY(name,...)
GLenum GLuint GLint level
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLsizei const GLchar * message
GLfloat GLfloat GLfloat GLfloat h
GLsizei const GLchar *const * path
GLsizei GLenum GLboolean sink
#define NewErrorGroup(name)
QLatin1StringView QLatin1String
#define QStringLiteral(str)
StorableMsg(const ErrorMessage &e)