25#include <QRegularExpression>
28#include "FileLibraryModel.h"
29#include "GlobalObject.h"
30#include "navigation/Aircraft.h"
31#include "navigation/FlightRoute.h"
32#include "units/ByteSize.h"
71 static
Librarian* create(QQmlEngine* , QJSEngine* )
128 [[nodiscard]] Q_INVOKABLE
static bool contains(
const QObject* route);
227 [[nodiscard]] Q_INVOKABLE
static QString
import(
Librarian::Library library,
const QString& fileName) ;
268 Q_INVOKABLE
bool matches(
const QString& text,
const QString& filter);
289 QRegularExpression specialChars {QStringLiteral(
"[^a-zA-Z0-9]")};
290 QHash<QString, QString> simplifySpecialChars_cache;
List of the entries of a file-based library.
static Q_INVOKABLE Librarian * librarian()
Pointer to appplication-wide static librarian instance.
static QString manualLocation()
Location of the user manual.
QML_SINGLETONQString manualLocation
Location of the user manual, see manualLocation().
QString simplifySpecialChars(const QString &string)
Simplifies string by transforming and removing special characters.
Q_INVOKABLE bool matches(const QString &text, const QString &filter)
Checks if a text matches a filter string, in a fuzzy way.
static Q_INVOKABLE QString directory(Librarian::Library library)
Name of the directory containing the given.
static Q_INVOKABLE bool contains(const QObject *route)
Check if a flight route exists in the library.
static Q_INVOKABLE QString getStringFromRessource(const QString &name)
Exposes string stored in QRessource to QML.
FileLibraryModel * routesModel() const
Getter function for the property with the same name.
static Q_INVOKABLE QString fullPath(Librarian::Library library, const QString &baseName)
Full path of a library entry.
FileLibraryModel * aircraftModel() const
Getter function for the property with the same name.
static Q_INVOKABLE void rename(Librarian::Library library, const QString &oldName, const QString &newName)
Renames an entry in a library.
Librarian(QObject *parent=nullptr)
Default constructor.
static Q_INVOKABLE bool contains(const Navigation::Aircraft &acft)
Check if an object exists in the library.
static Q_INVOKABLE void remove(Librarian::Library library, const QString &baseName)
Removes an entry from a library.
FileLibraryModel * aircraftModel
Model listing the entries of the aircraft library, see model().
static Q_INVOKABLE Navigation::FlightRoute * get(Librarian::Library library, const QString &baseName)
Constructs an object from library entry.
@ Aircraft
Aircraft library.
@ Routes
Flight route library.
FileLibraryModel * routesModel
Model listing the entries of the flight route library, see model().
static Q_INVOKABLE Units::ByteSize getStringHashFromRessource(const QString &name)
Exposes the hash of string stored in QRessource to QML.
static Q_INVOKABLE bool exists(Librarian::Library library, const QString &baseName)
Check if an entry with the given name exists in the library.
FileLibraryModel * model(Librarian::Library library) const
Model listing the entries of a library.
This extremely simple class holds a few numbers that describe an aircraft.
Convenience class for size_t.