25 if (this->
isEmpty()) {
return QStringList(); }
27 if (sorted) { codes.sort(); }
39 if (name.isEmpty()) {
return CVariant(); }
45 if (name.isEmpty()) {
return QString(); }
48 return cs.
value<QString>();
53 if (name.isEmpty()) {
return false; }
69 for (
int i = 0; i < this->
size(); i++)
71 if ((*
this)[i].getName() == name) {
return i; }
Value object for icons. An icon is stored in the global icon repository and identified by its index....
CVariant getVariant() const
Get variant.
const QString & getName() const
Get name.
QStringList getNames(bool sorted=true) const
Get all names.
CNameVariantPairList()
Default constructor.
CNameVariantPair getValue(const QString &name) const
Get value.
int getIndexForName(const QString &name) const
Get name's index, -1 if not found.
CVariant getVariantValue(const QString &name) const
Get pair's variant value or default if not existing.
QString getValueAsString(const QString &name) const
Get pair's variant value as string (empty if not existing)
bool addOrReplaceValue(const QString &name, const CVariant &value, const CIcon &icon=CIcon())
Add value, if name already exists replace (true) If one is sure(!) the name does not exists,...
bool containsName(const QString &name) const
Contains name.
bool contains(const T &object) const
Return true if there is an element equal to given object. Uses the most efficient implementation avai...
auto transform(F function) const
Return a new container generated by applying some transformation function to all elements of this one...
size_type size() const
Returns number of elements in the sequence.
const_reference frontOrDefault() const
Access the first element, or a default-initialized value if the sequence is empty.
CSequence findBy(Predicate p) const
Return a copy containing only those elements for which a given predicate returns true.
void push_back(const CNameVariantPair &value)
Appends an element at the end of the sequence.
bool isEmpty() const
Synonym for empty.
Wrapper around QVariant which provides transparent access to CValueObject methods of the contained ob...
T value() const
Return the value converted to the type T.
bool isNull() const
True if this variant is null.
bool canConvert(int typeId) const
True if this variant can be converted to the type with the given metatype ID.
auto MemberTransform(T memberFunc)
Returns a function object that returns the value returned by one of it's argument member functions.
Free functions in swift::misc.
#define SWIFT_DEFINE_SEQUENCE_MIXINS(Namespace, T, List)
Explicit template definition of mixins for a CSequence subclass.