6 #ifndef SWIFT_MISC_JSONEXCEPTION_H
7 #define SWIFT_MISC_JSONEXCEPTION_H
18 class CLogCategoryList;
25 virtual void anchor();
29 explicit CJsonException(
const QString &message) : std::runtime_error(message.toStdString()) {}
35 QString toString(
const QString &prefix)
const;
38 static QString stackString();
40 QString m_stack = stackString();
54 CJsonScope(
const QString &name,
int index = -1) noexcept : m_index(index), m_string(&name) { push(); }
55 CJsonScope(QLatin1String name,
int index = -1) noexcept : m_index(index), m_latin1(name) { push(); }
74 void push() const noexcept;
75 void pop() const noexcept;
79 const QString *m_string =
nullptr;
80 QLatin1String m_latin1;
Thrown when a convertFromJson method encounters an unrecoverable error in JSON data.
const QString & getStackTrace() const
Get a stack trace of where in the JSON object tree the error occurred.
CJsonException(const QString &message)
Constructor.
Pseudo-RAII pattern that tracks the current JSON value being converted.
CJsonScope(const CJsonScope &)=delete
Not copyable.
CJsonScope(const char(&name)[N], int index=-1) noexcept
Construct a scope with the given name and optional index subscript.
CJsonScope(QLatin1String name, int index=-1) noexcept
Construct a scope with the given name and optional index subscript.
CJsonScope & operator=(const CJsonScope &)=delete
Not copyable.
CJsonScope(const QString &name, int index=-1) noexcept
Construct a scope with the given name and optional index subscript.
CJsonScope(const QString &&, int=-1)=delete
QString constructor argument must be an lvalue.
Free functions in swift::misc.
#define SWIFT_MISC_EXPORT
Export a class or function from the library.