|
Enroute Flight Navigation
A navigation app for VFR pilots
|
Password database. More...
#include <PasswordDB.h>
Signals | |
| void | emptyChanged () |
| Notifier signal. | |
Public Member Functions | |
| PasswordDB (QObject *parent=nullptr) | |
| Default constructor. | |
| auto | empty () const -> bool |
| Getter method for property with the same name. | |
| Q_INVOKABLE void | clear () |
| Clear database. | |
| Q_INVOKABLE bool | contains (const QString &key) const |
| Check if database contains a given key. | |
| Q_INVOKABLE QString | getPassword (const QString &key) const |
| Find password for a given key. | |
| Q_INVOKABLE void | removePassword (const QString &key) |
| Remove key/password. | |
| Q_INVOKABLE void | setPassword (const QString &key, const QString &password) |
| Set key/password. | |
Properties | |
| bool | empty |
| Empty. | |
Password database.
This simple class provides access to a password database, which is in essence a glorified QHash<QString, QString>, where keys are network SSIDs and values are passwords.
Definition at line 37 of file PasswordDB.h.
| Traffic::PasswordDB::PasswordDB | ( | QObject * | parent = nullptr | ) |
Default constructor.
This default constructor will read the database from a file into memory.
| parent | The standard QObject parent pointer |
| Q_INVOKABLE void Traffic::PasswordDB::clear | ( | ) |
Clear database.
This method clears the database and saves it to the disk.
|
inlinenodiscard |
Check if database contains a given key.
| key | Key to look up |
Definition at line 99 of file PasswordDB.h.
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 77 of file PasswordDB.h.
|
inlinenodiscard |
Find password for a given key.
| key | Key to look up |
Definition at line 111 of file PasswordDB.h.
| Q_INVOKABLE void Traffic::PasswordDB::removePassword | ( | const QString & | key | ) |
Remove key/password.
This method removes a key/password from the database and saves the database to the disk.
| key | Key for password to be removed. |
| Q_INVOKABLE void Traffic::PasswordDB::setPassword | ( | const QString & | key, |
| const QString & | password ) |
Set key/password.
This method adds a key/password to the database and saves the database to the disk. If a password already exists for the given key, then it will be overwritten.
| key | Key to be added |
| password | Password to be added |
|
read |
Empty.
This proerty contains true if the password database is empty.
Definition at line 71 of file PasswordDB.h.