10 namespace swift::misc::db
21 if (distribution.
getChannel().isEmpty()) {
continue; }
32 return order == Qt::AscendingOrder ? as < bs : bs < as;
78 for (
const QJsonValue &value : array)
auto findFirstByOrDefault(Predicate p, const Value &def) const
Return a copy of the first element for which a given predicate returns true, or a default value if th...
bool containsBy(Predicate p) const
Return true if there is an element for which a given predicate returns true.
bool contains(const T &object) const
Return true if there is an element equal to given object. Uses the most efficient implementation avai...
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 T &value)
Appends an element at the end of the sequence.
reference front()
Access the first element.
reference back()
Access the last element.
void sort(Predicate p)
In-place sort by a given comparator predicate.
Distributions for channel.
bool isRestricted() const
Restricted channel?
int getStability() const
Stability (higher is more stable)
const QString & getChannel() const
Version channel (Alpha, Beta, Stable ..)
bool isStabilitySameOrBetter(const CDistribution &otherDistribution) const
"this" having same or better stability than other distribution?
static CDistribution fromDatabaseJson(const QJsonObject &json, const QString &prefix={})
Object from database JSON format.
Multiple distributions for different channels:
bool containsUnrestricted() const
Contains any unrestricted.
CDistribution getMostStableOrDefault() const
Most stable or default.
CDistributionList()
Empty constructor.
CDistribution findFirstByChannelOrDefault(const QString &channel) const
Find by channel.
QStringList getChannels() const
All channels.
void sortByStability(Qt::SortOrder order=Qt::AscendingOrder)
Stability.
CDistributionList findByRestriction(bool restricted) const
Find by restriction flag.
bool containsChannel(const QString &channel) const
Contains channel?
CDistribution getLeastStableOrDefault() const
Least stable or default.
static CDistributionList fromDatabaseJson(const QJsonArray &array)
From database JSON by array.
bool containsEqualOrMoreStable(CDistribution &distribution) const
Contains distributions considered of same stability or more stable.
QJsonArray jsonArrayFromString(const QString &json)
JSON Array from string.
#define SWIFT_DEFINE_SEQUENCE_MIXINS(Namespace, T, List)
Explicit template definition of mixins for a CSequence subclass.