6#ifndef SWIFT_MISC_LOGCATEGORYLIST_H
7#define SWIFT_MISC_LOGCATEGORYLIST_H
9#include <initializer_list>
94 QString toQString(
bool i18n =
false)
const;
103 bool anyStartWith(
const QString &prefix)
const;
106 bool anyEndWith(
const QString &suffix)
const;
112 QString convertToQString(
bool i18n =
false)
const;
115 template <
typename T>
118 static_assert(
sizeof(T) > 0,
"T must be a complete type, not forward declared");
119 static const auto staticList = [] {
123 list.
push_back(fromQStringList(T::getLogCategories()));
129 if constexpr (std::is_base_of_v<QObject, T>)
131 list.appendCategoriesFromMetaObject(T::staticMetaObject);
135 auto list = staticList;
136 if constexpr (std::is_base_of_v<QObject, T>)
140 list.appendCategoriesFromMetaObject(*ptr->metaObject(), T::staticMetaObject);
149 return { CLogCategories::uncategorized() };
154 void appendCategoriesFromMetaObject(
const QMetaObject &,
const QMetaObject &super = QObject::staticMetaObject);
Generic ordered container with value semantics.
static const QString & validation()
Validation.
A log category is an arbitrary string tag which can be attached to log messages.
A sequence of log categories.
CLogCategoryList with(const CLogCategoryList &other) const
Return a copy with some other categories appended.
CLogCategoryList()=default
Empty constructor.
CLogCategoryList withValidation() const
Return a copy with validation category appended.
CLogCategoryList(const CLogCategory &category)
By single element.
CLogCategoryList(const CSequence< CLogCategory > &other)
Copy construct from superclass instance.
CLogCategoryList(std::nullptr_t)=delete
Prevent accidental use of the initializer list constructor.
CLogCategoryList(const T *pointer)
Construct by extracting categories from a class T.
CLogCategoryList with(const CLogCategory &other) const
Return a copy with another category appended.
CSequence()=default
Default constructor.
void push_back(const CLogCategory &value)
bool isEmpty() const
Synonym for empty.
Free functions in swift::misc.
void registerMetadata()
Register all relevant metadata in Misc.
#define SWIFT_DECLARE_SEQUENCE_MIXINS(Namespace, T, List)
Explicit template declaration of mixins for a CSequence subclass to be placed near the top of the hea...
Trait to detect whether a class T has a static member function named getLogCategories.
#define SWIFT_MISC_EXPORT
Export a class or function from the library.