swift
Loading...
Searching...
No Matches
statusmessage.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (C) 2013 swift Project Community / Contributors
2// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
5
6#ifndef SWIFT_MISC_STATUSMESSAGE_H
7#define SWIFT_MISC_STATUSMESSAGE_H
8
9#include <QReadWriteLock>
10
14#include "misc/orderable.h"
16#include "misc/stringutils.h"
18#include "misc/timestampbased.h"
19#include "misc/typetraits.h"
20
22
23namespace swift::misc
24{
25 namespace private_ns
26 {
28 SWIFT_MISC_EXPORT QString arg(QStringView format, const QStringList &args);
29 } // namespace private_ns
30
35 {
36 SeverityDebug,
37 SeverityInfo,
38 SeverityWarning,
39 SeverityError
40 };
41
49 public mixin::MetaType<CStrongStringView>,
50 public mixin::EqualsByCompare<CStrongStringView>,
51 public mixin::LessThanByCompare<CStrongStringView>,
52 public mixin::DBusOperators<CStrongStringView>,
53 public mixin::DataStreamOperators<CStrongStringView>,
54 public mixin::JsonOperators<CStrongStringView>,
55 public mixin::String<CStrongStringView>
56 {
57 public:
59 CStrongStringView() = default;
60
62 template <size_t N>
63 CStrongStringView(const char16_t (&string)[N]) : m_view(string)
64 {}
65
67 CStrongStringView(const QString &string) : m_string(string), m_view(m_string) {}
68
70 explicit CStrongStringView(QStringView view) : m_view(view) {}
71
73 CStrongStringView(const char *) = delete;
74
76 CStrongStringView(const CStrongStringView &other) { *this = other; }
77
80 {
81 if (other.isOwning())
82 {
83 m_view = m_string = other.m_string;
84 }
85 else
86 {
87 m_view = other.m_view;
88 m_string.clear();
89 }
90 return *this;
91 }
92
94 ~CStrongStringView() = default;
95
97 bool isEmpty() const { return view().isEmpty(); }
98
100 bool isOwning() const { return !m_string.isNull(); } // important distinction between isNull and isEmpty
101
103 QStringView view() const { return m_view; }
104
106 QString convertToQString(bool i18n = false) const
107 {
108 Q_UNUSED(i18n);
109 return isOwning() ? m_string : m_view.toString();
110 }
111
113 friend int compare(const CStrongStringView &a, const CStrongStringView &b)
114 {
115 return a.m_view.compare(b.m_view);
116 }
117
119 friend size_t qHash(const CStrongStringView &obj, uint seed = 0) { return ::qHash(obj.m_view, seed); }
120
123 void marshallToDbus(QDBusArgument &arg) const { arg << toQString(); }
125 {
126 arg >> m_string;
127 m_view = m_string;
128 }
129
130
133 void marshalToDataStream(QDataStream &stream) const { stream << toQString(); }
135 {
136 stream >> m_string;
137 m_view = m_string;
138 }
139
140
144 {
145 QJsonObject json;
146 json.insert(QStringLiteral("value"), toQString());
147 return json;
148 }
149 void convertFromJson(const QJsonObject &json) { *this = json.value(QLatin1String("value")).toString(); }
151
152 private:
153 QString m_string;
154 QStringView m_view;
155 };
156
160 template <class Derived>
162 {
163 public:
165 CMessageBase() = default;
166
168 explicit CMessageBase(const CLogCategory &category) : m_categories({ category }) {}
169
171 explicit CMessageBase(const CLogCategoryList &categories) : m_categories(categories) {}
172
174 CMessageBase(const CLogCategoryList &categories, const CLogCategory &extra) : CMessageBase(categories)
175 {
176 this->addIfNotExisting(extra);
177 }
178
180 CMessageBase(const CLogCategoryList &categories, const CLogCategoryList &extra) : CMessageBase(categories)
181 {
182 this->addIfNotExisting(extra);
183 }
184
186 template <size_t N>
187 Derived &log(StatusSeverity s, const char16_t (&m)[N])
188 {
189 m_message = m;
190 m_severity = s;
191 return derived();
192 }
193
195 Derived &log(StatusSeverity s, const QString &m)
196 {
197 m_message = m;
198 m_severity = s;
199 return derived();
200 }
201
203 Derived &debug() { return log(SeverityDebug, QString()); }
204
206 template <size_t N>
207 Derived &debug(const char16_t (&format)[N])
208 {
209 return log(SeverityDebug, format);
210 }
211
213 Derived &debug(const QString &format) { return log(SeverityDebug, format); }
214
216 template <size_t N>
217 Derived &info(const char16_t (&format)[N])
218 {
219 return log(SeverityInfo, format);
220 }
221
223 Derived &info(const QString &format) { return log(SeverityInfo, format); }
224
226 template <size_t N>
227 Derived &warning(const char16_t (&format)[N])
228 {
229 return log(SeverityWarning, format);
230 }
231
233 Derived &warning(const QString &format) { return log(SeverityWarning, format); }
234
236 template <size_t N>
237 Derived &error(const char16_t (&format)[N])
238 {
239 return log(SeverityError, format);
240 }
241
243 Derived &error(const QString &format) { return log(SeverityError, format); }
244
246 template <size_t N>
247 Derived &validation(StatusSeverity s, const char16_t (&format)[N])
248 {
249 setValidation();
250 return log(s, format);
251 }
252
254 Derived &validation(StatusSeverity s, const QString &format)
255 {
256 setValidation();
257 return log(s, format);
258 }
259
261 template <size_t N>
262 Derived &validationInfo(const char16_t (&format)[N])
263 {
264 setValidation();
265 return log(SeverityInfo, format);
266 }
267
269 Derived &validationInfo(const QString &format)
270 {
271 setValidation();
272 return log(SeverityInfo, format);
273 }
274
276 template <size_t N>
277 Derived &validationWarning(const char16_t (&format)[N])
278 {
279 setValidation();
280 return log(SeverityWarning, format);
281 }
282
284 Derived &validationWarning(const QString &format)
285 {
286 setValidation();
287 return log(SeverityWarning, format);
288 }
289
291 template <size_t N>
292 Derived &validationError(const char16_t (&format)[N])
293 {
294 setValidation();
295 return log(SeverityError, format);
296 }
297
299 Derived &validationError(const QString &format)
300 {
301 setValidation();
302 return log(SeverityError, format);
303 }
304
307 Derived &log(StatusSeverity, const char *) = delete;
308 Derived &debug(const char *) = delete;
309 Derived &info(const char *) = delete;
310 Derived &warning(const char *) = delete;
311 Derived &error(const char *) = delete;
312 Derived &validation(StatusSeverity, const char *) = delete;
313 Derived &validationInfo(const char *) = delete;
314 Derived &validationWarning(const char *) = delete;
315 Derived &validationError(const char *) = delete;
317
322 template <class T>
323 Derived &operator<<(T v) requires(TParameter<std::decay_t<T>>::passBy == ParameterPassBy::Value)
324 {
325 return arg(TString<T>::toQString(v));
326 }
327
332 template <class T>
333 Derived &operator<<(const T &v) requires(TParameter<std::decay_t<T>>::passBy == ParameterPassBy::ConstRef)
334 {
335 return arg(TString<T>::toQString(v));
336 }
337
339 bool isEmpty() const { return this->m_message.isEmpty() && this->m_args.isEmpty(); }
340
341 private:
342 void setValidation()
343 {
346 }
347 Derived &arg(const QString &value)
348 {
349 m_args.push_back(value);
350 return derived();
351 }
352 Derived &derived() { return static_cast<Derived &>(*this); }
353
354 protected:
356 void addIfNotExisting(const CLogCategory &category)
357 {
358 if (this->m_categories.contains(category))
359 {
360 return;
361 }
362 this->m_categories.push_back(category);
363 }
364
366 void addIfNotExisting(const CLogCategoryList &categories)
367 {
368 if (this->m_categories.isEmpty())
369 {
370 this->m_categories.push_back(categories);
371 }
372 else
373 {
374 for (const CLogCategory &cat : categories)
375 {
376 this->addIfNotExisting(cat);
377 }
378 }
379 }
380
381 protected:
384
387
390
392 StatusSeverity m_severity = SeverityDebug;
393
395 QString message() const { return private_ns::arg(m_message.view(), m_args); }
396 };
397
402 public CValueObject<CStatusMessage>,
403 public CMessageBase<CStatusMessage>,
404 public ITimestampBased,
405 public IOrderable
406 {
407 public:
411 constexpr static auto SeverityDebug = swift::misc::SeverityDebug;
412 constexpr static auto SeverityInfo = swift::misc::SeverityInfo;
413 constexpr static auto SeverityWarning = swift::misc::SeverityWarning;
414 constexpr static auto SeverityError = swift::misc::SeverityError;
416
419 {
420 IndexCategoriesAsString = CPropertyIndexRef::GlobalIndexCStatusMessage,
421 IndexSeverity,
422 IndexSeverityAsString,
423 IndexSeverityAsIcon,
424 IndexMessage,
425 IndexMessageNoLineBreaks,
426 IndexMessageAsHtml
427 };
428
430 explicit CStatusMessage(const CLogCategory &category);
431
433 explicit CStatusMessage(const CLogCategoryList &categories);
434
436 CStatusMessage(const CLogCategoryList &categories, const CLogCategory &extra);
437
439 CStatusMessage(const CLogCategoryList &categories, const CLogCategoryList &extra);
440
443
445 CStatusMessage(const CStatusMessage &other);
446
448 CStatusMessage &operator=(const CStatusMessage &other);
449
451 ~CStatusMessage() = default;
452
455 template <size_t N>
457 {}
458 CStatusMessage(const QString &message);
459 template <size_t N>
460 CStatusMessage(StatusSeverity severity, const char16_t (&message)[N])
462 {}
463 CStatusMessage(StatusSeverity severity, const QString &message);
465
468 template <size_t N>
469 CStatusMessage(const CLogCategoryList &categories, StatusSeverity severity, const char16_t (&message)[N],
470 bool validation = false)
471 : CStatusMessage(categories, severity, QStringView(message), validation)
472 {}
473 CStatusMessage(const CLogCategoryList &categories, StatusSeverity severity, const QString &message,
474 bool validation = false);
476
480 explicit CStatusMessage(const char *message) = delete;
481 explicit CStatusMessage(StatusSeverity severity, const char *message) = delete;
482 explicit CStatusMessage(const CLogCategoryList &categories, StatusSeverity severity, const char *message,
483 bool validation = false) = delete;
485
488 CStatusMessage(QtMsgType type, const QMessageLogContext &context, const QString &message);
489
492 void toQtLogTriple(QtMsgType *o_type, QString *o_category, QString *o_message) const;
493
495 const CLogCategoryList &getCategories() const { return this->m_categories; }
496
498 QString getCategoriesAsString() const;
499
502
504 StatusSeverity getSeverity() const { return this->m_severity; }
505
507 bool clampSeverity(StatusSeverity severity);
508
511 {
512 return this->m_severity == SeverityInfo || this->m_severity == SeverityDebug;
513 }
514
516 bool isSeverityHigherOrEqual(CStatusMessage::StatusSeverity severity) const;
517
519 bool isWarningOrAbove() const
520 {
521 return this->m_severity == SeverityWarning || this->m_severity == SeverityError;
522 }
523
525 bool isSuccess() const;
526
528 bool isFailure() const;
529
531 QString getMessage() const { return this->message(); }
532
534 QString getMessageNoLineBreaks() const;
535
537 void prependMessage(const QString &msg);
538
540 void appendMessage(const QString &msg);
541
543 template <class T>
544 bool isFromClass(const T *pointer = nullptr) const
545 {
546 CLogCategoryList classCategories(pointer);
547 return std::all_of(classCategories.begin(), classCategories.end(),
548 [this](const CLogCategory &cat) { return m_categories.contains(cat); });
549 }
550
552 void markAsHandledBy(const QObject *object) const;
553
555 bool wasHandledBy(const QObject *object) const;
556
558 void setSeverity(StatusSeverity severity) { this->m_severity = severity; }
559
561 void addCategory(const CLogCategory &category) { this->addIfNotExisting(category); }
562
565
567 void addCategories(const CLogCategoryList &categories) { this->addIfNotExisting(categories); }
568
570 void setCategory(const CLogCategory &category) { this->m_categories = CLogCategoryList { category }; }
571
573 void setCategories(const CLogCategoryList &categories) { this->m_categories = categories; }
574
576 CIcons::IconIndex toIcon() const { return convertToIcon(*this).getIndex(); }
577
579 const QString &getSeverityAsString() const;
580
582 const CIcon &getSeverityAsIcon() const;
583
585 static const QString &severityToString(StatusSeverity severity);
586
588 static QString severitiesToString(const QSet<StatusSeverity> &severities);
589
591 static StatusSeverity stringToSeverity(const QString &severity);
592
594 static const QStringList &allSeverityStrings();
595
597 QVariant propertyByIndex(swift::misc::CPropertyIndexRef index) const;
598
600 void setPropertyByIndex(swift::misc::CPropertyIndexRef index, const QVariant &variant);
601
603 int comparePropertyByIndex(CPropertyIndexRef index, const CStatusMessage &compareValue) const;
604
606 QString convertToQString(bool i18n = false) const;
607
609 QString toHtml(bool withIcon, bool withColors) const;
610
612 static const CIcon &convertToIcon(const CStatusMessage &statusMessage);
613
615 static const CIcon &convertToIcon(CStatusMessage::StatusSeverity severity);
616
618 static const QString &convertToIconResource(CStatusMessage::StatusSeverity severity);
619
621 static CStatusMessage fromDatabaseJson(const QJsonObject &json);
622
624 static CStatusMessage fromJsonException(const CJsonException &ex, const CLogCategoryList &categories,
625 const QString &prefix);
626
628 static void registerMetadata();
629
630 private:
632 CStatusMessage(StatusSeverity severity, QStringView message);
633 CStatusMessage(const CLogCategoryList &categories, StatusSeverity severity, QStringView message,
634 bool validation);
635
636 mutable QVector<quintptr> m_handledByObjects;
637 mutable QReadWriteLock m_lock;
638
643 SWIFT_METAMEMBER(categories),
644 SWIFT_METAMEMBER(severity),
645 SWIFT_METAMEMBER(message),
646 SWIFT_METAMEMBER(args),
648 SWIFT_METAMEMBER(timestampMSecsSinceEpoch, 0, DisabledForHashing | DisabledForComparison));
649 };
650
651 // CContainerBase methods implemented out-of-line to avoid circular include
652 template <class Derived>
654 const CLogCategoryList &categories,
655 const QString &prefix)
656 {
657 try
658 {
659 convertFromJson(json);
660 }
661 catch (const CJsonException &ex)
662 {
663 return CStatusMessage::fromJsonException(ex, categories, prefix);
664 }
665 return {};
666 }
667
669 template <class Derived>
671 const CLogCategoryList &categories,
672 const QString &prefix)
673 {
674 try
675 {
676 convertFromJson(jsonString);
677 }
678 catch (const CJsonException &ex)
679 {
680 return CStatusMessage::fromJsonException(ex, categories, prefix);
681 }
682 return {};
683 }
684} // namespace swift::misc
685
686Q_DECLARE_METATYPE(swift::misc::CStrongStringView)
687Q_DECLARE_METATYPE(swift::misc::CStatusMessage)
689
690#endif // SWIFT_MISC_STATUSMESSAGE_H
void convertFromJson(const QJsonObject &json)
Assign from JSON object.
CStatusMessage convertFromJsonNoThrow(const QJsonObject &json, const CLogCategoryList &categories, const QString &prefix)
Call convertFromJson, catch any CJsonException that is thrown and return it as CStatusMessage.
Value object for icons. An icon is stored in the global icon repository and identified by its index....
Definition icon.h:39
IconIndex
Index for each icon, allows to send them via DBus, efficiently store them, etc.
Definition icons.h:32
Thrown when a convertFromJson method encounters an unrecoverable error in JSON data.
static const QString & uncategorized()
Uncategorized.
static const QString & validation()
Validation.
A log category is an arbitrary string tag which can be attached to log messages.
Definition logcategory.h:28
A sequence of log categories.
Derived & validationInfo(const char *)=delete
Deleted methods to avoid accidental implicit conversion from Latin-1 or UTF-8 string literals.
CLogCategoryList m_categories
Private.
Derived & debug(const char *)=delete
Deleted methods to avoid accidental implicit conversion from Latin-1 or UTF-8 string literals.
Derived & validationError(const char16_t(&format)[N])
Set the severity to error, providing a format string, and adding the validation category.
bool isEmpty() const
Message empty.
Derived & error(const char *)=delete
Deleted methods to avoid accidental implicit conversion from Latin-1 or UTF-8 string literals.
CMessageBase(const CLogCategoryList &categories, const CLogCategory &extra)
Construct a message with some specific categories.
CMessageBase(const CLogCategoryList &categories, const CLogCategoryList &extra)
Construct a message with some specific categories.
Derived & validation(StatusSeverity, const char *)=delete
Deleted methods to avoid accidental implicit conversion from Latin-1 or UTF-8 string literals.
Derived & debug()
Set the severity to debug.
Derived & validationInfo(const QString &format)
Set the severity to info, providing a format string, and adding the validation category.
Derived & validationWarning(const char16_t(&format)[N])
Set the severity to warning, providing a format string, and adding the validation category.
Derived & validationWarning(const QString &format)
Set the severity to warning, providing a format string, and adding the validation category.
Derived & warning(const char16_t(&format)[N])
Set the severity to warning, providing a format string.
Derived & validation(StatusSeverity s, const char16_t(&format)[N])
Set the severity to s, providing a format string, and adding the validation category.
Derived & operator<<(T v)
Streaming operators.
CStrongStringView m_message
Private.
Derived & validation(StatusSeverity s, const QString &format)
Set the severity to s, providing a format string, and adding the validation category.
Derived & info(const char *)=delete
Deleted methods to avoid accidental implicit conversion from Latin-1 or UTF-8 string literals.
void addIfNotExisting(const CLogCategory &category)
Add category if not already existing.
Derived & debug(const char16_t(&format)[N])
Set the severity to debug, providing a format string.
QStringList m_args
Private.
StatusSeverity m_severity
Private.
Derived & error(const char16_t(&format)[N])
Set the severity to error, providing a format string.
Derived & log(StatusSeverity s, const QString &m)
Set the severity and format string.
Derived & validationWarning(const char *)=delete
Deleted methods to avoid accidental implicit conversion from Latin-1 or UTF-8 string literals.
CMessageBase(const CLogCategoryList &categories)
Construct a message with some specific categories.
Derived & warning(const char *)=delete
Deleted methods to avoid accidental implicit conversion from Latin-1 or UTF-8 string literals.
void addIfNotExisting(const CLogCategoryList &categories)
Add categories if not already existing.
Derived & info(const QString &format)
Set the severity to info, providing a format string.
Derived & operator<<(const T &v)
Streaming operators.
CMessageBase(const CLogCategory &category)
Construct a message with some specific category.
Derived & validationError(const char *)=delete
Deleted methods to avoid accidental implicit conversion from Latin-1 or UTF-8 string literals.
Derived & info(const char16_t(&format)[N])
Set the severity to info, providing a format string.
Derived & warning(const QString &format)
Set the severity to warning, providing a format string.
Derived & debug(const QString &format)
Set the severity to debug, providing a format string.
QString message() const
Private.
Derived & log(StatusSeverity s, const char16_t(&m)[N])
Set the severity and format string.
Derived & log(StatusSeverity, const char *)=delete
Deleted methods to avoid accidental implicit conversion from Latin-1 or UTF-8 string literals.
Derived & error(const QString &format)
Set the severity to error, providing a format string.
Derived & validationError(const QString &format)
Set the severity to error, providing a format string, and adding the validation category.
CMessageBase()=default
Default constructor.
Derived & validationInfo(const char16_t(&format)[N])
Set the severity to info, providing a format string, and adding the validation category.
Non-owning reference to a CPropertyIndex with a subset of its features.
iterator begin()
Returns iterator at the beginning of the sequence.
Definition sequence.h:163
int remove(const T &object)
Remove all elements equal to the given object, if it is contained.
Definition sequence.h:447
iterator end()
Returns iterator one past the end of the sequence.
Definition sequence.h:172
Streamable status message, e.g.
void setCategory(const CLogCategory &category)
Reset category.
bool isWarningOrAbove() const
Warning or above.
static CStatusMessage fromJsonException(const CJsonException &ex, const CLogCategoryList &categories, const QString &prefix)
Object from JSON exception message.
CStatusMessage(const char16_t(&message)[N])
Constructor.
bool isSeverityInfoOrLess() const
Info or debug, no warning or error.
bool isFromClass(const T *pointer=nullptr) const
Returns true if this message was sent by an instance of class T.
static constexpr auto SeverityInfo
Status severities.
static constexpr auto SeverityError
Status severities.
void addCategories(const CLogCategoryList &categories)
Add categories, avoids duplicates.
CStatusMessage(const CLogCategory &category)
Construct a message with some specific category.
void toQtLogTriple(QtMsgType *o_type, QString *o_category, QString *o_message) const
Convert to a Qt logging triple.
void addValidationCategory()
Adds validation as category.
CStatusMessage(const CLogCategoryList &categories, StatusSeverity severity, const char *message, bool validation=false)=delete
Deleted constructor, to prevent inefficient construction from byte string literal....
static const CIcon & convertToIcon(const CStatusMessage &statusMessage)
Representing icon.
StatusSeverity getSeverity() const
Message severity.
void setSeverity(StatusSeverity severity)
Severity.
QString getMessage() const
Message.
CStatusMessage(const CLogCategoryList &categories, StatusSeverity severity, const char16_t(&message)[N], bool validation=false)
Constructor, also a validation messsage can be directly created.
void addCategory(const CLogCategory &category)
Add category, avoids duplicates.
CStatusMessage(StatusSeverity severity, const char16_t(&message)[N])
Constructor.
ColumnIndex
Properties by index.
const CLogCategoryList & getCategories() const
Message categories.
CStatusMessage(StatusSeverity severity, const char *message)=delete
Deleted constructor, to prevent inefficient construction from byte string literal....
CIcons::IconIndex toIcon() const
Representing icon.
swift::misc::StatusSeverity StatusSeverity
Status severities.
void setCategories(const CLogCategoryList &categories)
Reset categories.
QString getHumanOrTechnicalCategoriesAsString() const
The human or technical categories.
CStatusMessage(const char *message)=delete
Deleted constructor, to prevent inefficient construction from byte string literal....
static constexpr auto SeverityDebug
Status severities.
~CStatusMessage()=default
Destructor.
static constexpr auto SeverityWarning
Status severities.
Special-purpose string class used by CMessageBase.
CStrongStringView(const char16_t(&string)[N])
Construct from a UTF-16 character array.
QStringView view() const
Return as a QStringView.
friend int compare(const CStrongStringView &a, const CStrongStringView &b)
Compare two strings.
void unmarshallFromDbus(const QDBusArgument &arg)
DBus marshalling.
CStrongStringView(const QString &string)
Construct from a QString.
void convertFromJson(const QJsonObject &json)
JSON conversion.
friend size_t qHash(const CStrongStringView &obj, uint seed=0)
Hash value.
CStrongStringView(QStringView view)
Construct from a QStringView. Explicit because it could be dangerous if used without care.
void marshallToDbus(QDBusArgument &arg) const
DBus marshalling.
bool isEmpty() const
String is empty.
QString convertToQString(bool i18n=false) const
Return a copy as a QString.
QJsonObject toJson() const
JSON conversion.
CStrongStringView & operator=(const CStrongStringView &other)
Copy assignment operator.
CStrongStringView(const CStrongStringView &other)
Copy constructor.
void marshalToDataStream(QDataStream &stream) const
QDataStream marshalling.
bool isOwning() const
Does it own its string data?
CStrongStringView()=default
Default constructor.
~CStrongStringView()=default
Destructor.
void unmarshalFromDataStream(QDataStream &stream)
QDataStream marshalling.
CStrongStringView(const char *)=delete
Deleted constructor.
IOrderable()=default
Constructor.
ITimestampBased()=default
Constructor.
CRTP class template which will generate marshalling operators for a derived class with its own marsha...
Definition mixindbus.h:39
CRTP class template to generate non-member QDataStream streaming operators.
CRTP class template from which a derived class can inherit operator== implemented using its compare f...
CRTP class template which will generate marshalling operators for a derived class with its own marsha...
Definition mixinjson.h:37
CRTP class template from which a derived class can inherit operator< implemented using its compare fu...
CRTP class template from which a derived class can inherit common methods dealing with the metatype o...
CRTP class template from which a derived class can inherit string streaming operations.
Definition mixinstring.h:29
QString toQString(bool i18n=false) const
Definition mixinstring.h:74
#define SWIFT_METAMEMBER(MEMBER,...)
Macro to define an element within a metaclass.
Definition metaclass.h:72
#define SWIFT_METACLASS(CLASS,...)
Macro to define a nested metaclass that describes the attributes of its enclosing class.
Definition metaclass.h:52
@ DisabledForComparison
Element will be ignored by compare() and comparison operators.
Definition metaclass.h:200
@ DisabledForHashing
Element will be ignored by qHash().
Definition metaclass.h:203
Free functions in swift::misc.
void registerMetadata()
Register all relevant metadata in Misc.
StatusSeverity
Status severities.
QJsonObject::iterator insert(QLatin1StringView key, const QJsonValue &value)
void push_back(QList< T >::parameter_type value)
int compare(QChar ch) const const
bool isEmpty() const const
Trait to detect properties of function parameter types.
Definition typetraits.h:46
Stringification traits class.
#define SWIFT_MISC_EXPORT
Export a class or function from the library.
#define SWIFT_DECLARE_VALUEOBJECT_MIXINS(Namespace, Class)
Explicit template declaration of mixins for a CValueObject subclass to be placed near the top of the ...
Definition valueobject.h:65