11using namespace swift::misc::physical_quantities;
15namespace swift::misc::aviation
84 for (
const CAirport &airport : *
this)
102 for (
const CAirport &airport : *
this)
120 for (
const CAirport &airport : *
this)
135 for (
const CAirport &airport : *
this)
154 Q_UNUSED(inconsistent);
auto findFirstByOrDefault(Predicate p, const Value &def) const
bool contains(const T &object) const
const_reference frontOrDefault() const
Access the first element, or a default-initialized value if the sequence is empty.
CSequence findBy(Predicate p) const
void replaceOrAdd(const CAirport &original, const CAirport &replacement)
Q_REQUIRED_RESULT CSequence sorted(Predicate p) const
void push_back(const T &value)
Appends an element at the end of the sequence.
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 encapsulating information about an airpot.
const QString & getLocation() const
Get location (e.g. "London").
bool matchesLocation(const QString &location) const
Matches location?
QString getLocationPlusOptionalName() const
Location plus optional name (if available and different from location).
const QString & getIcaoAsString() const
Get ICAO code as string.
bool matchesDescriptiveName(const QString &name) const
Matches name?
static CAirport fromDatabaseJson(const QJsonObject &json, const QString &prefix=QString())
Object from JSON.
const CAirportIcaoCode & getIcao() const
Get ICAO code.
bool hasValidIcaoCode() const
Valid ICAO code.
void updateMissingParts(const CAirport &airport)
Update the missing parts in airport.
const QString & getDescriptiveName() const
Get descriptive name.
Value object encapsulating information of airport ICAO data.
bool isEmpty() const
Is empty?
CSequence()=default
Default constructor.
QStringList allIcaoCodes(bool sorted) const
All ICAO codes.
QStringList allDescriptivesNames(bool sorted) const
All names.
static CAirportList fromDatabaseJson(const QJsonArray &array, CAirportList *inconsistent=nullptr)
From our DB JSON.
bool containsAirportWithIcaoCode(const CAirportIcaoCode &icao) const
Containing an airport with given ICAO code?
void updateMissingParts(const CAirportList &updateFromList)
Update this list from the other list.
CAirport findFirstByIcao(const CAirportIcaoCode &icao) const
Find first station by callsign, if not return default.
CAirport findFirstByNameOrLocation(const QString &nameOrLocation) const
Find first by name or location, if not return default.
CAirportList findByIcao(const CAirportIcaoCode &icao) const
Find 0..n airports by ICAO code.
QStringList allLocationsPlusOptionalDescription(bool sorted) const
All locations plus optional description.
QStringList allLocations() const
All locations.
void replaceOrAddByIcao(const CAirport &addedOrReplacedAirport)
Replace or add based on same ICAO code.
CAirportList()=default
Default constructor.
void push_back(QList< T >::parameter_type value)
bool isEmpty() const const
void sort(Qt::CaseSensitivity cs)
#define SWIFT_DEFINE_SEQUENCE_MIXINS(Namespace, T, List)
Explicit template definition of mixins for a CSequence subclass.