swift
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
swift::misc::CMessageBase< Derived > Class Template Reference

Base class for CStatusMessage and CLogMessage. More...

Public Member Functions

 CMessageBase ()
 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 , std::enable_if_t< TParameter< std::decay_t< T >>::passBy==ParameterPassBy::Value, int > = 0>
Derived & operator<< (T v)
 Streaming operators. More...
 
template<class T , std::enable_if_t< TParameter< std::decay_t< T >>::passBy==ParameterPassBy::ConstRef, int > = 0>
Derived & operator<< (const T &v)
 Streaming operators. More...
 
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 158 of file statusmessage.h.

Member Function Documentation

◆ operator<<() [1/2]

template<class Derived >
template<class T , std::enable_if_t< TParameter< std::decay_t< T >>::passBy==ParameterPassBy::ConstRef, int > = 0>
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 330 of file statusmessage.h.

◆ operator<<() [2/2]

template<class Derived >
template<class T , std::enable_if_t< TParameter< std::decay_t< T >>::passBy==ParameterPassBy::Value, int > = 0>
Derived& swift::misc::CMessageBase< Derived >::operator<< ( 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 320 of file statusmessage.h.


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