Calculates the actual amount of storage required for a UTF-7 text string that is to be transcoded from Unicode. Requires iterating over the entire TText.
Calling Context:
Typically called before transcoding from Unicode.
Parameters:
const TText & uniText -The Unicode text to be transcoded to a UTF-7 encoding.
const TTextRange & uniTextRange -The range of the Unicode text to be transcoded.
TTranscoder :: ETranscodingScope scope =kNoRoundTrip -How the transcoding should be performed.
Return Value:
Returns a TTextCount for the size of the resulting UTF-7 character string.
Exceptions:
Throws no exceptions, passes all exceptions through.
Provides a quick estimate of the number of bytes required to provide storage for strings converted from Unicode.
Calling Context:
Called to quickly estimate a maximum length for the char buffer used in ExtractFromText. If the number of Unicode characters in a TText is multiplied by GetMaximumBytesPerCharacter, the result is guaranteed to produce a buffer sufficiently long for converting that TText to UTF-7 characters.
Parameters:
TTranscoder :: ETranscodingScope scope =kNoRoundTrip -Determines whether this function returns the number of bytes per single character in the UTF-7 character encoding, or the maximum number of bytes required to represent a single Unicode character in the UTF-7 character encoding (see "Return Value").
Return Value:
If the default scope (kNoRoundTrip) is used, this function returns the number of bytes per single character in the UTF-7 character encoding. If any but the default scope is used, it returns the length of the longest expansion for a single exception character in the transcoding, that is, the maximum number of bytes required to represent a single Unicode character in the UTF-7 character encoding.
Exceptions:
Throws no exceptions, passes all exceptions through.
const TTextRange & uniTextConversionRange -The range to transcode.
unsigned char * chars -Receives the UTF-7 text. The string is not zero-terminated. The number of characters converted is returned in the parameter, charsLength.
TTextCount & charsLength -The maximum length of the chars buffer on input. Transcoding does not occur beyond this length. On output, this is the number of characters that were actually converted.
TTranscoder :: ETranscodingScope scope -How the transcoding should be performed.
Return Value:
The number of characters that were converted.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
This protected function overrides the inherited TTranscoder function.