KCodecs
Detailed Description
Function Documentation
◆ compareEmail()
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
Definition at line 911 of file kemailaddress.cpp.
◆ extractEmailAddress() [1/4]
QByteArray KEmailAddress::extractEmailAddress | ( | const QByteArray & | address | ) |
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.nosp@m.ser@.nosp@m.examp.nosp@m.le.o.nosp@m.rg in the example
Definition at line 639 of file kemailaddress.cpp.
◆ extractEmailAddress() [2/4]
QByteArray KEmailAddress::extractEmailAddress | ( | const QByteArray & | address, |
QString & | errorMessage ) |
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>" errorMessage return error message when we can't parse email
- Returns
- the addr-spec of address, i.e. joe.u.nosp@m.ser@.nosp@m.examp.nosp@m.le.o.nosp@m.rg in the example
- Since
- 5.11.0
Definition at line 645 of file kemailaddress.cpp.
◆ extractEmailAddress() [3/4]
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.nosp@m.ser@.nosp@m.examp.nosp@m.le.o.nosp@m.rg in the example
Definition at line 665 of file kemailaddress.cpp.
◆ extractEmailAddress() [4/4]
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>" errorMessage return error message when we can't parse email
- Returns
- the addr-spec of addresses, i.e. joe.u.nosp@m.ser@.nosp@m.examp.nosp@m.le.o.nosp@m.rg in the example
- Since
- 5.11
Definition at line 671 of file kemailaddress.cpp.
◆ extractEmailAddressAndName()
bool KEmailAddress::extractEmailAddressAndName | ( | const QString & | aStr, |
QString & | mail, | ||
QString & | name ) |
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
Definition at line 715 of file kemailaddress.cpp.
◆ firstEmailAddress() [1/4]
QByteArray KEmailAddress::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.nosp@m.ser@.nosp@m.examp.nosp@m.le.o.nosp@m.rg in the example
Definition at line 677 of file kemailaddress.cpp.
◆ firstEmailAddress() [2/4]
QByteArray KEmailAddress::firstEmailAddress | ( | const QByteArray & | addresses, |
QString & | errorMessage ) |
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>" errorMessage return error message when we can't parse email
- Returns
- the addr-spec of addresses, i.e. joe.u.nosp@m.ser@.nosp@m.examp.nosp@m.le.o.nosp@m.rg in the example
- Since
- 5.11.0
Definition at line 683 of file kemailaddress.cpp.
◆ firstEmailAddress() [3/4]
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.nosp@m.ser@.nosp@m.examp.nosp@m.le.o.nosp@m.rg in the example
Definition at line 703 of file kemailaddress.cpp.
◆ firstEmailAddress() [4/4]
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>" errorMessage return error message when we can't parse email
- Returns
- the addr-spec of addresses, i.e. joe.u.nosp@m.ser@.nosp@m.examp.nosp@m.le.o.nosp@m.rg in the example
- Since
- 5.11.0
Definition at line 709 of file kemailaddress.cpp.
◆ normalizedAddress()
QString KEmailAddress::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
Definition at line 940 of file kemailaddress.cpp.
◆ quoteNameIfNecessary()
Add quote characters around the given string if it contains a character that makes that necessary, in an email name, such as ",".
- Parameters
-
str a string that may need quoting
- Returns
- the string quoted if necessary
Definition at line 1088 of file kemailaddress.cpp.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:36:33 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.