kpimutils
Functions | |
bool | KPIMUtils::compareEmail (const QString &email1, const QString &email2, bool matchName) |
QByteArray | KPIMUtils::extractEmailAddress (const QByteArray &address) |
QString | KPIMUtils::extractEmailAddress (const QString &address) |
bool | KPIMUtils::extractEmailAddressAndName (const QString &aStr, QString &mail, QString &name) |
QByteArray | KPIMUtils::firstEmailAddress (const QByteArray &addresses) |
QString | KPIMUtils::firstEmailAddress (const QString &addresses) |
QString | KPIMUtils::normalizedAddress (const QString &displayName, const QString &addrSpec, const QString &comment=QString()) |
QString | KPIMUtils::quoteNameIfNecessary (const QString &str) |
Detailed Description
Function Documentation
Compare two email addresses.
If matchName is false, it just checks the email address, and returns true if this matches. If matchName is true, both the name and the email must be the same.
- Parameters
-
email1 the first email address to use for comparison email2 the second email address to use for comparison matchName if set to true email address and displayname must match
- Returns
- true if the comparison matches true in all other cases
QByteArray KPIMUtils::extractEmailAddress | ( | const QByteArray & | address | ) |
This is an overloaded member function, provided for convenience.
It behaves essentially like the above function.
Returns the pure email address (addr-spec in RFC2822) of the given address (mailbox in RFC2822).
- Parameters
-
address an email address, e.g. "Joe User <joe.user@example.org>"
- Returns
- the addr-spec of address, i.e. joe.u in the example ser@ examp le.o rg
Return email address and name from string.
Examples: "Stefan Taferner <taferner@example.org>" returns "taferner@example.org" and "Stefan Taferner". "joe@example.com" returns "joe@example.com" and "". Note that this only returns the first address.
Also note that the return value is true if both the name and the mail are not empty: this does NOT tell you if mail contains a valid email address or just some rubbish.
- Parameters
-
aStr an email address, e.g "Joe User <joe.user@example.org>" name only out: returns the displayname, "Joe User" in the example mail only out: returns the email address "joe.user@example.org" in the example
- Returns
- true if both name and email address are not empty
QByteArray KPIMUtils::firstEmailAddress | ( | const QByteArray & | addresses | ) |
Returns the pure email address (addr-spec in RFC2822) of the first email address of a list of addresses.
- Parameters
-
addresses an email address, e.g. "Joe User <joe.user@example.org>"
- Returns
- the addr-spec of addresses, i.e. joe.u in the example ser@ examp le.o rg
This is an overloaded member function, provided for convenience.
It behaves essentially like the above function.
Returns the pure email address (addr-spec in RFC2822) of the first email address of a list of addresses.
- Parameters
-
addresses an email address, e.g. "Joe User <joe.user@example.org>"
- Returns
- the addr-spec of addresses, i.e. joe.u in the example ser@ examp le.o rg
QString KPIMUtils::normalizedAddress | ( | const QString & | displayName, |
const QString & | addrSpec, | ||
const QString & | comment = QString() |
||
) |
Returns a normalized address built from the given parts.
The normalized address is of one the following forms:
- displayName (comment) <addrSpec>
- displayName <addrSpec>
- comment <addrSpec>
- addrSpec
- Parameters
-
displayName the display name of the address addrSpec the actual email address (addr-spec in RFC 2822) comment a comment
- Returns
- a normalized address built from the given parts
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:37:25 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.