| Line | |
|---|
| 1 | #ifndef BNCCREDENTIALS_H
|
|---|
| 2 | #define BNCCREDENTIALS_H
|
|---|
| 3 |
|
|---|
| 4 | #include <QString>
|
|---|
| 5 | #include <QStringList>
|
|---|
| 6 | #include <QUrl>
|
|---|
| 7 |
|
|---|
| 8 | // Passwords from credentials files instead of the configuration file
|
|---|
| 9 | // (option 'credentialsFile', default $NETRC or ~/.netrc). Two formats,
|
|---|
| 10 | // detected per file:
|
|---|
| 11 | // netrc: machine <host>[:<port>] login <user> password <password>
|
|---|
| 12 | // BNC: <host> <port|*> <user|-> <password> (one entry per line)
|
|---|
| 13 | // <host> <user> <password> (any port)
|
|---|
| 14 | // Tokens are separated by white space, may be quoted ("..."), '#' starts a
|
|---|
| 15 | // comment. An entry for the exact port is preferred, the netrc 'default'
|
|---|
| 16 | // entry is never used.
|
|---|
| 17 | class bncCredentials {
|
|---|
| 18 | public:
|
|---|
| 19 | // Password of user (empty: entry without user) at host:port
|
|---|
| 20 | static bool password(const QString& host, int port, const QString& user,
|
|---|
| 21 | QString& password);
|
|---|
| 22 |
|
|---|
| 23 | // Stream URL: a user without password gets it from the credentials files;
|
|---|
| 24 | // a URL without user stays anonymous
|
|---|
| 25 | static void complete(QUrl& url);
|
|---|
| 26 |
|
|---|
| 27 | // Upload or sourcetable: an empty password is taken from the credentials
|
|---|
| 28 | // files (also for an empty user, e.g. Ntrip Version 1 upload if 'anyUser')
|
|---|
| 29 | static void complete(const QString& host, int port, const QString& user,
|
|---|
| 30 | QString& password, bool anyUser, bool hint);
|
|---|
| 31 |
|
|---|
| 32 | static QStringList fileNames();
|
|---|
| 33 | };
|
|---|
| 34 |
|
|---|
| 35 | #endif
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.