swift
Loading...
Searching...
No Matches
swift::misc::CPropertyIndex Class Reference

Property index. More...

#include <propertyindex.h>

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

Public Member Functions

 CPropertyIndex ()=default
 Default constructor.
 CPropertyIndex (int singleProperty)
 Non nested index.
 CPropertyIndex (std::initializer_list< int > il)
 Initializer list constructor.
 CPropertyIndex (const QList< int > &indexes)
 Construct from a list of indexes.
 CPropertyIndex (const QString &indexes)
 From string.
 operator CPropertyIndexRef () const
 Return a simplified non-owning reference.
Q_REQUIRED_RESULT CPropertyIndex copyFrontRemoved () const
 Copy with first element removed.
bool isNested () const
 Is nested index?
bool isMyself () const
 Myself index, used with nesting.
bool isEmpty () const
 Empty?
QList< int > indexList () const
 Index list.
void prepend (int newLeftIndex)
 Shift existing indexes to right and insert given index at front.
bool contains (int index) const
 Contains index?
template<class EnumType>
bool contains (EnumType ev) const
 Compare with index given by enum.
int frontToInt () const
 Front to integer.
bool startsWith (int index) const
 Starts with given index?
template<class CastType>
CastType frontCasted () const
 First element casted to given type, usually the PropertIndex enum.
template<class EnumType>
bool startsWithPropertyIndexEnum (EnumType ev) const
 Compare with index given by enum.
auto comparator () const
 Return a predicate function which can compare two objects based on this index.
QString convertToQString (bool i18n=false) const
 Cast as QString.
QJsonObject toJson () const
 Cast to JSON object.
void convertFromJson (const QJsonObject &json)
 Assign from JSON object.
Public Member Functions inherited from swift::misc::mixin::MetaType< CPropertyIndex >
int getMetaTypeId () const
 Returns the Qt meta type ID of this object.
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::DBusByMetaClass< CPropertyIndex >
void marshallToDbus (QDBusArgument &arg, Tags...) const
 Marshall without begin/endStructure, for when composed within another object.
void unmarshallFromDbus (const QDBusArgument &arg, Tags...)
 Unmarshall without begin/endStructure, for when composed within another object.
Public Member Functions inherited from swift::misc::mixin::DataStreamByMetaClass< CPropertyIndex >
void marshalToDataStream (QDataStream &stream) const
 Marshal a value to a QDataStream.
void unmarshalFromDataStream (QDataStream &stream)
 Unmarshal a value from a QDataStream.
Public Member Functions inherited from swift::misc::mixin::String< CPropertyIndex >
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.

Static Public Member Functions

static const CPropertyIndex & empty ()
 an empty property index
Static Public Member Functions inherited from swift::misc::mixin::MetaType< CPropertyIndex >
static void registerMetadata ()
 Register metadata.

Protected Member Functions

void parseFromString (const QString &indexes)
 Parse indexes from string.

Detailed Description

Property index.

The index can be nested, that's why it is a sequence (e.g. PropertyIndexPilot, PropertyIndexRealname).

Definition at line 34 of file propertyindex.h.

Constructor & Destructor Documentation

◆ CPropertyIndex() [1/4]

swift::misc::CPropertyIndex::CPropertyIndex ( int singleProperty)

Non nested index.

Definition at line 13 of file propertyindex.cpp.

◆ CPropertyIndex() [2/4]

swift::misc::CPropertyIndex::CPropertyIndex ( std::initializer_list< int > il)

Initializer list constructor.

Definition at line 18 of file propertyindex.cpp.

◆ CPropertyIndex() [3/4]

swift::misc::CPropertyIndex::CPropertyIndex ( const QList< int > & indexes)

Construct from a list of indexes.

Definition at line 20 of file propertyindex.cpp.

◆ CPropertyIndex() [4/4]

swift::misc::CPropertyIndex::CPropertyIndex ( const QString & indexes)

From string.

Definition at line 22 of file propertyindex.cpp.

Member Function Documentation

◆ comparator()

auto swift::misc::CPropertyIndex::comparator ( ) const
inline

Return a predicate function which can compare two objects based on this index.

Definition at line 120 of file propertyindex.h.

◆ contains() [1/2]

template<class EnumType>
bool swift::misc::CPropertyIndex::contains ( EnumType ev) const
inline

Compare with index given by enum.

Definition at line 90 of file propertyindex.h.

◆ contains() [2/2]

bool swift::misc::CPropertyIndex::contains ( int index) const

Contains index?

Definition at line 102 of file propertyindex.cpp.

◆ convertFromJson()

void swift::misc::CPropertyIndex::convertFromJson ( const QJsonObject & json)

Assign from JSON object.

Definition at line 88 of file propertyindex.cpp.

◆ convertToQString()

QString swift::misc::CPropertyIndex::convertToQString ( bool i18n = false) const

Cast as QString.

Definition at line 44 of file propertyindex.cpp.

◆ copyFrontRemoved()

CPropertyIndex swift::misc::CPropertyIndex::copyFrontRemoved ( ) const

Copy with first element removed.

Definition at line 26 of file propertyindex.cpp.

◆ empty()

const CPropertyIndex & swift::misc::CPropertyIndex::empty ( )
inlinestatic

an empty property index

Definition at line 150 of file propertyindex.h.

◆ frontCasted()

template<class CastType>
CastType swift::misc::CPropertyIndex::frontCasted ( ) const
inline

First element casted to given type, usually the PropertIndex enum.

Definition at line 104 of file propertyindex.h.

◆ frontToInt()

int swift::misc::CPropertyIndex::frontToInt ( ) const

Front to integer.

Definition at line 104 of file propertyindex.cpp.

◆ indexList()

QList< int > swift::misc::CPropertyIndex::indexList ( ) const

Index list.

Definition at line 98 of file propertyindex.cpp.

◆ isEmpty()

bool swift::misc::CPropertyIndex::isEmpty ( ) const

Empty?

Definition at line 42 of file propertyindex.cpp.

◆ isMyself()

bool swift::misc::CPropertyIndex::isMyself ( ) const

Myself index, used with nesting.

Definition at line 40 of file propertyindex.cpp.

◆ isNested()

bool swift::misc::CPropertyIndex::isNested ( ) const

Is nested index?

Definition at line 38 of file propertyindex.cpp.

◆ operator CPropertyIndexRef()

swift::misc::CPropertyIndex::operator CPropertyIndexRef ( ) const

Return a simplified non-owning reference.

Definition at line 24 of file propertyindex.cpp.

◆ parseFromString()

void swift::misc::CPropertyIndex::parseFromString ( const QString & indexes)
protected

Parse indexes from string.

Definition at line 60 of file propertyindex.cpp.

◆ prepend()

void swift::misc::CPropertyIndex::prepend ( int newLeftIndex)

Shift existing indexes to right and insert given index at front.

Definition at line 100 of file propertyindex.cpp.

◆ startsWith()

bool swift::misc::CPropertyIndex::startsWith ( int index) const

Starts with given index?

Definition at line 110 of file propertyindex.cpp.

◆ startsWithPropertyIndexEnum()

template<class EnumType>
bool swift::misc::CPropertyIndex::startsWithPropertyIndexEnum ( EnumType ev) const
inline

Compare with index given by enum.

Definition at line 113 of file propertyindex.h.

◆ toJson()

QJsonObject swift::misc::CPropertyIndex::toJson ( ) const

Cast to JSON object.

Definition at line 81 of file propertyindex.cpp.


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