Functions | |
| XMIME_API int | QpEncoderW_initialize (QpEncoderW *encoder) |
| Initializes the encoder object. | |
| XMIME_API void | QpEncoderW_finalize (QpEncoderW *encoder) |
| Finalizes the encoder object. | |
| XMIME_API void | QpEncoderW_setMaxLineLen (QpEncoderW *encoder, size_t len) |
| Sets the maximum line length of the encoded output. | |
| XMIME_API size_t | QpEncoderW_getMaxLineLen (QpEncoderW *encoder) |
| Gets the maximum line length of the encoded output. | |
| XMIME_API void | QpEncoderW_setOutputCrLf (QpEncoderW *encoder, int b) |
| Sets the CRLF end-of-line characters option. | |
| XMIME_API int | QpEncoderW_getOutputCrLf (QpEncoderW *encoder) |
| Gets the CRLF end-of-line characters option. | |
| XMIME_API void | QpEncoderW_setSuppressFinalNewline (QpEncoderW *encoder, int b) |
| Sets the option to suppress a final newline in the output. | |
| XMIME_API int | QpEncoderW_getSuppressFinalNewline (QpEncoderW *encoder) |
| Gets the option to suppress a final newline in the output. | |
| XMIME_API void | QpEncoderW_setProtectFrom (QpEncoderW *encoder, int b) |
| Sets the option to protect "From " at the beginning of a line. | |
| XMIME_API int | QpEncoderW_getProtectFrom (QpEncoderW *encoder) |
| Gets the option to protect "From " at the beginning of a line. | |
| XMIME_API void | QpEncoderW_setProtectDot (QpEncoderW *encoder, int b) |
| Sets the option to protect a dot at the beginning of a line. | |
| XMIME_API int | QpEncoderW_getProtectDot (QpEncoderW *encoder) |
| Gets the option to protect a dot at the beginning of a line. | |
| XMIME_API void | QpEncoderW_setEncodeMap (QpEncoderW *encoder, unsigned char *map) |
| Sets the lookup table that determines how characters are encoded. | |
| XMIME_API void | QpEncoderW_start (QpEncoderW *encoder) |
| Starts an encode operation. | |
| XMIME_API void | QpEncoderW_encode (QpEncoderW *encoder, ByteBuffer *inBuf, Char16Buffer *outBuf) |
| Encodes data from the input buffer to the output buffer. | |
| XMIME_API void | QpEncoderW_finish (QpEncoderW *encoder, Char16Buffer *outBuf) |
| Finishes an encode operation. | |
QpEncoderW_encode() and QpEncoderW_finish() take a Char16Buffer argument, while QpEncoder_encode() and QpEncoder_finish() take a Char8Buffer argument. QpEncoderW may be convenient to use with Java, .NET, or COM, where text most often consists of 16-bit Unicode characters.If your program operates in an environment that uses the UTF-8 encoding of Unicode (Linux or Solaris, for example), then you can use the QpEncoder module without any problems, because the quoted-printable-encoded data uses only 7-bit characters.
Please see the documentation for QpEncoder.
| XMIME_API void QpEncoderW_encode | ( | QpEncoderW * | encoder, | |
| ByteBuffer * | inBuf, | |||
| Char16Buffer * | outBuf | |||
| ) |
Encodes data from the input buffer to the output buffer.
This function takes an input buffer and an output buffer as parameters, and encodes data from the input buffer to the output buffer until either (1) the input buffer is empty, or (2) the output buffer is full. Therefore, one of the following conditions is always true when the function returns:
inBuf.pos == inBuf.endPos (input buffer empty) outBuf.pos == outBuf.endPos (output buffer full) You may call the function multiple times to encode multiple buffers of input data. However, both of the following conditions should be true before the function is called:
inBuf.pos < inBuf.endPos (input buffer data available) outBuf.pos < outBuf.endPos (output buffer space available)
| encoder | the encoder object | |
| inBuf | input buffer | |
| outBuf | output buffer |
| XMIME_API void QpEncoderW_finalize | ( | QpEncoderW * | encoder | ) |
Finalizes the encoder object.
You must call this function when you have finished using the encoder. Failure to call this function causes a memory leak.
| encoder | the encoder object |
| XMIME_API void QpEncoderW_finish | ( | QpEncoderW * | encoder, | |
| Char16Buffer * | outBuf | |||
| ) |
Finishes an encode operation.
When you perform an encode operation, the encoder buffers some data internally. Therefore, after you have processed all the input data, you must call this function to flush the internal buffer.
The following condition must be true when the function is called:
outBuf.pos < outBuf.endPos (output buffer space available) The above condition must also be true when the function returns in order to guarantee that all output data has been written to the output buffer. If the condition is false when the function returns, you must make room in the output buffer and call the function again.
| encoder | the encoder object | |
| outBuf | output buffer |
| XMIME_API size_t QpEncoderW_getMaxLineLen | ( | QpEncoderW * | encoder | ) |
Gets the maximum line length of the encoded output.
| encoder | the encoder object |
| XMIME_API int QpEncoderW_getOutputCrLf | ( | QpEncoderW * | encoder | ) |
Gets the CRLF end-of-line characters option.
| encoder | the encoder object |
| XMIME_API int QpEncoderW_getProtectDot | ( | QpEncoderW * | encoder | ) |
Gets the option to protect a dot at the beginning of a line
| encoder | the encoder object |
| XMIME_API int QpEncoderW_getProtectFrom | ( | QpEncoderW * | encoder | ) |
Gets the option to protect "From " at the beginning of a line.
| encoder | the encoder object |
| XMIME_API int QpEncoderW_getSuppressFinalNewline | ( | QpEncoderW * | encoder | ) |
Gets the option to suppress a final newline in the output.
| encoder | the encoder object |
| XMIME_API int QpEncoderW_initialize | ( | QpEncoderW * | encoder | ) |
Initializes the encoder object.
You must initialize the encoder object before you use it. After you have initialized it, you may use the encoder object for multiple encode operations.
When you have finished using the encoder object, call QpEncoderW_finalize() to free the memory allocated by the encoder object.
| encoder | the encoder object |
| XMIME_API void QpEncoderW_setEncodeMap | ( | QpEncoderW * | encoder, | |
| unsigned char * | map | |||
| ) |
Sets the lookup table that determines how characters are encoded.
This is an advanced option. Please contact Hunny Software's support staff if you want the details on how to use this option.
| encoder | the encoder object | |
| map | encode map |
| XMIME_API void QpEncoderW_setMaxLineLen | ( | QpEncoderW * | encoder, | |
| size_t | len | |||
| ) |
Sets the maximum line length of the encoded output.
For MIME-compliant Internet mail, lines should be no longer than 76 characters, and that rule is enforced by this class. If the parameter to this method has a value larger than 76, the maximum line length will be set to 76.
The default value is 76.
| encoder | the encoder object | |
| len | maximum line length in the encoded output |
| XMIME_API void QpEncoderW_setOutputCrLf | ( | QpEncoderW * | encoder, | |
| int | b | |||
| ) |
Sets the CRLF end-of-line characters option.
If this option is true, then the encoder uses CR LF as the end-of-line characters in the encoded output. If the option is false, then the encoder uses LF alone.
The default value is false.
| encoder | the encoder object | |
| b | true value causes CR LF in the output; false causes LF |
| XMIME_API void QpEncoderW_setProtectDot | ( | QpEncoderW * | encoder, | |
| int | b | |||
| ) |
Sets the option to protect a dot at the beginning of a line.
Because of the way mail messages are sent in the SMTP and POP3 protocols, a dot (the character '.') at the beginning of a line is treated specially. A single dot on a line by itself indicates the end of the message. For this reason, the protocol implementation must scan every line for a dot at the beginning and "escape" it by adding an extra dot when sending, and "unescape" it by removing the extra dot when receiving. If this option is true, then the encoder encodes every dot at the beginning of a line using the hex encoding. Setting this option may provide better interoperability with SMTP or POP3 implementations that do not correctly handle the escaping or unescaping of the dot character.
The default value is true.
| encoder | the encoder object | |
| b | if true, "." at the beginning of a line is encoded as "=2E" |
| XMIME_API void QpEncoderW_setProtectFrom | ( | QpEncoderW * | encoder, | |
| int | b | |||
| ) |
Sets the option to protect "From " at the beginning of a line.
Because of the way many applications store mail messages in a file, if the string "From " occurs at the beginning of a line, it is often changed to ">From ". If this option is true, then when "From " occurs at the beginning of a line, the encoder encodes it as "From=20" -- that is, the space character is encoded using the hex encoding.
The default value is true.
| encoder | the encoder object | |
| b | if true, "From " is encoded as "From=20" |
| XMIME_API void QpEncoderW_setSuppressFinalNewline | ( | QpEncoderW * | encoder, | |
| int | b | |||
| ) |
Sets the option to suppress a final newline in the output.
If this option is true, then the encoder does not put a final newline (CR LF, or LF) at the end of the encoded output, unless the input ends with a hard line break. If the option is false, then the encoder always adds a newline to the end of the encoded output. If the option is false and the input does not end with a hard line break, then the encoder adds a soft line break (that is, "=\r\n" or "=\n") at the end of the encoded output.
The default value is false.
| encoder | the encoder object | |
| b | if true, a final newline will be suppressed; if false, a final newline is always added |
| XMIME_API void QpEncoderW_start | ( | QpEncoderW * | encoder | ) |
Starts an encode operation.
After you call QpEncoderW_start(), you call QpEncoderW_encode() one or more times, followed by QpEncoderW_finish() to complete the encode operation.
| encoder | the encoder object |
Copyright © 2001-2010 Hunny Software, Inc. All rights reserved.