swift
Loading...
Searching...
No Matches
swift::misc::CMessageBase< Derived > Class Template Reference

Base class for CStatusMessage and CLogMessage. More...

#include <statusmessage.h>

Public Member Functions

 CMessageBase ()=default
 Default constructor.
 CMessageBase (const CLogCategory &category)
 Construct a message with some specific category.
 CMessageBase (const CLogCategoryList &categories)
 Construct a message with some specific categories.
 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.
template<size_t N>
Derived & log (StatusSeverity s, const char16_t(&m)[N])
 Set the severity and format string.
Derived & log (StatusSeverity s, const QString &m)
 Set the severity and format string.
Derived & debug ()
 Set the severity to debug.
template<size_t N>
Derived & debug (const char16_t(&format)[N])
 Set the severity to debug, providing a format string.
Derived & debug (const QString &format)
 Set the severity to debug, providing a format string.
template<size_t N>
Derived & info (const char16_t(&format)[N])
 Set the severity to info, providing a format string.
Derived & info (const QString &format)
 Set the severity to info, providing a format string.
template<size_t N>
Derived & warning (const char16_t(&format)[N])
 Set the severity to warning, providing a format string.
Derived & warning (const QString &format)
 Set the severity to warning, providing a format string.
template<size_t N>
Derived & error (const char16_t(&format)[N])
 Set the severity to error, providing a format string.
Derived & error (const QString &format)
 Set the severity to error, providing a format string.
template<size_t N>
Derived & validation (StatusSeverity s, const char16_t(&format)[N])
 Set the severity to s, providing a format string, and adding the validation category.
Derived & validation (StatusSeverity s, const QString &format)
 Set the severity to s, providing a format string, and adding the validation category.
template<size_t N>
Derived & validationInfo (const char16_t(&format)[N])
 Set the severity to info, providing a format string, and adding the validation category.
Derived & validationInfo (const QString &format)
 Set the severity to info, providing a format string, and adding the validation category.
template<size_t N>
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.
template<size_t N>
Derived & validationError (const char16_t(&format)[N])
 Set the severity to error, providing a format string, and adding the validation category.
Derived & validationError (const QString &format)
 Set the severity to error, providing a format string, and adding the validation category.
template<class T>
requires (TParameter<std::decay_t<T>>::passBy == ParameterPassBy::Value)
Derived & operator<< (T v)
 Streaming operators.
template<class T>
requires (TParameter<std::decay_t<T>>::passBy == ParameterPassBy::ConstRef)
Derived & operator<< (const T &v)
 Streaming operators.
bool isEmpty () const
 Message empty.
Derived & log (StatusSeverity, const char *)=delete
 Deleted methods to avoid accidental implicit conversion from Latin-1 or UTF-8 string literals.
Derived & debug (const char *)=delete
 Deleted methods to avoid accidental implicit conversion from Latin-1 or UTF-8 string literals.
Derived & info (const char *)=delete
 Deleted methods to avoid accidental implicit conversion from Latin-1 or UTF-8 string literals.
Derived & warning (const char *)=delete
 Deleted methods to avoid accidental implicit conversion from Latin-1 or UTF-8 string literals.
Derived & error (const char *)=delete
 Deleted methods to avoid accidental implicit conversion from Latin-1 or UTF-8 string literals.
Derived & validation (StatusSeverity, const char *)=delete
 Deleted methods to avoid accidental implicit conversion from Latin-1 or UTF-8 string literals.
Derived & validationInfo (const char *)=delete
 Deleted methods to avoid accidental implicit conversion from Latin-1 or UTF-8 string literals.
Derived & validationWarning (const char *)=delete
 Deleted methods to avoid accidental implicit conversion from Latin-1 or UTF-8 string literals.
Derived & validationError (const char *)=delete
 Deleted methods to avoid accidental implicit conversion from Latin-1 or UTF-8 string literals.

Protected Member Functions

void addIfNotExisting (const CLogCategory &category)
 Add category if not already existing.
void addIfNotExisting (const CLogCategoryList &categories)
 Add categories if not already existing.
QString message () const
 Private.

Protected Attributes

CStrongStringView m_message
 Private.
QStringList m_args
 Private.
CLogCategoryList m_categories = CLogCategoryList { CLogCategories::uncategorized() }
 Private.
StatusSeverity m_severity = SeverityDebug
 Private.

Detailed Description

template<class Derived>
class swift::misc::CMessageBase< Derived >

Base class for CStatusMessage and CLogMessage.

Definition at line 161 of file statusmessage.h.

Constructor & Destructor Documentation

◆ CMessageBase() [1/4]

template<class Derived>
swift::misc::CMessageBase< Derived >::CMessageBase ( const CLogCategory & category)
inlineexplicit

Construct a message with some specific category.

Definition at line 168 of file statusmessage.h.

◆ CMessageBase() [2/4]

template<class Derived>
swift::misc::CMessageBase< Derived >::CMessageBase ( const CLogCategoryList & categories)
inlineexplicit

Construct a message with some specific categories.

Definition at line 171 of file statusmessage.h.

◆ CMessageBase() [3/4]

template<class Derived>
swift::misc::CMessageBase< Derived >::CMessageBase ( const CLogCategoryList & categories,
const CLogCategory & extra )
inline

Construct a message with some specific categories.

Definition at line 174 of file statusmessage.h.

◆ CMessageBase() [4/4]

template<class Derived>
swift::misc::CMessageBase< Derived >::CMessageBase ( const CLogCategoryList & categories,
const CLogCategoryList & extra )
inline

Construct a message with some specific categories.

Definition at line 180 of file statusmessage.h.

Member Function Documentation

◆ addIfNotExisting() [1/2]

template<class Derived>
void swift::misc::CMessageBase< Derived >::addIfNotExisting ( const CLogCategory & category)
inlineprotected

Add category if not already existing.

Definition at line 356 of file statusmessage.h.

◆ addIfNotExisting() [2/2]

template<class Derived>
void swift::misc::CMessageBase< Derived >::addIfNotExisting ( const CLogCategoryList & categories)
inlineprotected

Add categories if not already existing.

Definition at line 366 of file statusmessage.h.

◆ debug() [1/3]

template<class Derived>
Derived & swift::misc::CMessageBase< Derived >::debug ( )
inline

Set the severity to debug.

Definition at line 203 of file statusmessage.h.

◆ debug() [2/3]

template<class Derived>
template<size_t N>
Derived & swift::misc::CMessageBase< Derived >::debug ( const char16_t(&) format[N])
inline

Set the severity to debug, providing a format string.

Definition at line 207 of file statusmessage.h.

◆ debug() [3/3]

template<class Derived>
Derived & swift::misc::CMessageBase< Derived >::debug ( const QString & format)
inline

Set the severity to debug, providing a format string.

Definition at line 213 of file statusmessage.h.

◆ error() [1/2]

template<class Derived>
template<size_t N>
Derived & swift::misc::CMessageBase< Derived >::error ( const char16_t(&) format[N])
inline

Set the severity to error, providing a format string.

Definition at line 237 of file statusmessage.h.

◆ error() [2/2]

template<class Derived>
Derived & swift::misc::CMessageBase< Derived >::error ( const QString & format)
inline

Set the severity to error, providing a format string.

Definition at line 243 of file statusmessage.h.

◆ info() [1/2]

template<class Derived>
template<size_t N>
Derived & swift::misc::CMessageBase< Derived >::info ( const char16_t(&) format[N])
inline

Set the severity to info, providing a format string.

Definition at line 217 of file statusmessage.h.

◆ info() [2/2]

template<class Derived>
Derived & swift::misc::CMessageBase< Derived >::info ( const QString & format)
inline

Set the severity to info, providing a format string.

Definition at line 223 of file statusmessage.h.

◆ isEmpty()

template<class Derived>
bool swift::misc::CMessageBase< Derived >::isEmpty ( ) const
inline

Message empty.

Definition at line 339 of file statusmessage.h.

◆ log() [1/2]

template<class Derived>
template<size_t N>
Derived & swift::misc::CMessageBase< Derived >::log ( StatusSeverity s,
const char16_t(&) m[N] )
inline

Set the severity and format string.

Definition at line 187 of file statusmessage.h.

◆ log() [2/2]

template<class Derived>
Derived & swift::misc::CMessageBase< Derived >::log ( StatusSeverity s,
const QString & m )
inline

Set the severity and format string.

Definition at line 195 of file statusmessage.h.

◆ message()

template<class Derived>
QString swift::misc::CMessageBase< Derived >::message ( ) const
inlineprotected

Private.

Definition at line 395 of file statusmessage.h.

◆ operator<<() [1/2]

template<class Derived>
template<class T>
requires (TParameter<std::decay_t<T>>::passBy == ParameterPassBy::ConstRef)
Derived & swift::misc::CMessageBase< Derived >::operator<< ( const T & v)
inline

Streaming operators.

If the format string is empty, the message will consist of all streamed values separated by spaces. Otherwise, the streamed values will replace the place markers %1, %2, %3... in the format string.

See also
QString::arg

Definition at line 333 of file statusmessage.h.

◆ operator<<() [2/2]

template<class Derived>
template<class T>
requires (TParameter<std::decay_t<T>>::passBy == ParameterPassBy::Value)
Derived & swift::misc::CMessageBase< Derived >::operator<< ( T v)
inline

Streaming operators.

If the format string is empty, the message will consist of all streamed values separated by spaces. Otherwise, the streamed values will replace the place markers %1, %2, %3... in the format string.

See also
QString::arg

Definition at line 323 of file statusmessage.h.

◆ validation() [1/2]

template<class Derived>
template<size_t N>
Derived & swift::misc::CMessageBase< Derived >::validation ( StatusSeverity s,
const char16_t(&) format[N] )
inline

Set the severity to s, providing a format string, and adding the validation category.

Definition at line 247 of file statusmessage.h.

◆ validation() [2/2]

template<class Derived>
Derived & swift::misc::CMessageBase< Derived >::validation ( StatusSeverity s,
const QString & format )
inline

Set the severity to s, providing a format string, and adding the validation category.

Definition at line 254 of file statusmessage.h.

◆ validationError() [1/2]

template<class Derived>
template<size_t N>
Derived & swift::misc::CMessageBase< Derived >::validationError ( const char16_t(&) format[N])
inline

Set the severity to error, providing a format string, and adding the validation category.

Definition at line 292 of file statusmessage.h.

◆ validationError() [2/2]

template<class Derived>
Derived & swift::misc::CMessageBase< Derived >::validationError ( const QString & format)
inline

Set the severity to error, providing a format string, and adding the validation category.

Definition at line 299 of file statusmessage.h.

◆ validationInfo() [1/2]

template<class Derived>
template<size_t N>
Derived & swift::misc::CMessageBase< Derived >::validationInfo ( const char16_t(&) format[N])
inline

Set the severity to info, providing a format string, and adding the validation category.

Definition at line 262 of file statusmessage.h.

◆ validationInfo() [2/2]

template<class Derived>
Derived & swift::misc::CMessageBase< Derived >::validationInfo ( const QString & format)
inline

Set the severity to info, providing a format string, and adding the validation category.

Definition at line 269 of file statusmessage.h.

◆ validationWarning() [1/2]

template<class Derived>
template<size_t N>
Derived & swift::misc::CMessageBase< Derived >::validationWarning ( const char16_t(&) format[N])
inline

Set the severity to warning, providing a format string, and adding the validation category.

Definition at line 277 of file statusmessage.h.

◆ validationWarning() [2/2]

template<class Derived>
Derived & swift::misc::CMessageBase< Derived >::validationWarning ( const QString & format)
inline

Set the severity to warning, providing a format string, and adding the validation category.

Definition at line 284 of file statusmessage.h.

◆ warning() [1/2]

template<class Derived>
template<size_t N>
Derived & swift::misc::CMessageBase< Derived >::warning ( const char16_t(&) format[N])
inline

Set the severity to warning, providing a format string.

Definition at line 227 of file statusmessage.h.

◆ warning() [2/2]

template<class Derived>
Derived & swift::misc::CMessageBase< Derived >::warning ( const QString & format)
inline

Set the severity to warning, providing a format string.

Definition at line 233 of file statusmessage.h.

Member Data Documentation

◆ m_args

template<class Derived>
QStringList swift::misc::CMessageBase< Derived >::m_args
protected

Private.

Definition at line 386 of file statusmessage.h.

◆ m_categories

template<class Derived>
CLogCategoryList swift::misc::CMessageBase< Derived >::m_categories = CLogCategoryList { CLogCategories::uncategorized() }
protected

Private.

Definition at line 389 of file statusmessage.h.

◆ m_message

template<class Derived>
CStrongStringView swift::misc::CMessageBase< Derived >::m_message
protected

Private.

Definition at line 383 of file statusmessage.h.

◆ m_severity

template<class Derived>
StatusSeverity swift::misc::CMessageBase< Derived >::m_severity = SeverityDebug
protected

Private.

Definition at line 392 of file statusmessage.h.


The documentation for this class was generated from the following file: