kpimutils
email.cpp
Go to the documentation of this file.
651 if ( localPart[ 0 ] == QLatin1Char('\"') || localPart[ localPart.length()-1 ] == QLatin1Char('\"') ) {
654 addrRx = QLatin1String("[a-zA-Z]*[~|{}`\\^?=/+*'&%$#!_\\w.-]*[~|{}`\\^?=/+*'&%$#!_a-zA-Z0-9-]@");
656 if ( domainPart[ 0 ] == QLatin1Char('[') || domainPart[ domainPart.length()-1 ] == QLatin1Char(']') ) {
940 return quoteNameIfNecessary( realDisplayName ) + QLatin1String(" <") + addrSpec + QLatin1Char('>');
948 return realDisplayName + QLatin1String(" (") + comment +QLatin1String( ") <") + addrSpec + QLatin1Char('>');
1094 if ( ( quoted[0] == QLatin1Char('"') ) && ( quoted[quoted.length() - 1] ==QLatin1Char( '"') ) ) {
1095 quoted = QLatin1String("\"") + escapeQuotes( quoted.mid( 1, quoted.length() - 2 ) ) + QLatin1String("\"");
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
QString & append(QChar ch)
EmailParseResult isValidAddress(const QString &aStr)
Validates an email address in the form of "Joe User" joe@example.org.
Definition: email.cpp:315
void truncate(int position)
QString quoteNameIfNecessary(const QString &str)
Add quote characters around the given string if it contains a character that makes that necessary...
Definition: email.cpp:1088
QByteArray trimmed() const
bool isValidSimpleAddress(const QString &aStr)
Validates an email address in the form of joe@example.org.
Definition: email.cpp:609
QString & prepend(QChar ch)
QString normalizeAddressesAndEncodeIdn(const QString &str)
Normalizes all email addresses in the given list and encodes all IDNs in punycode.
Definition: email.cpp:1023
QString emailParseResultToString(EmailParseResult errorCode)
Translate the enum errorcodes from emailParseResult into i18n'd strings that can be used for msg boxe...
Definition: email.cpp:545
bool isEmpty() const
QString simplified() const
QString join(const QString &separator) const
QStringList splitAddressList(const QString &aStr)
Split a comma separated list of email addresses.
Definition: email.cpp:45
int lastIndexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
void clear()
This file is part of the KDEPIM Utilities library and provides static methods for email address valid...
EmailParseResult splitAddress(const QByteArray &address, QByteArray &displayName, QByteArray &addrSpec, QByteArray &comment)
Splits the given address into display name, email address and comment.
Definition: email.cpp:286
QString fromUtf8(const char *str, int size)
QString toIdn(const QString &addrSpec)
Encodes the domain part of the given addr-spec in punycode if it's an IDN.
Definition: email.cpp:969
EmailParseResult isValidAddressList(const QString &aStr, QString &badAddr)
Validates a list of email addresses, and also allow aliases and distribution lists to be expanded bef...
Definition: email.cpp:522
bool isEmpty() const
QByteArray extractEmailAddress(const QByteArray &address)
Returns the pure email address (addr-spec in RFC2822) of the given address (mailbox in RFC2822)...
Definition: email.cpp:674
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const
bool endsWith(const QString &s, Qt::CaseSensitivity cs) const
void truncate(int pos)
QString normalizedAddress(const QString &displayName, const QString &addrSpec, const QString &comment=QString())
Returns a normalized address built from the given parts.
Definition: email.cpp:931
iterator end()
QString fromIdn(const QString &addrSpec)
Decodes the punycode domain part of the given addr-spec if it's an IDN.
Definition: email.cpp:953
char toLatin1() const
QByteArray toLatin1() const
QString mid(int position, int n) const
QString normalizeAddressesAndDecodeIdn(const QString &addresses)
Normalizes all email addresses in the given list and decodes all IDNs.
Definition: email.cpp:985
int count() const
QByteArray firstEmailAddress(const QByteArray &addresses)
Returns the pure email address (addr-spec in RFC2822) of the first email address of a list of address...
Definition: email.cpp:699
typedef ConstIterator
QString simpleEmailAddressErrorMsg()
Returns a i18n string to be used in msgboxes.
Definition: email.cpp:666
int length() const
void reserve(int size)
char * data()
QString left(int n) const
bool compareEmail(const QString &email1, const QString &email2, bool matchName)
Compare two email addresses.
Definition: email.cpp:918
bool exactMatch(const QString &str) const
iterator begin()
bool extractEmailAddressAndName(const QString &aStr, QString &mail, QString &name)
Return email address and name from string.
Definition: email.cpp:724
QByteArray toUtf8() const
This file is part of the KDE documentation.
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
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.