swift
Public Member Functions | Friends | List of all members
swift::misc::CStrongStringView Class Reference

Special-purpose string class used by CMessageBase. More...

Inheritance diagram for swift::misc::CStrongStringView:
[legend]

Public Member Functions

 CStrongStringView ()=default
 Default constructor.
 
template<size_t N>
 CStrongStringView (const char16_t(&string)[N])
 Construct from a UTF-16 character array.
 
 CStrongStringView (const QString &string)
 Construct from a QString.
 
 CStrongStringView (QStringView view)
 Construct from a QStringView. Explicit because it could be dangerous if used without care.
 
 CStrongStringView (const char *)=delete
 Deleted constructor.
 
 CStrongStringView (const CStrongStringView &other)
 Copy constructor.
 
CStrongStringViewoperator= (const CStrongStringView &other)
 Copy assignment operator.
 
 ~CStrongStringView ()=default
 Destructor.
 
bool isEmpty () const
 String is empty.
 
bool isOwning () const
 Does it own its string data?
 
QStringView view () const
 Return as a QStringView.
 
QString convertToQString (bool i18n=false) const
 Return a copy as a QString.
 
void marshallToDbus (QDBusArgument &arg) const
 DBus marshalling.
 
void unmarshallFromDbus (const QDBusArgument &arg)
 DBus marshalling.
 
void marshalToDataStream (QDataStream &stream) const
 QDataStream marshalling.
 
void unmarshalFromDataStream (QDataStream &stream)
 QDataStream marshalling.
 
QJsonObject toJson () const
 JSON conversion.
 
void convertFromJson (const QJsonObject &json)
 JSON conversion.
 
- Public Member Functions inherited from swift::misc::mixin::MetaType< CStrongStringView >
int getMetaTypeId () const
 Returns the Qt meta type ID of this object. More...
 
QString getClassName () const
 Class name.
 
bool isA (int metaTypeId) const
 Returns true if this object is an instance of the class with the given meta type ID, or one of its subclasses.
 
- Public Member Functions inherited from swift::misc::mixin::String< CStrongStringView >
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

int compare (const CStrongStringView &a, const CStrongStringView &b)
 Compare two strings.
 
size_t qHash (const CStrongStringView &obj, uint seed=0)
 Hash value.
 

Additional Inherited Members

- Static Public Member Functions inherited from swift::misc::mixin::MetaType< CStrongStringView >
static void registerMetadata ()
 Register metadata.
 

Detailed Description

Special-purpose string class used by CMessageBase.

Wraps a QStringView that can be constructed from a UTF-16 string literal or from a QString. If constructed from a QString, the QString is stored to prevent a dangling pointer.

Definition at line 48 of file statusmessage.h.


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