KLDAPCore::LdapUrl Class

A special url class for LDAP. More...

Header: #include <KLDAPCore/LdapUrl>
CMake: find_package(KPim6LdapCore REQUIRED)
target_link_libraries(mytarget PRIVATE KPim6::LdapCore)
Inherits: QUrl

Public Functions

LdapUrl()
LdapUrl(const QUrl &url)
LdapUrl(const KLDAPCore::LdapUrl &other)
~LdapUrl()
QStringList attributes() const
KLDAPCore::LdapDN dn() const
KLDAPCore::LdapUrl::Extension extension(const QString &extension) const
QString extension(const QString &extension, bool &critical) const
QString filter() const
bool hasExtension(const QString &extension) const
void parseQuery()
void removeExtension(const QString &extension)
KLDAPCore::LdapUrl::Scope scope() const
void setAttributes(const QStringList &attributes)
void setDn(const KLDAPCore::LdapDN &dn)
void setExtension(const QString &key, const KLDAPCore::LdapUrl::Extension &extension)
void setExtension(const QString &key, const QString &value, bool critical = false)
void setExtension(const QString &key, int value, bool critical = false)
void setFilter(const QString &filter)
void setScope(KLDAPCore::LdapUrl::Scope scope)
void updateQuery()
KLDAPCore::LdapUrl &operator=(const KLDAPCore::LdapUrl &other)

Detailed Description

LdapUrl implements an RFC 2255 compliant LDAP Url parser, with minimal differences. LDAP Urls implemented by this class has the following format: ldap[s]://[user[:password]@]hostname[:port]["/" [dn ["?" [attributes] ["?" [scope] ["?" [filter] ["?" extensions]]]]]]

Member Function Documentation

LdapUrl::LdapUrl()

Constructs an empty LDAP URL.

[explicit] LdapUrl::LdapUrl(const QUrl &url)

Constructs an LDAP URL from a QUrl. url the QUrl to construct from

LdapUrl::LdapUrl(const KLDAPCore::LdapUrl &other)

Constructs a copy of the given LDAP URL. other the LDAP URL to copy

[noexcept] LdapUrl::~LdapUrl()

Destroys the LDAP URL.

QStringList LdapUrl::attributes() const

Returns the attributes part of the LDAP URL. Returns the list of attributes

See also setAttributes().

KLDAPCore::LdapDN LdapUrl::dn() const

Returns the DN part of the LDAP URL. This is equal to path() with the slash removed from the beginning. Returns the DN part of the URL

See also setDn().

KLDAPCore::LdapUrl::Extension LdapUrl::extension(const QString &extension) const

Returns the specified extension. extension the extension name Returns the extension value

See also setExtension().

QString LdapUrl::extension(const QString &extension, bool &critical) const

Returns the specified extension value and criticality flag. extension the extension name critical output parameter for the criticality flag Returns the extension value

QString LdapUrl::filter() const

Returns the filter part of the LDAP URL. Returns the filter string

See also setFilter().

bool LdapUrl::hasExtension(const QString &extension) const

Returns whether the specified extension exists in the LDAP URL. extension the extension name Returns true if the extension exists

void LdapUrl::parseQuery()

Parses the query argument of the URL and makes it available via the attributes(), extension(), filter() and scope() methods.

void LdapUrl::removeExtension(const QString &extension)

Removes the specified extension. extension the extension name to remove

KLDAPCore::LdapUrl::Scope LdapUrl::scope() const

Returns the scope part of the LDAP URL. Returns the scope

See also setScope().

void LdapUrl::setAttributes(const QStringList &attributes)

Sets the attributes part of the LDAP URL. attributes the list of attributes to set

See also attributes().

void LdapUrl::setDn(const KLDAPCore::LdapDN &dn)

Sets the DN part of the LDAP URL. dn the DN to set

See also dn().

void LdapUrl::setExtension(const QString &key, const KLDAPCore::LdapUrl::Extension &extension)

Sets the specified extension with the given value and criticality. key the extension name extension the extension value and criticality

See also extension().

void LdapUrl::setExtension(const QString &key, const QString &value, bool critical = false)

Sets the specified extension with the given string value and criticality. key the extension name value the extension value critical whether the extension is critical

void LdapUrl::setExtension(const QString &key, int value, bool critical = false)

Sets the specified extension with the given integer value and criticality. key the extension name value the extension value critical whether the extension is critical

void LdapUrl::setFilter(const QString &filter)

Sets the filter part of the LDAP URL. filter the filter string to set

See also filter().

void LdapUrl::setScope(KLDAPCore::LdapUrl::Scope scope)

Sets the scope part of the LDAP URL. scope the scope to set

See also scope().

void LdapUrl::updateQuery()

Updates the query component from the attributes, scope, filter and extensions.

KLDAPCore::LdapUrl &LdapUrl::operator=(const KLDAPCore::LdapUrl &other)

Assigns the values from another LDAP URL to this URL. other the LDAP URL to assign Returns a reference to this URL