QGIS API Documentation 3.41.0-Master (3440c17df1d)
|
Configuration storage class for authentication method configurations. More...
#include <qgsauthconfig.h>
Public Member Functions | |
QgsAuthMethodConfig (const QString &method=QString(), int version=0) | |
Construct a configuration for an authentication method. | |
void | clearConfigMap () |
Clear all configs. | |
QString | config (const QString &key, const QString &defaultvalue=QString()) const |
Returns a config's value. | |
QStringList | configList (const QString &key) const |
Returns a config's list of values. | |
QgsStringMap | configMap () const |
Gets extended configuration, mapped to key/value pairs of QStrings. | |
const QString | configString () const |
The extended configuration, as stored and retrieved from the authentication database. | |
bool | hasConfig (const QString &key) const |
Whether a config key exists in config map. | |
const QString | id () const |
Gets 'authcfg' 7-character alphanumeric ID of the config. | |
bool | isValid (bool validateid=false) const |
Whether the configuration is valid. | |
void | loadConfigString (const QString &configstr) |
Load existing extended configuration. | |
QString | method () const |
Textual key of the associated authentication method. | |
const QString | name () const |
Gets name of configuration. | |
bool | operator!= (const QgsAuthMethodConfig &other) const |
bool | operator== (const QgsAuthMethodConfig &other) const |
bool | readXml (const QDomElement &element) |
from a DOM element. | |
int | removeConfig (const QString &key) |
Remove a config from map. | |
void | setConfig (const QString &key, const QString &value) |
Set a single config value per key in the map. | |
void | setConfigList (const QString &key, const QStringList &value) |
Set a multiple config values per key in the map. | |
void | setConfigMap (const QgsStringMap &map) |
Set extended configuration map. | |
void | setId (const QString &id) |
Sets auth config ID. | |
void | setMethod (const QString &method) |
void | setName (const QString &name) |
Sets name of configuration. | |
void | setUri (const QString &uri) |
void | setVersion (int version) |
Sets version of the configuration. | |
const QString | uri () const |
A URI to auto-select a config when connecting to a resource. | |
int | version () const |
Gets version of the configuration. | |
bool | writeXml (QDomElement &parentElement, QDomDocument &document) |
Stores the configuration in a DOM. | |
Static Public Member Functions | |
static bool | uriToResource (const QString &accessurl, QString *resource, bool withpath=false) |
A utility function for generating a resource from a URL to be compared against the config's uri() for auto-selecting authentication configs to use. | |
Configuration storage class for authentication method configurations.
Definition at line 41 of file qgsauthconfig.h.
QgsAuthMethodConfig::QgsAuthMethodConfig | ( | const QString & | method = QString() , |
int | version = 0 |
||
) |
Construct a configuration for an authentication method.
method | Textual key of the authentication method |
version | Version of the configuration (for updating previously saved configs later on) |
Definition at line 41 of file qgsauthconfig.cpp.
|
inline |
Clear all configs.
Definition at line 153 of file qgsauthconfig.h.
QString QgsAuthMethodConfig::config | ( | const QString & | key, |
const QString & | defaultvalue = QString() |
||
) | const |
Returns a config's value.
key | Config key |
defaultvalue | Default value, if key not found |
Definition at line 129 of file qgsauthconfig.cpp.
QStringList QgsAuthMethodConfig::configList | ( | const QString & | key | ) | const |
|
inline |
Gets extended configuration, mapped to key/value pairs of QStrings.
Definition at line 102 of file qgsauthconfig.h.
const QString QgsAuthMethodConfig::configString | ( | ) | const |
The extended configuration, as stored and retrieved from the authentication database.
Definition at line 77 of file qgsauthconfig.cpp.
bool QgsAuthMethodConfig::hasConfig | ( | const QString & | key | ) | const |
Whether a config key exists in config map.
key |
Definition at line 139 of file qgsauthconfig.cpp.
|
inline |
Gets 'authcfg' 7-character alphanumeric ID of the config.
Definition at line 61 of file qgsauthconfig.h.
bool QgsAuthMethodConfig::isValid | ( | bool | validateid = false | ) | const |
Whether the configuration is valid.
validateid | Additionally verify the auth config ID is not empty |
Definition at line 66 of file qgsauthconfig.cpp.
void QgsAuthMethodConfig::loadConfigString | ( | const QString & | configstr | ) |
Load existing extended configuration.
configstr | Configuration string to load |
Definition at line 89 of file qgsauthconfig.cpp.
|
inline |
Textual key of the associated authentication method.
Definition at line 75 of file qgsauthconfig.h.
|
inline |
Gets name of configuration.
Definition at line 66 of file qgsauthconfig.h.
bool QgsAuthMethodConfig::operator!= | ( | const QgsAuthMethodConfig & | other | ) | const |
Definition at line 61 of file qgsauthconfig.cpp.
bool QgsAuthMethodConfig::operator== | ( | const QgsAuthMethodConfig & | other | ) | const |
Definition at line 51 of file qgsauthconfig.cpp.
bool QgsAuthMethodConfig::readXml | ( | const QDomElement & | element | ) |
from a DOM element.
element | is the DOM node corresponding to item (e.g. 'LayoutItem' element) |
Definition at line 183 of file qgsauthconfig.cpp.
int QgsAuthMethodConfig::removeConfig | ( | const QString & | key | ) |
Remove a config from map.
key | Config to remove |
Definition at line 124 of file qgsauthconfig.cpp.
void QgsAuthMethodConfig::setConfig | ( | const QString & | key, |
const QString & | value | ||
) |
Set a single config value per key in the map.
key | Config key |
value | Config value |
Definition at line 114 of file qgsauthconfig.cpp.
void QgsAuthMethodConfig::setConfigList | ( | const QString & | key, |
const QStringList & | value | ||
) |
Set a multiple config values per key in the map.
key | Config key |
value | Config value |
Definition at line 119 of file qgsauthconfig.cpp.
|
inline |
Set extended configuration map.
map | Map to set |
Definition at line 108 of file qgsauthconfig.h.
|
inline |
Sets auth config ID.
Definition at line 63 of file qgsauthconfig.h.
|
inline |
Definition at line 76 of file qgsauthconfig.h.
|
inline |
Sets name of configuration.
Definition at line 68 of file qgsauthconfig.h.
|
inline |
Definition at line 72 of file qgsauthconfig.h.
|
inline |
Sets version of the configuration.
Definition at line 81 of file qgsauthconfig.h.
|
inline |
A URI to auto-select a config when connecting to a resource.
Definition at line 71 of file qgsauthconfig.h.
|
static |
A utility function for generating a resource from a URL to be compared against the config's uri() for auto-selecting authentication configs to use.
accessurl | A URL to process |
resource | Output variable for result |
withpath | Whether to include the URI's path in output |
Definition at line 144 of file qgsauthconfig.cpp.
|
inline |
Gets version of the configuration.
Definition at line 79 of file qgsauthconfig.h.
bool QgsAuthMethodConfig::writeXml | ( | QDomElement & | parentElement, |
QDomDocument & | document | ||
) |
Stores the configuration in a DOM.
parentElement | parent DOM element |
document | DOM document |
Definition at line 161 of file qgsauthconfig.cpp.