6 #ifndef SWIFT_MISC_STATUSMESSAGELIST_H
7 #define SWIFT_MISC_STATUSMESSAGELIST_H
Generic ordered container with value semantics.
A log category is an arbitrary string tag which can be attached to log messages.
A sequence of log categories.
Value object encapsulating a list of property indexes.
Generic sequential container with value semantics.
CSequence()=default
Default constructor.
Streamable status message, e.g.
Status messages, e.g. from Core -> GUI.
bool isFailure() const
Any message is marked as failure.
int keepLatest(int estimtatedNumber)
Keep latest n status messages.
CStatusMessage toSingleMessage() const
Merge into a single message.
void removeInfoAndBelow()
Remove info and below.
void addValidationMessage(const QString &validationText, CStatusMessage::StatusSeverity severity)
Convenience function to push back a validation message.
CStatusMessageList findBySeverity(CStatusMessage::StatusSeverity severity) const
Find by severity.
void addCategory(const CLogCategory &category)
Add a category to all messages in the list.
QString toHtml(const CPropertyIndexList &indexes=simpleHtmlOutput()) const
Specialized version to convert to HTML.
static const CPropertyIndexList & timestampHtmlOutput()
Properties for CStatusMessageList::toHtml.
CStatusMessage::StatusSeverity worstSeverity() const
Find worst severity.
static const CPropertyIndexList & simpleHtmlOutput()
Properties for CStatusMessageList::toHtml.
CStatusMessageList findByCategory(const CLogCategory &category) const
Find by type.
bool hasWarningOrErrorMessages() const
Warning or error messages.
void setCategories(const CLogCategoryList &categories)
Reset the categories of all messages in the list.
static const QString & htmlStyleSheet()
Default style sheet which can be used with CStatusMessageList::toHtml.
void addCategories(const CLogCategoryList &categories)
Add some categories to all messages in the list.
void removeSeverity(CStatusMessage::StatusSeverity severity)
Remove given severity.
CStatusMessageList getErrorMessages() const
Get all error messages.
bool hasWarningMessages() const
Warning messages.
CStatusMessageList(const CSequence< CStatusMessage > &other)
Construct from a base class object.
void addValidationCategory()
Validation category.
void removeWarningsAndBelow()
Remove warnings and below.
bool hasErrorMessages() const
Error messages.
void sortBySeverity()
Sort by severity, lowest first.
void clampSeverity(CStatusMessage::StatusSeverity severity)
And higher (more critical) severity will be clipped to given severity.
static CStatusMessageList fromDatabaseJson(const QJsonArray &array)
From our database JSON format.
bool isSuccess() const
All messages are marked as success.
CStatusMessageList()=default
Constructor.
void warningToError()
Turn warnings into errors.
CStatusMessageList(const CStatusMessage &statusMessage)
Construct from single message.
CStatusMessageList getWarningAndErrorMessages() const
Get all warning and error messages.
QMap< int, int > countSeverities() const
Count number of messages per severity.
void sortBySeverityHighestFirst()
Sort by severity, highest first.
void setCategory(const CLogCategory &category)
Reset the category of all messages in the list.
List of orderable IOrderable objects.
List of objects with timestamp. Such objects should implement.
Free functions in swift::misc.
StatusSeverity
Status severities.
#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...
#define SWIFT_MISC_EXPORT
Export a class or function from the library.