SophiaFramework UNIVERSE 5.3 |
The SFXMailUtility class provides functions for parsing the header of the mail message based on RFC2822 (Internet Message Format) and the functions for processing about Base64, QuotedPrintable, MD5 etc.
To parse the entire mail message, use the SFXMailMessage class. While to parse the mail message in the MIME encode defined in RFC2047 (MIME Part Three : Message Header Extensions for Non-ASCII Text), use the SFXMailField class.
Public Functions | |
---|---|
static SFCError |
DecodeBase64(
ACharConstPtr in
, UInt32 size
, SFXBufferPtr out
) Decode the data encoded in the Base64 format.
|
static SFCError |
DecodeBase64(
SFXBufferConstRef in
, SFXBufferPtr out
) Decode the data encoded in the Base64 format.
|
static SFCError |
DecodeBase64(
SFXAnsiStringConstRef in
, SFXAnsiStringPtr out
) Decode the data encoded in the Base64 format.
|
static SFCError |
DecodeQuotedPrintable(
ACharConstPtr in
, UInt32 size
, SFXBufferPtr out
, Bool text = true
) Decode the data encoded in the Quoted-Printable format.
|
static SFCError |
DecodeQuotedPrintable(
SFXBufferConstRef in
, SFXBufferPtr out
, Bool text = true
) Decode the data encoded in the Quoted-Printable format.
|
static SFCError |
DecodeQuotedPrintable(
SFXAnsiStringConstRef in
, SFXAnsiStringPtr out
, Bool text = true
) Decode the data encoded in the Quoted-Printable format.
|
static SFCError |
EncodeBase64(
ACharConstPtr in
, UInt32 size
, SFXBufferPtr out
, UInt32 chars = 64
, SFXAnsiStringConstRef delimiter = "\r\n"
) Encode the data in the Base64 format.
|
static SFCError |
EncodeBase64(
SFXBufferConstRef in
, SFXBufferPtr out
, UInt32 chars = 64
, SFXAnsiStringConstRef delimiter = "\r\n"
) Encode the data in the Base64 format.
|
static SFCError |
EncodeBase64(
SFXAnsiStringConstRef in
, SFXAnsiStringPtr out
, UInt32 chars = 64
, SFXAnsiStringConstRef delimiter = "\r\n"
) Encode the data in the Base64 format.
|
static SFCError |
EncodeQuotedPrintable(
ACharConstPtr in
, UInt32 size
, SFXBufferPtr out
, UInt32 chars = 64
, Bool text = true
) Encode the data in the Quoted-Printable format.
|
static SFCError |
EncodeQuotedPrintable(
SFXBufferConstRef in
, SFXBufferPtr out
, UInt32 chars = 64
, Bool text = true
) Encode the data in the Quoted-Printable format.
|
static SFCError |
EncodeQuotedPrintable(
SFXAnsiStringConstRef in
, SFXAnsiStringPtr out
, UInt32 chars = 64
, Bool text = true
) Encode the data in the Quoted-Printable format.
|
static Bool |
FindNextBoundary(
ACharConstPtr start
, ACharConstPtr end
, SFXAnsiStringConstRef boundary
, ACharConstHandle found
, ACharConstHandle next
) Find the next "boundary" string in the MIME document.
|
static UInt32 |
GetEncodedSizeBase64(
UInt32 size
, UInt32 chars
, UInt32 delimiter
) Get the size of the data when encoded in the Base64 format.
|
static UInt32 |
GetEncodedSizeQuotedPrintable(
ACharConstPtr in
, UInt32 size
, UInt32 chars
, Bool text
) Get the size of the data when encoded in the Quoted-Printable format.
|
static SFCError |
GetHMACMD5(
VoidConstPtr in
, UInt32 size
, SFXBufferConstRef key
, SFXBufferPtr out
, Bool isXdigit
) Get the HMAC-MD5.
|
static SFCError |
GetHMACMD5(
SFXBufferConstRef in
, SFXBufferConstRef key
, SFXBufferPtr out
, Bool isXdigit
) Get the HMAC-MD5.
|
static SFCError |
GetHMACMD5(
SFXAnsiStringConstRef in
, SFXAnsiStringConstRef key
, SFXAnsiStringPtr out
, Bool isXdigit
) Get the HMAC-MD5.
|
static SFCError |
GetKeyedMD5(
VoidConstPtr datagram
, UInt32 size
, SFXBufferConstRef key
, AChar keyfill
, SFXBufferPtr out
, Bool isXdigit
) Get the Keyed-MD5.
|
static SFCError |
GetKeyedMD5(
SFXBufferConstRef datagram
, SFXBufferConstRef key
, AChar keyfill
, SFXBufferPtr out
, Bool isXdigit
) Get the Keyed-MD5.
|
static SFCError |
GetKeyedMD5(
SFXAnsiStringConstRef datagram
, SFXAnsiStringConstRef key
, AChar keyfill
, SFXAnsiStringPtr out
, Bool isXdigit
) Get the Keyed-MD5.
|
static SFCError |
GetMD5(
VoidConstPtr in
, UInt32 size
, SFXBufferPtr out
, Bool isXdigit
) Get the MD5.
|
static SFCError |
GetMD5(
SFXBufferConstRef in
, SFXBufferPtr out
, Bool isXdigit
) Get the MD5.
|
static SFCError |
GetMD5(
SFXAnsiStringConstRef in
, SFXAnsiStringPtr out
, Bool isXdigit
) Get the MD5.
|
static SInt16 |
HexToByte(
AChar c1
, AChar c2
) Convert two hexadecimal digits into the integer value.
|
static SInt16 |
HexToNibble(
AChar c
) Convert one hexadecimal digit into the integer value.
|
static Bool |
IsAtext(
AChar c
) Check whether or not the specified character is atext.
|
static Bool |
IsCTL(
AChar c
) Check whether or not the specified character is control.
|
static Bool |
IsTokenChar(
AChar c
) Check whether or not the specified character is for token.
|
static Bool |
IsTspecials(
AChar c
) Check whether or not the specified character is TSPECIAL.
|
static Bool |
IsValidFieldName(
ACharConstPtr start
, ACharConstPtr end = null
) Check whether or not the specified string is valid for the field name of the mail header.
|
static Bool |
IsWSP(
AChar c
) Check whether or not the specified character is a white space(a space character or a tab character).
|
static SFCError |
JISToShiftJIS(
SFXAnsiStringConstRef in
, SFXAnsiStringPtr out
, AChar unconvChar = '\0'
) Convert string in JIS code (iso-2022-jp) into Shift_JIS code.
|
static AChar |
NibbleToHex(
Byte nibble
) Convert an integer value into a hexadecimal digit.
|
static SFCError |
ParseAddrSpec(
ACharConstPtr start
, ACharConstPtr end
, ACharConstHandle next
, SFXAnsiStringPtr value
) Get the specified string as mail address (addr-spec).
|
static SFCError |
ParseAtom(
ACharConstPtr start
, ACharConstPtr end
, ACharConstHandle next
, SFXAnsiStringPtr value
) Get the specified string as atom.
|
static SFCError |
ParseContentType(
SFXAnsiStringConstRef fieldValue
, SFXAnsiStringPtr mainType
, SFXAnsiStringPtr subType
, SFXPropertyPtr paramList
) Get the specified string as data of the Content-Type field.
|
static SFCError |
ParseDate(
ACharConstPtr start
, ACharConstPtr end
, ACharConstHandle next
, SFXDatePtr date
, SInt16Ptr zone
) Get the specified string as date.
|
static SFCError |
ParseDate(
SFXAnsiStringConstRef str
, SFXDatePtr date
, SInt16Ptr zone
) Get the specified string as date.
|
static SFCError |
ParseDotAtom(
ACharConstPtr start
, ACharConstPtr end
, ACharConstHandle next
, SFXAnsiStringPtr value
) Get the specified string as dot-atom.
|
static SFCError |
ParseDotAtomText(
ACharConstPtr start
, ACharConstPtr end
, ACharConstHandle next
, SFXAnsiStringPtr value
) Get the specified string as dot-atom-text.
|
static SFCError |
ParseHeaderLine(
ACharConstPtr start
, ACharConstPtr end
, ACharConstHandle next
, SFXAnsiStringPtr value1
, SFXAnsiStringPtr value2
) Get one line of the mail header.
|
static SFCError |
ParseMailbox(
ACharConstPtr start
, ACharConstPtr end
, ACharConstHandle next
, SFXAnsiStringPtr name
, SFXAnsiStringPtr addr
) Get the specified string as mail address (mail box).
|
static SFCError |
ParseMailbox(
SFXAnsiStringConstRef str
, SFXAnsiStringPtr name
, SFXAnsiStringPtr addr
) Get the specified string as mail address (mail box).
|
static SFCError |
ParseMailboxList(
ACharConstPtr start
, ACharConstPtr end
, ACharConstHandle next
, MailboxHandle mailboxes
, SInt32Ptr mbxCount
) Get the specified string as list of mail addresses (mailbox).
|
static SFCError |
ParseMailboxList(
SFXAnsiStringConstRef str
, MailboxHandle mailboxes
, SInt32Ptr mbxCount
) Get the specified string as list of mail addresses (mailbox).
|
static SFCError |
ParseParameter(
ACharConstPtr start
, ACharConstPtr end
, ACharConstHandle next
, SFXAnsiStringPtr name
, SFXAnsiStringPtr value
) Get the specified string as parameter.
|
static SFCError |
ParseParameterList(
ACharConstPtr start
, ACharConstPtr end
, SFXPropertyPtr paramList
) Get the specified string as list of parameters.
|
static SFCError |
ParsePhrase(
ACharConstPtr start
, ACharConstPtr end
, ACharConstHandle next
, SFXAnsiStringPtr value
) Get the specified string as phrase.
|
static SFCError |
ParseQuotedString(
ACharConstPtr start
, ACharConstPtr end
, ACharConstHandle next
, SFXAnsiStringPtr value
) Get the specified string as quoted-string.
|
static SFCError |
ParseToken(
ACharConstPtr start
, ACharConstPtr end
, ACharConstHandle next
, SFXAnsiStringPtr value
) Get the specified string as token.
|
static SFCError |
ParseWord(
ACharConstPtr start
, ACharConstPtr end
, ACharConstHandle next
, SFXAnsiStringPtr value
) Get the specified string as word.
|
static SFCError |
ShiftJISToJIS(
SFXAnsiStringConstRef in
, SFXAnsiStringPtr out
, AChar unconvChar = '\0'
) Convert the specified string in Shift_JIS code into JIS code (iso-2022-jp).
|
static Void |
SkipUntilCRLF(
ACharConstHandle start
) Get the position of the next CRLF or '\0' chararacter.
|
static Void |
SkipWSP(
ACharConstHandle start
, ACharConstPtr end
) Advance the pointer to the first character other than WSP(space or horizontal tab) or the ending position specified.
|
Types |
---|
Mailbox Structure that represents a mail address.
|
[ public, static ] SFCError DecodeBase64( ACharConstPtr in // pointer to the data encoded in the Base64 format UInt32 size // size of the data encoded in the Base64 format SFXBufferPtr out // pointer to the output buffer );
[ public, static ] SFCError DecodeBase64( SFXBufferConstRef in // reference to the data encoded in the Base64 format SFXBufferPtr out // pointer to the output buffer );
[ public, static ] SFCError DecodeBase64( SFXAnsiStringConstRef in // reference to the data encoded in the Base64 format SFXAnsiStringPtr out // pointer to the output buffer );
This function decodes the data encoded in the Base64 format.
This function differs from the SFBWebUtil::DecodeBase64 function in that the delimiter string will be processed(or ignored).
About Base64 | |
---|---|
For more detailed information, see RFC2045: 6.8. Base64 Content-Transfer-Encoding |
SFXMailUtility::EncodeBase64 | SFXMailUtility::GetEncodedSizeBase64 | BREW API IWEBUTIL_DecodeBase64 | RFC2045: 6.8. Base64 Content-Transfer-Encoding
[ public, static ] SFCError DecodeQuotedPrintable( ACharConstPtr in // pointer to the data encoded in the Quoted-Printable format UInt32 size // size of the data encoded in the Quoted-Printable format SFXBufferPtr out // pointer to the output buffer Bool text = true // text mode );
[ public, static ] SFCError DecodeQuotedPrintable( SFXBufferConstRef in // reference to the data encoded in the Quoted-Printable format SFXBufferPtr out // pointer to the output buffer Bool text = true // text mode );
[ public, static ] SFCError DecodeQuotedPrintable( SFXAnsiStringConstRef in // reference to the data encoded in the Quoted-Printable format SFXAnsiStringPtr out // pointer to the output buffer Bool text = true // text mode );
This function decodes the data encoded in the Quoted-Printable format.
Invalid characters and CRLF characters are ignored when decoding.
Caution | |
---|---|
If there are invalid characters, decoding ends normally though the return value is SFERR_INVALID_FORMAT. |
About Quoted-Printable | |
---|---|
For more detailed information, see RFC2045: 6.7. Quoted-Printable Content-Transfer-Encoding |
SFXMailUtility::EncodeQuotedPrintable | SFXMailUtility::GetEncodedSizeQuotedPrintable | RFC2045: 6.7. Quoted-Printable Content-Transfer-Encoding
[ public, static ] SFCError EncodeBase64( ACharConstPtr in // pointer to the data to be encoded UInt32 size // data size SFXBufferPtr out // pointer to the output buffer UInt32 chars = 64 // number of characters per line SFXAnsiStringConstRef delimiter = "\r\n" // line feed and carriage return characters );
[ public, static ] SFCError EncodeBase64( SFXBufferConstRef in // reference to the data to be encoded SFXBufferPtr out // pointer to the output buffer UInt32 chars = 64 // number of characters per line SFXAnsiStringConstRef delimiter = "\r\n" // line feed and carriage return characters );
[ public, static ] SFCError EncodeBase64( SFXAnsiStringConstRef in // reference to the data to be encoded SFXAnsiStringPtr out // pointer to the output buffer UInt32 chars = 64 // number of characters per line SFXAnsiStringConstRef delimiter = "\r\n" // CRLF characters );
This function encodes the data in the Base64 format.
This function differs from the SFBWebUtil::EncodeBase64 function in that the delimiter string will be processed.
About Base64 | |
---|---|
For more detailed information, see RFC2045: 6.8. Base64 Content-Transfer-Encoding |
SFXMailUtility::DecodeBase64 | SFXMailUtility::GetEncodedSizeBase64 | SFBWebUtil::EncodeBase64 | BREW API IWEBUTIL_EncodeBase64 | RFC2045: 6.8. Base64 Content-Transfer-Encoding
[ public, static ] SFCError EncodeQuotedPrintable( ACharConstPtr in // pointer to the data to be encoded in the Quoted-Printable format UInt32 size // data size SFXBufferPtr out // pointer to the output buffer UInt32 chars = 64 // number of characters per line Bool text = true // text mode or not? );
[ public, static ] SFCError EncodeQuotedPrintable( SFXBufferConstRef in // reference to the data to be encoded in the Quoted-Printable format SFXBufferPtr out // pointer to the output buffer UInt32 chars = 64 // number of characters of first line Bool text = true // whether text mode or not? );
[ public, static ] SFCError EncodeQuotedPrintable( SFXAnsiStringConstRef in // reference to the data to be encoded in the Quoted-Printable format SFXAnsiStringPtr out // pointer to the output buffer UInt32 chars = 64 // number of characters of first line Bool text = true // whether text mode or not );
This function encodes the data in the Quoted-Printable format.
The CRLF characters will be appended at the end of each line when encoding.
About Quoted-Printable | |
---|---|
For more detailed information, see RFC2045: 6.7. Quoted-Printable Content-Transfer-Encoding |
SFXMailUtility::DecodeQuotedPrintable | SFXMailUtility::GetEncodedSizeQuotedPrintable | RFC2045: 6.7. Quoted-Printable Content-Transfer-Encoding
[ public, static ] Bool FindNextBoundary( ACharConstPtr start // pointer to the starting position to search for the "boundary" string ACharConstPtr end // pointer to the end position to search for the "boundary" string SFXAnsiStringConstRef boundary // "boundary" string ACharConstHandle found // handle to store the pointer to the position of the "boundary" string to be found ACharConstHandle next // handle to store the pointer to the next position of the "boundary" string to be found );
Pointer to the head of the MIME document to be searched for.
Pointer to the end of the MIME document to be searched for. The character pointed by this pointer will not be searched for.
The "boundary" string to be searched for.
Handle to store the pointer to the CR character of the CRLF immediately before the "boundary" string to be found. Specify null if unnecessary.
Handle to store the pointer to the next character of the CRLF immediately after the "boundary" string to be found or the end position to search for the "boundary" string. Specify null if unnecessary.
Return true if the non-end-boundary is found.(end-boundary: string composed of '--' and "boundary" and '--')
Return false if the end-boundary is found.
Return false if the end-boundary is not found until the end of the MIME document to be searched for. In this case, the value of "end" argument will be set to both the "found" and "next" argument.
About boundary: RFC2049 (MIME Part Five : Conformance Criteria and Examples. Appendix A -- A Complex Multipart Example)
[ public, static ] UInt32 GetEncodedSizeBase64( UInt32 size // size of the data when encoded in the Base64 format UInt32 chars // number of characters per line UInt32 delimiter // length of the line feed and carriage return characters );
SFXMailUtility::EncodeBase64 | SFXMailUtility::DecodeBase64 | RFC2045: 6.8. Base64 Content-Transfer-Encoding
[ public, static ] UInt32 GetEncodedSizeQuotedPrintable( ACharConstPtr in // data to be encoded in the Quoted-Printable format UInt32 size // size of the data when encoded in the Quoted-Printable format UInt32 chars // number of characters per line Bool text // whether text mode or not );
SFXMailUtility::EncodeQuotedPrintable | SFXMailUtility::DecodeQuotedPrintable | RFC2045: 6.7. Quoted-Printable Content-Transfer-Encoding
[ public, static ] SFCError GetHMACMD5( VoidConstPtr in // input data UInt32 size // size of input data SFXBufferConstRef key // reference to the key SFXBufferPtr out // pointer to the output buffer Bool isXdigit // whether or not to output the HMAC-MD5 as hexadecimal digits );
[ public, static ] SFCError GetHMACMD5( SFXBufferConstRef in // input data SFXBufferConstRef key // reference to the key SFXBufferPtr out // pointer to the output buffer Bool isXdigit // whether or not to output the HMAC-MD5 as hexadecimal digits );
[ public, static ] SFCError GetHMACMD5( SFXAnsiStringConstRef in // input data SFXAnsiStringConstRef key // reference to the key SFXAnsiStringPtr out // pointer to the output string Bool isXdigit // whether or not to output the HMAC-MD5 as hexadecimal digits );
SFXMailUtility::GetMD5 | SFXMailUtility::GetKeyedMD5 | RFC2104: HMAC: Keyed-Hashing for Message Authentication | RFC1321: The MD5 Message-Digest Algorithm
[ public, static ] SFCError GetKeyedMD5( VoidConstPtr datagram // input data UInt32 size // size of input data SFXBufferConstRef key // reference to the key AChar keyfill // pad SFXBufferPtr out // pointer to the output buffer Bool isXdigit // whether or not to output the Keyed-MD5 as hexadecimal digits );
[ public, static ] SFCError GetKeyedMD5( SFXBufferConstRef datagram // input data SFXBufferConstRef key // reference to the key AChar keyfill // pad SFXBufferPtr out // pointer to the output buffer Bool isXdigit // whether or not to output the Keyed-MD5 as hexadecimal digits );
[ public, static ] SFCError GetKeyedMD5( SFXAnsiStringConstRef datagram // input data SFXAnsiStringConstRef key // key AChar keyfill // pad SFXAnsiStringPtr out // pointer to the output string Bool isXdigit // whether or not to output the Keyed-MD5 as hexadecimal digits );
SFXMailUtility::GetMD5 | SFXMailUtility::GetHMACMD5 | RFC1828: IP Authentication using Keyed MD5 | RFC1321: The MD5 Message-Digest Algorithm
[ public, static ] SFCError GetMD5( VoidConstPtr in // input data UInt32 size // size of input data SFXBufferPtr out // pointer to the output buffer Bool isXdigit // whether or not to output the MD5 as hexadecimal digits );
[ public, static ] SFCError GetMD5( SFXBufferConstRef in // input data SFXBufferPtr out // pointer to the output buffer Bool isXdigit // whether or not to output the MD5 as hexadecimal digits );
[ public, static ] SFCError GetMD5( SFXAnsiStringConstRef in // input data SFXAnsiStringPtr out // pointer to the output string Bool isXdigit // whether or not to output the MD5 as hexadecimal digits );
This function uses the SFBHash class internally.
SFXMailUtility::GetKeyedMD5 | SFXMailUtility::GetHMACMD5 | SFBHash | RFC1321: The MD5 Message-Digest Algorithm
[ public, static ] SInt16 HexToByte( AChar c1 // upper character of two hexadecimal digits to be converted AChar c2 // lower character of two hexadecimal digits to be converted );
For example, 1B (c1 = '1', c2 = 'B') is converted into 27.
For example, '1' is converted into 1, and 'f' is converted into 15.
Specify the character to be checked.
This function checks whether or not the specified character is atext.
An atext character is an alphanumeric for atom, or a symbol such as "!", "#", "$", "%"
About atext | |
---|---|
For more detailed information, see RFC2822: 3.2.4. Atom. |
SFXMailUtility::ParseAtom | SFXMailUtility::ParseDate | SFXMailUtility::ParseDotAtom | SFXMailUtility::ParseDotAtomText | SFXMailUtility::IsCTL | SFXMailUtility::IsTokenChar | SFXMailUtility::IsTspecials | SFXMailUtility::IsWSP | RFC2822: 3.2.4. Atom
Specify the character to be checked.
The code of a control character is greater than or equals "0x00" and less than or equals "0x1F", or "0x7F".
SFXMailUtility::IsAtext | SFXMailUtility::IsTokenChar | SFXMailUtility::IsTspecials | SFXMailUtility::IsWSP
Specify the character to be checked.
This function checks whether or not the specified character is for a token.
About a character for token | |
---|---|
A character for a token is any character except SPACE, CTLs, or TSPECIALs. For more detailed information, see RFC2045: Appendix A -- Collected Grammar. |
SFXMailUtility::ParseToken | SFXMailUtility::IsAtext | SFXMailUtility::IsCTL | SFXMailUtility::IsTspecials | SFXMailUtility::IsWSP | RFC2045: Appendix A -- Collected Grammar
Specify the character to be checked.
This function checks whether or not the specified character is TSPECIAL.
About TSPECIAL | |
---|---|
A TSPECIAL character is a symbol that needs to be quoted (") if the header field is treated as data. For more detailed information, see RFC2045: Appendix A -- Collected Grammar. |
SFXMailUtility::IsAtext | SFXMailUtility::IsCTL | SFXMailUtility::IsTokenChar | SFXMailUtility::IsWSP | RFC2045: Appendix A -- Collected Grammar
[ public, static ] Bool IsValidFieldName( ACharConstPtr start // pointer to the starting character of the field ACharConstPtr end = null // pointer to the end character of the field );
Specify the head of the field.
Specify the end of the field. '\0' is regarded as the end character if null is specified.
Specify the character to be checked.
This function checks whether or not the specified character is a white space(space["0x20"] or tab["0x09"]).
SFXMailUtility::SkipWSP | SFXMailUtility::IsAtext | SFXMailUtility::IsCTL | SFXMailUtility::IsTokenChar | SFXMailUtility::IsTspecials | RFC2822: 2.2.2. Structured Header Field Bodies
[ public, static ] SFCError JISToShiftJIS( SFXAnsiStringConstRef in // reference to the string to be converted SFXAnsiStringPtr out // pointer to the converted string AChar unconvChar = '\0' // alternative character for the character that cannot be converted );
Specify a string to be converted in JIS code (iso-2022-jp).
The pointer to the converted string will be returned.
Specify an alternative character for the character that cannot be converted. The default value of this argument is '\0', which means that this sub-function is invalid.
If the "unconvChar" argument is specified, characters that cannot be converted will be substituted with the value of "unconvChar" argument and the return value will be SFERR_NO_ERROR.
The half-width kana is supported.
SFXMailUtility::ShiftJISToJIS | RFC1468: Japanese Character Encoding for Internet Messages
For example, 1 is converted into '1', and '11' is converted into 'B'.
[ public, static ] SFCError ParseAddrSpec( ACharConstPtr start // pointer to the head of string to be parsed ACharConstPtr end // pointer to the end of string to be parsed ACharConstHandle next // handle of the pointer to the end position to be parsed SFXAnsiStringPtr value // pointer to the parsing result: mail address (addr-spec) );
Specify a pointer to the head of string to be parsed.
Specify a pointer to the end of string to be parsed. The character pointed by this pointer will not be parsed.
Specify a handle to store the pointer to the next character after the parsed string of mail address(addr-spec). Specify null if unnecessary.
Specify a pointer to the variable to store the parsed string of mail address(addr-spec). Specify null if unnecessary.
This function parses the specified string and get the parsed mail address, which is defined in RFC2822: 3.4.1. Addr-spec specification.
The SFXMailUtility::ParseMailbox and SFXMailUtility::ParseMailboxList functions needs to be used when parsing the mail addresses of the "From:" and the "To:" fields.
SFXMailUtility::ParseDotAtom | SFXMailUtility::SkipWSP | RFC2822: 3.4.1. Addr-spec specification
[ public, static ] SFCError ParseAtom( ACharConstPtr start // pointer to the head of string to be parsed ACharConstPtr end // pointer to the end of string to be parsed ACharConstHandle next // handle of the pointer to the end position to be parsed SFXAnsiStringPtr value // pointer to parsing result's atom );
Specify a pointer to the head of string to be parsed.
Specify a pointer to the end of string to be parsed. The character pointed by this address is not parsed.
Specify a handle to store the pointer to the next character after the parsed string of atom. Specify null if unnecessary.
Specify a pointer to the variable to store the parsed string of atom. Specify null if unnecessary.
This function parses the specified string and get the parsed atom, which is defined in RFC2822: 3.2.4. Atom.
SFXMailUtility::ParseDotAtom | SFXMailUtility::ParseDotAtomText | SFXMailUtility::SkipWSP | SFXMailUtility::IsAtext | RFC2822: 3.2.4. Atom
[ public, static ] SFCError ParseContentType( SFXAnsiStringConstRef fieldValue // string to be parsed SFXAnsiStringPtr mainType // type SFXAnsiStringPtr subType // subtype SFXPropertyPtr paramList // parameter );
Specify a string to be parsed.
Specify a pointer to the variable to store the parsed string of Content-Type. Specify null if unnecessary.
Specify a pointer to the variable to store the parsed string of Content-Subtype. Specify null if unnecessary.
Specify a pointer to the variable to store the parsed list of parameters. Specify null if unnecessary.
This function parses the specified string and get the parsed data of the Content-Type field, which is defined in RFC2045: 5. Content-Type Header Field.
SFXMailUtility::ParseParameterList | SFXMailUtility::ParseParameter | SFXMailUtility::ParseToken | SFXMailUtility::SkipWSP | RFC2045: 5. Content-Type Header Field
[ public, static ] SFCError ParseDate( ACharConstPtr start // pointer to the head of string to be parsed ACharConstPtr end // pointer to the end of string to be parsed ACharConstHandle next // handle of the pointer to the end position to be parsed SFXDatePtr date // pointer to the date SInt16Ptr zone // pointer to the timezone );
[ public, static ] SFCError ParseDate( SFXAnsiStringConstRef str // string to be parsed SFXDatePtr date // pointer to the date SInt16Ptr zone // pointer to the timezon );
Specify a pointer to the head of string to be parsed.
Specify a pointer to the end of string to be parsed. The character pointed by this pointer will not be parsed.
Specify a handle to store the pointer to the next character after the parsed date. Specify null if unnecessary.
Specify a pointer to the variable to store the parsed date. Specify null if unnecessary.
Specify a pointer to the variable to store the parsed timezone, which is different from the UTC. Specify null if unnecessary.
Specify a string to be parsed.
This function parses the specified string and get the parsed date, which is defined in RFC2822: 3.3. Date and Time Specification.
SFXDate::Parse | SFXMailUtility::SkipWSP | SFXDate | RFC2822: 3.3. Date and Time Specification
[ public, static ] SFCError ParseDotAtom( ACharConstPtr start // pointer to the head of string to be parsed ACharConstPtr end // pointer to the end of string to be parsed ACharConstHandle next // handle of the pointer to the end position to be parsed SFXAnsiStringPtr value // pointer to the parsing result: dot-atom );
Specify a pointer to the head of string to be parsed.
Specify a pointer to the end of string to be parsed. The character pointed by this pointer will not be parsed.
Specify a handle to store the pointer to the next character after the parsed dot-atom. Specify null if unnecessary.
Specify a pointer to the variable to store the parsed dot-atom. Specify null if unnecessary.
This function parses the specified string and get the parsed dot-atom, which is defined in RFC2822: 3.2.4. Atom.
The dot-atom differs from the dot-atom-text only in that there may be the white space characters in the beginning or end of the dot-atom.
This function skips the biginning white space characters of the specified string.
SFXMailUtility::ParseAtom | SFXMailUtility::ParseDotAtomText | SFXMailUtility::IsAtext | RFC2822: 3.2.4. Atom
[ public, static ] SFCError ParseDotAtomText( ACharConstPtr start // pointer to the head of string to be parsed ACharConstPtr end // pointer to the end of string to be parsed ACharConstHandle next // handle of the pointer to the end position to be parsed SFXAnsiStringPtr value // pointer to the parsing result: dot-atom-text );
Specify a pointer to the head of string to be parsed.
Specify a pointer to the end of string to be parsed. The character pointed by this pointer will not be parsed.
Specify a handle to store the pointer to the next character after the parsed dot-atom-text. Specify null if unnecessary.
Specify a pointer to the variable to store the parsed dot-atom-text. Specify null if unnecessary.
This function parses the specified string and get the parsed dot-atom-text, which is defined in RFC2822: 3.2.4. Atom.
The dot-atom-text is a string that consists of atext and period '.'. In the dot-atom-text, a period cannot be put at the beginning or end and two successive periods cannot be permitted .
This function does not skip the biginning white space characters of the specified string.
If the first character of the specified string is white space, SFERR_INVALID_FORMAT will be returned.
SFXMailUtility::ParseAtom | SFXMailUtility::ParseDate | SFXMailUtility::ParseDotAtom | SFXMailUtility::IsAtext | RFC2822: 3.2.4. Atom
[ public, static ] SFCError ParseHeaderLine( ACharConstPtr start // pointer to the head of string to be parsed ACharConstPtr end // pointer to the end of string to be parsed ACharConstHandle next // handle of the pointer to the end position to be parsed SFXAnsiStringPtr value1 // pointer to the parsing result: field name SFXAnsiStringPtr value2 // pointer to the parsing result: field value );
Specify a pointer to the head of string to be parsed.
Specify a pointer to the end of string to be parsed. The character pointed by this pointer will not be parsed.
Specify a handle to store the pointer to the next line. Specify null if unnecessary.
Specify a pointer to the variable to store the parsed field name. Specify null if unnecessary.
Specify a pointer to the variable to store the parsed field value. Specify null if unnecessary.
This function parses and gets one line of the mail header. A line can be also obtained correctly even if the mail header is divided into multiple lines (from line 2, it starts from WSP).
SFXMailUtility::SkipWSP | SFXMailUtility::IsValidFieldName | SFXMailUtility::IsWSP | RFC2822: 2.2. Header Fields
[ public, static ] SFCError ParseMailbox( ACharConstPtr start // pointer to the head of string to be parsed ACharConstPtr end // pointer to the end of string to be parsed ACharConstHandle next // handle of the pointer to the end position to be parsed SFXAnsiStringPtr name // pointer to the parsing result name SFXAnsiStringPtr addr // pointer to the parsing result's mail address (maibox) );
[ public, static ] SFCError ParseMailbox( SFXAnsiStringConstRef str // string to be parsed SFXAnsiStringPtr name // pointer to the parsed name SFXAnsiStringPtr addr // pointer to the parsing result: mail address (maibox) );
Specify a pointer to the head of string to be parsed.
Specify a pointer to the end of string to be parsed. The character pointed by this pointer will not be parsed.
Specify a handle to store the pointer to the next character after the parsed mail address. Specify null if unnecessary.
Specify a pointer to the variable to store the parsed name. Specify null if unnecessary.
Specify a pointer to the variable to store the parsed mail address. Specify null if unnecessary.
Specify a string to be parsed.
This function parses the specified string and get the parsed mail address(mailbox), which is defined in RFC2822: 3.4.1. Addr-spec specification.
This function can parse the "addr-spec" format of (1) and (2), and the "name-addr" format of (3).
[email protected] (My Name)
My Name <[email protected]>
In case of (2) and (3), dispaly name (My Name) can also be obtained. The SFXMailUtility::ParseMailbox function can parse only one mailbox.
To parse the list of mailboxes, use the SFXMailUtility::ParseMailboxList function.
SFXMailUtility::ParseMailboxList | SFXMailUtility::ParseAddrSpec | SFXMailUtility::ParsePhrase | SFXMailUtility::SkipWSP | RFC2822: 3.4.1. Addr-spec specification
[ public, static ] SFCError ParseMailboxList( ACharConstPtr start // pointer to the head of string to be parsed ACharConstPtr end // pointer to the end of string to be parsed ACharConstHandle next // handle of the pointer to the end position to be parsed MailboxHandle mailboxes // list of mail address SInt32Ptr mbxCount // number of mail addresses );
[ public, static ] SFCError ParseMailboxList( SFXAnsiStringConstRef str // character string to be parsed MailboxHandle mailboxes // list of mail address SInt32Ptr mbxCount // number of mail addresses );
Specify a pointer to the head of string to be parsed.
Specify a pointer to the end of string to be parsed. The character pointed by this pointer will not be parsed.
Specify a handle to store the pointer to the next character after the parsed mail addresses. Specify null if unnecessary.
Specify a handle to store the pointer to the parsed list of mail addresses. The SFXMailUtility::Mailbox array will be passed.
This array must be released using the "delete[]" operator by the caller. Specify null if unnecessary.
Specify a pointer to the variable to store the parsed number of mail addresses. The parsed will be returned. Specify null if unnecessary.
Specify a string to be parsed.
This function parses the specified string and get the parsed list of mail addresses (mailbox), which is defined in RFC2822: 3.4.1. Addr-spec specification.
SFXMailUtility::ParseMailbox | SFXMailUtility::SkipWSP | RFC2822: 3.4.1. Addr-spec specification
[ public, static ] SFCError ParseParameter( ACharConstPtr start // pointer to the head of string to be parsed ACharConstPtr end // pointer to the end of string to be parsed ACharConstHandle next // handle of the pointer to the end position to be parsed SFXAnsiStringPtr name // pointer to the parsed name of parameter SFXAnsiStringPtr value // pointer to the parsed value of parameter );
Specify a pointer to the head of string to be parsed.
Specify a pointer to the end of string to be parsed. The character pointed by this pointer will not be parsed.
Specify a handle to store the pointer to the next character after the parsed parameter. Specify null if unnecessary.
Specify a pointer to the variable to store the parsed name of parameter. Specify null if unnecessary.
Specify a pointer to the variable to store the parsed value of parameter. Specify null if unnecessary.
This function parses the specified string and get the parameter like "attribute = value", which is defined in RFC2045: 5. Content-Type Header Field.
This function can parse only one parameter.
To parse the list of parameters, use the SFXMailUtility::ParseParameterList function.
SFXMailUtility::ParseParameterList | SFXMailUtility::ParseQuotedString | SFXMailUtility::ParseToken | SFXMailUtility::SkipWSP | RFC2045: 5. Content-Type Header Field
[ public, static ] SFCError ParseParameterList( ACharConstPtr start // pointer to the head of string to be parsed ACharConstPtr end // pointer to the end of string to be parsed SFXPropertyPtr paramList // pointer to the parsing result: list of parameters );
Specify a pointer to the head of string to be parsed.
Specify a pointer to the end of string to be parsed. The character pointed by this pointer will not be parsed.
Specify a pointer to the variable to store the parsed list of parameters. Specify null if unnecessary.
This function parses the specified string and get the list of parameters like "attr1 = value1; attr2 = value2; ... ", which is defined in RFC2045: 5. Content-Type Header Field.
SFXMailUtility::ParseParameter | SFXMailUtility::SkipWSP | RFC2045: 5. Content-Type Header Field
[ public, static ] SFCError ParsePhrase( ACharConstPtr start // pointer to the head of string to be parsed ACharConstPtr end // pointer to the end of string to be parsed ACharConstHandle next // handle of the pointer to the end position to be parsed SFXAnsiStringPtr value // pointer to the parsing result: phrase );
Specify a pointer to the head of string to be parsed.
Specify a pointer to the end of string to be parsed. The character pointed by this pointer will not be parsed.
Specify a handle to store the pointer to the next character after the parsed phrase. Specify null if unnecessary.
Specify a pointer to the variable to store the parsed phrase. Specify null if unnecessary.
This function parses the specified string and get the parsed phrase, which is defined in RFC2822: 3.2.6. Miscellaneous tokens. A phrase consists of one or more words.
This function returns the unquoted string in which each word is tied with a white space character.
SFXMailUtility::ParseMailbox | SFXMailUtility::ParseWord | SFXMailUtility::SkipWSP | RFC2822: 3.2.6. Miscellaneous tokens
[ public, static ] SFCError ParseQuotedString( ACharConstPtr start // pointer to the head of string to be parsed ACharConstPtr end // pointer to the end of string to be parsed ACharConstHandle next // handle of the pointer to the end position to be parsed SFXAnsiStringPtr value // pointer to the parsing result: quoted-string );
Specify a pointer to the head of string to be parsed.
Specify a pointer to the end of string to be parsed. The character pointed by this pointer will not be parsed.
Specify a handle to store the pointer to the next character after the parsed quoted-string. Specify null if unnecessary.
Specify a pointer to the variable to store the parsed quoted-string. Specify null if unnecessary.
This function parses the specified string and get the parsed quoted-string, which is defined in RFC2822: 3.2.5. Quoted strings.
[ public, static ] SFCError ParseToken( ACharConstPtr start // pointer to the head of string to be parsed ACharConstPtr end // pointer to the end of string to be parsed ACharConstHandle next // handle of the pointer to the end position to be parsed SFXAnsiStringPtr value // pointer to the parsing result: token );
Specify a pointer to the head of string to be parsed.
Specify a pointer to the end of string to be parsed. The character pointed by this pointer will not be parsed.
Specify a handle to store the pointer to the next character after the parsed token. Specify null if unnecessary.
Specify a pointer to the variable to store the parsed token. Specify null if unnecessary.
This function parses the specified string and get the parsed token, which is defined in RFC2045: Appendix A -- Collected Grammar.
SFXMailUtility::IsTokenChar | SFXMailUtility::ParseContentType | SFXMailUtility::SkipWSP | RFC2045: Appendix A -- Collected Grammar
[ public, static ] SFCError ParseWord( ACharConstPtr start // pointer to the head of string to be parsed ACharConstPtr end // pointer to the end of string to be parsed ACharConstHandle next // handle of the pointer to the end position to be parsed SFXAnsiStringPtr value // pointer to the parsing result: word );
Specify a pointer to the head of string to be parsed.
Specify a pointer to the end of string to be parsed. The character pointed by this pointer will not be parsed.
Specify a handle to store the pointer to the next character after the parsed word. Specify null if unnecessary.
Specify a pointer to the variable to store the parsed word. Specify null if unnecessary.
This function parses the specified string and get the parsed word, which is defined in RFC2822: 3.2.6. Miscellaneous tokens.
SFXMailUtility::ParseAtom | SFXMailUtility::ParseQuotedString | SFXMailUtility::SkipWSP | RFC2822: 3.2.6. Miscellaneous tokens
[ public, static ] SFCError ShiftJISToJIS( SFXAnsiStringConstRef in // reference to the source string to be converted SFXAnsiStringPtr out // pointer to the converted string AChar unconvChar = '\0' // alternative character for the character that cannot be converted );
Specify a string to be converted in Shift_JIS code.
The pointer to the converted string will be returned.
Specify an alternative character for the character that cannot be converted. The default value of this argument is '\0', which means that this sub-function is invalid.
If the "unconvChar" argument is specified, characters that cannot be converted will be substituted with the value of "unconvChar" argument and the return value will be SFERR_NO_ERROR.
[ public, static ] Void SkipUntilCRLF( ACharConstHandle start // handle that stores a pointer to the starting position to search for the next CRLF or '\0' chararacter and to the result position );
This function searches for the next CRLF or '\0' from the character position that the "start" argument points to, and return its character position via the "start" argument.
The return value of the "start" argument points to the character next after LF or the '\0' character.
[ public, static ] Void SkipWSP( ACharConstHandle start // [in]starting position;[out] the positon of the character other than WSP or the ending position specified ACharConstPtr end // ending position );
This function advances the pointer to the first character other than WSP(space or horizontal tab) or the ending position specified.
struct Mailbox { SFXAnsiString name; // display name SFXAnsiString addr; // addr-spec };
The "name" field represents the display name of a mail, and the "addr" field represents the addr-spec of a mail.
The data of the SFXMailUtility::Mailbox structure is obtained by the SFXMailUtility::ParseMailbox and SFXMailUtility::ParseMailboxList functions.
Copyright(c) 2002 - 2024 Sophia Cradle Incorporated All Rights Reserved. |