class TImMessageField |
Parses email message header fields for valid Internet email addresses, comments and aliases.
A comment is a string surrounded by parentheses, as defined in RFC822, 3.1.4.
An alias is defined as any substring which appears to the left of a legal email address: for example, the string "this is an alias" in "this is an alias <[email protected]>".
For email addresses, the string being parsed: 1) must contain an @ character, surrounded by valid address characters; 2) may not contain more than one address or @ character; 3) may contain aliases and comments.
Note the following about the implementation of this class:
1. Functions that test subject lines, ValidSubjectLine(), and alias names, ValidAliasName(), were initially written to test that the strings did not contain characters outside a limited ASCII range. Unicode characters are now allowed, so these functions now always return true.
2. Of the four overloads of GetValidInternetEmailAddressFromString(), only the first has a meaningful implementation.
Private Member Functions | |
---|---|
TBool | LocateSubString(const TDesC16 &, const TInt, TInt &, TInt &) |
TBool | hasAngledBrackets(const TDesC16 &) |
TBool | isDotChar(const TChar &) |
TBool | isEnclosedSubString(const TDesC16 &, const TChar &, const TChar &, TInt &, TInt &) |
TBool | isLegalEmailAddress(const TDesC16 &, TInt &, TInt &) |
TBool | isSurroundedByAngledBrackets(const TDesC16 &, TInt &, TInt &, TInt) |
TBool | isSurroundedByRoundBrackets(const TDesC16 &, TInt &, TInt &) |
TBool | isValidChar(const TChar &) |
TBool | isValidDomainNameChar(const TChar &) |
TBool | isValidEmailAddress(const TDesC16 &, TInt &, TInt &) |
TBool | isValidEmailChar(const TChar &) |
TBool | isValidEmailString(const TDesC16 &, TInt &) |
TBool | isValidMailboxChar(const TChar &) |
TBool | isValidRoutedEmailAddress(const TDesC16 &) |
TBool | isValidString(const TDesC16 &, TInt &) |
TBool | isValid_ISO88591String(const TDesC16 &, TInt &) |
IMPORT_C TPtrC16 | GetValidAlias | ( | const TDesC16 & | aAddress | ) |
const TDesC16 & aAddress |
IMPORT_C TPtrC16 | GetValidAlias | ( | const TDesC16 & | aAddress, |
TInt & | rError | |||
) |
IMPORT_C TPtrC16 | GetValidComment | ( | const TDesC16 & | aAddress | ) |
const TDesC16 & aAddress |
IMPORT_C TPtrC16 | GetValidComment | ( | const TDesC16 & | aAddress, |
TInt & | rError | |||
) |
IMPORT_C TPtrC16 | GetValidInternetEmailAddressFromString | ( | const TDesC16 & | aAddress | ) |
const TDesC16 & aAddress |
IMPORT_C TPtrC16 | GetValidInternetEmailAddressFromString | ( | const TDesC16 & | aAddress, |
TInt & | rError | |||
) |
IMPORT_C TPtrC16 | GetValidInternetEmailAddressFromString | ( | const TDesC16 & | aAddress, |
TInt & | rFirstChar, | |||
TInt & | rLastChar | |||
) |
IMPORT_C TPtrC16 | GetValidInternetEmailAddressFromString | ( | const TDesC16 & | aAddress, |
TInt & | rFirstChar, | |||
TInt & | rLastChar, | |||
TInt & | rError | |||
) |
TBool | LocateSubString | ( | const TDesC16 & | anAddress, |
const TInt | atPos, | |||
TInt & | rFirstChar, | |||
TInt & | rLastChar | |||
) | [private] |
TBool | TruncateAddressString | ( | const TDesC16 & | aDesc, |
TInt | aLimit, | |||
TInt & | aLastChar | |||
) |
IMPORT_C TBool | ValidAliasName | ( | const TDesC16 & | aAliasName | ) |
const TDesC16 & aAliasName |
IMPORT_C TBool | ValidAliasName | ( | const TDesC16 & | aAliasName, |
TInt & | rFirstBadCharPos | |||
) |
IMPORT_C TBool | ValidInternetEmailAddress | ( | const TDesC16 & | aAddress | ) |
const TDesC16 & aAddress |
IMPORT_C TBool | ValidInternetEmailAddress | ( | const TDesC16 & | aAddress, |
TInt & | rFirstBadCharPos | |||
) |
IMPORT_C TBool | ValidInternetEmailAddress | ( | const TDesC16 & | aAddress, |
TInt & | rFirstChar, | |||
TInt & | rLastChar | |||
) |
IMPORT_C TBool | ValidInternetEmailAddress | ( | const TDesC16 & | aAddress, |
TInt & | rFirstChar, | |||
TInt & | rLastChar, | |||
TInt & | rFirstBadCharPos | |||
) |
IMPORT_C TBool | ValidInternetEmailAddressChar | ( | const TChar & | aChar | ) |
const TChar & aChar |
IMPORT_C TBool | ValidSubjectLine | ( | const TDesC16 & | aSubjectLine | ) |
const TDesC16 & aSubjectLine |
IMPORT_C TBool | ValidSubjectLine | ( | const TDesC16 & | aSubjectLine, |
TInt & | rFirstBadCharPos | |||
) |
IMPORT_C TBool | ValidSubjectLineChar | ( | const TChar & | aChar | ) |
const TChar & aChar |
TBool | hasAngledBrackets | ( | const TDesC16 & | anAddress | ) | [private] |
const TDesC16 & anAddress |
TBool | isEnclosedSubString | ( | const TDesC16 & | anAddress, |
const TChar & | aLeftBracket, | |||
const TChar & | aRightBracket, | |||
TInt & | aLeftPos, | |||
TInt & | aRightPos | |||
) | [private] |
TBool | isLegalEmailAddress | ( | const TDesC16 & | aAddress, |
TInt & | rFirstChar, | |||
TInt & | rLastChar | |||
) | [private] |
TBool | isSurroundedByAngledBrackets | ( | const TDesC16 & | aAddress, |
TInt & | rFirstChar, | |||
TInt & | rLastChar, | |||
TInt | aAtPos | |||
) | [private] |
TBool | isSurroundedByRoundBrackets | ( | const TDesC16 & | aAddress, |
TInt & | rFirstChar, | |||
TInt & | rLastChar | |||
) | [private] |
TBool | isValidChar | ( | const TChar & | aChar | ) | [private] |
const TChar & aChar |
TBool | isValidDomainNameChar | ( | const TChar & | aChar | ) | [private] |
const TChar & aChar |
TBool | isValidEmailAddress | ( | const TDesC16 & | aAddress, |
TInt & | rFirstChar, | |||
TInt & | rLastChar | |||
) | [private] |
TBool | isValidEmailChar | ( | const TChar & | aChar | ) | [private] |
const TChar & aChar |
TBool | isValidEmailString | ( | const TDesC16 & | anAddress, |
TInt & | aFirstBadCharPos | |||
) | [private] |
TBool | isValidMailboxChar | ( | const TChar & | aChar | ) | [private] |
const TChar & aChar |
TBool | isValidRoutedEmailAddress | ( | const TDesC16 & | anAddress | ) | [private] |
const TDesC16 & anAddress |