#ifndef BNCCREDENTIALS_H #define BNCCREDENTIALS_H #include #include #include // Passwords from credentials files instead of the configuration file // (option 'credentialsFile', default $NETRC or ~/.netrc). Two formats, // detected per file: // netrc: machine [:] login password // BNC: (one entry per line) // (any port) // Tokens are separated by white space, may be quoted ("..."), '#' starts a // comment. An entry for the exact port is preferred, the netrc 'default' // entry is never used. class bncCredentials { public: // Password of user (empty: entry without user) at host:port static bool password(const QString& host, int port, const QString& user, QString& password); // Stream URL: a user without password gets it from the credentials files; // a URL without user stays anonymous static void complete(QUrl& url); // Upload or sourcetable: an empty password is taken from the credentials // files (also for an empty user, e.g. Ntrip Version 1 upload if 'anyUser') static void complete(const QString& host, int port, const QString& user, QString& password, bool anyUser, bool hint); static QStringList fileNames(); }; #endif