14namespace swift::misc::aviation
52 return levels.
values().join(separator);
91 if (highestLevels[fl].isHigherLevel(category))
93 highestLevels[fl] = category;
98 highestLevels[fl] = category;
130 const int ls = level.
size();
133 if (noRootNode && ls == category.
getDepth())
147 if (level.
size() != 3)
153 if (category.
isLevel(level[0], level[1], level[2]))
170 if (levels.
size() < 2)
179 categories.
remove(category);
185 if (category.
isNull() || this->isEmpty())
193 const bool isL2 = category.
getDepth() == 2;
202 for (
int l = loopLevels.
front(); loopLevels.
back() >= l; ++l)
204 level[isL2 ? 0 : 1] = l;
224 const int c = this->
size();
226 const int delta = c - removed.
size();
void sortBy(K1 key1, Keys... keys)
CSequence findBy(Predicate p) const
void push_back(const T &value)
Appends an element at the end of the sequence.
int remove(const T &object)
Remove all elements equal to the given object, if it is contained.
bool isEmpty() const
Synonym for empty.
Build a QSet more efficiently when calling insert() in a for loop.
void insert(const T &value)
Add an element to the set. Runs in amortized constant time.
Value object for aircraft categories.
int getSecondLevel() const
Second level.
bool isFirstLevel() const
First level.
int getDepth() const
Depth 1, 2, 3.
const QString & getPath() const
Path.
bool isNull() const
Null category?
int compareByLevel(const CAircraftCategory &other) const
Level compare.
int getFirstLevel() const
First level.
bool isLevel(int l1, int l2, int l3) const
Is that given level?
QString getLevelString() const
Level string.
bool matchesName(const QString &name, Qt::CaseSensitivity cs) const
Matching name?
QList< int > getLevel() const
Levels depending on depth, 3.2 -> 3,2 / 1.0 -> 1 / 4.3.1 -> 4,3,1.
static CAircraftCategory fromDatabaseJson(const QJsonObject &json, const QString &prefix=QString())
From our database JSON format.
bool matchesLevel(int l1, int l2=0, int l3=0) const
Is matching the level, 0 ignored.
CAircraftCategoryList findByLevel(const QList< int > &level, bool noRootNode=false) const
Find by levels.
QList< int > getFirstLevels() const
All levels sorted.
CAircraftCategoryList()=default
Default constructor.
CSequence()=default
Default constructor.
QString getLevelsString(const QString &separator=", ") const
Get all level strings.
int removeIfLevel(const QList< int > &level)
Remove by level.
CAircraftCategoryList findInParallelBranch(const CAircraftCategory &category) const
Find siblings.
CAircraftCategoryList findByFirstLevel(int level) const
Find by first level.
CAircraftCategoryList findFirstLevels() const
Find first levels.
void sortByLevel()
Sort by level.
static CAircraftCategoryList fromDatabaseJson(const QJsonArray &array)
From our database JSON format.
void sortByPath()
Sort by path.
CAircraftCategoryList findByName(const QString &name, Qt::CaseSensitivity cs=Qt::CaseInsensitive) const
Find by name.
CAircraftCategory findByFullLevel(const QList< int > &level) const
Find by exact levels.
QList< int > getSecondLevels() const
All levels sorted.
QSet< QString > getLevelStrings() const
Get all level strings.
CAircraftCategoryList removedLevel(const QList< int > &level) const
With removed categories.
CAircraftCategoryList findHighestLevels(const CAircraftCategoryList &categories)
Find highest (top) level of categories.
CAircraftCategoryList findSiblings(const CAircraftCategory &category) const
Find siblings.
QList< T >::reference back()
QList< T >::reference front()
bool isEmpty() const const
bool removeOne(const AT &t)
qsizetype size() const const
bool contains(const Key &key) const const
QList< T > values() const const
bool isEmpty() const const
QList< T > values() const const
#define SWIFT_DEFINE_SEQUENCE_MIXINS(Namespace, T, List)
Explicit template definition of mixins for a CSequence subclass.