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

CRTP class template from which a derived class can inherit string streaming operations. More...

#include <mixinstring.h>

Inheritance diagram for swift::misc::mixin::String< Derived >:
[legend]

Public Member Functions

QString toQString (bool i18n=false) const
 Cast as QString.
std::string toStdString (bool i18n=false) const
 To std string.
QString stringForStreaming () const
 String for streaming operators.

Friends

QDebug operator<< (QDebug debug, const Derived &obj)
 Stream << overload to be used in debugging messages.
QNoDebug operator<< (QNoDebug nodebug, const Derived &obj)
 Operator << when there is no debug stream.
QTextStream & operator<< (QTextStream &stream, const Derived &obj)
 Operator << based on text stream.
std::ostream & operator<< (std::ostream &ostr, const Derived &obj)
 Stream operator << for std::cout.

Detailed Description

template<class Derived>
class swift::misc::mixin::String< Derived >

CRTP class template from which a derived class can inherit string streaming operations.

Template Parameters
DerivedMust implement a public method QString convertToQString(bool i18n = false) const.
See also
SWIFT_MISC_DECLARE_USING_MIXIN_STRING

Definition at line 28 of file mixinstring.h.

Member Function Documentation

◆ stringForStreaming()

template<class Derived>
QString swift::misc::mixin::String< Derived >::stringForStreaming ( ) const

String for streaming operators.

Definition at line 86 of file mixinstring.h.

◆ toQString()

template<class Derived>
QString swift::misc::mixin::String< Derived >::toQString ( bool i18n = false) const

Cast as QString.

Definition at line 74 of file mixinstring.h.

◆ toStdString()

template<class Derived>
std::string swift::misc::mixin::String< Derived >::toStdString ( bool i18n = false) const

To std string.

Definition at line 80 of file mixinstring.h.

◆ operator<< [1/4]

template<class Derived>
QDebug operator<< ( QDebug debug,
const Derived & obj )
friend

Stream << overload to be used in debugging messages.

Definition at line 32 of file mixinstring.h.

◆ operator<< [2/4]

template<class Derived>
QNoDebug operator<< ( QNoDebug nodebug,
const Derived & obj )
friend

Operator << when there is no debug stream.

Definition at line 39 of file mixinstring.h.

◆ operator<< [3/4]

template<class Derived>
QTextStream & operator<< ( QTextStream & stream,
const Derived & obj )
friend

Operator << based on text stream.

Definition at line 46 of file mixinstring.h.

◆ operator<< [4/4]

template<class Derived>
std::ostream & operator<< ( std::ostream & ostr,
const Derived & obj )
friend

Stream operator << for std::cout.

Definition at line 53 of file mixinstring.h.


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