class VersitUtils |
A utility class which provides functions for handling character set conversions, and for the parsing of character strings.
Private Member Functions | |
---|---|
void | AddEscapedString ( TBool , TDes &, const TDesC &) |
const TDesC & | EscapeChar ( TBool ) |
IMPORT_C void | AddEscapedString | ( | TDes & | aDestination, |
const TDesC & | aTextToEscape, | |||
Versit::TVersitCharSet | aCharSet | |||
) | [static] |
Adds an escape character before the semi-colons in a given text string.
TDes & aDestination | On return, the escaped text. |
const TDesC & aTextToEscape | Text to be escaped. |
Versit::TVersitCharSet aCharSet | A Versit character set identifier. |
IMPORT_C void | AddEscapedString | ( | TDes & | aDestination, |
const TDesC & | aTextToEscape, | |||
TUint | aCharSetId | |||
) | [static] |
Adds an escape character before the semi-colons in a given text string.
void | AddEscapedString | ( | TBool | aIsShiftJis, |
TDes & | aDestination, | |||
const TDesC & | aTextToEscape | |||
) | [private, static] |
IMPORT_C CParserPropertyValue * | AdditionalPropertyValueFromStorageL | ( | const CParserProperty & | aProperty | ) | [static] |
Retrieves any additional storage property value associated with the specified property.
const CParserProperty & aProperty | The property that may have additional associated data. |
IMPORT_C void | AllocateAdditionalPropertyStorageL | ( | CVersitTlsData & | aTlsData, |
CParserProperty & | aProperty, | |||
TPtr16 & | aStringValue, | |||
TUint | aLineCharacterSetId | |||
) | [static] |
Allocates an additional property value object for certain CParserProperty objects.
This is needed to support the parsing and storage of Japanese pronunciation SOUND properties. Due to the existing Symbian Versit architecture, it was not possible to change the underlying storage type of the SOUND property to an array data type. Therefore, this method provides a means of storing the array-based value which can be retrieved when necessary.
It is called by CParserVCard::MakePropertyValueSoundL() .
CVersitTlsData & aTlsData | The CVersitParser::iStaticUtils member. |
CParserProperty & aProperty | A SOUND property. |
TPtr16 & aStringValue | A 16-bit raw property value string. |
TUint aLineCharacterSetId | The character set ID of the current line. This is required to identify the escape character. |
IMPORT_C TUid | CharConvCharSetUid | ( | Versit::TVersitCharSet | aVersitSet | ) | [static] |
Returns the character converter UID associated with the specified Versit character set identifier.
Versit::TVersitCharSet aVersitSet | A character set identifier. |
Versit::TVersitCharSet | CharSet | ( | TUint | aCharConvCharSetUid | ) | [static] |
Returns the Versit character set identifier associated with the specified character converter UID.
TUint aCharConvCharSetUid | A character converter UID. These UIDs are defined in charconv.h. |
IMPORT_C TBool | CheckAndIgnoreCustomErrorL | ( | TInt | aError | ) | [static] |
Tests whether an error code is Versit-specific or not and leaves (with that error code) if it is not.
TInt aError | Error code to test. |
IMPORT_C void | ConArcEncodeL | ( | RReadStream & | aSource, |
CBufBase & | aTarget, | |||
TUid | aConArcEncodingUid | |||
) | [static] |
Encodes a buffer using the specified character set converter.
RReadStream & aSource | Buffer to be encoded. |
CBufBase & aTarget | On return, the encoded buffer. |
TUid aConArcEncodingUid | Converter UID, as returned by VersitUtils::ConArcEncodingUid(). |
IMPORT_C TUid | ConArcEncodingUid | ( | Versit::TVersitEncoding | aEncoding | ) | [static] |
Returns the UID of a character set converter suitable for the specified encoding.
Versit::TVersitEncoding aEncoding | An encoding type. |
IMPORT_C TBool | DescriptorContainsOnlySevenBitCharacters | ( | const TDesC & | aText | ) | [static] |
Tests whether all of the characters in the specified text can be represented in 7-bit ASCII.
const TDesC & aText | Text to be tested. |
IMPORT_C TBool | EightBitEncoding | ( | Versit::TVersitCharSet | aCharSet | ) | [static] |
Tests whether the specified character set is encoded using 8 bits or not. For instance ASCII is 7-bit; ISO-8859-1 is 8-bit.
Versit::TVersitCharSet aCharSet | A character set. |
IMPORT_C TBool | EightBitEncoding | ( | TUint | aCharSetId | ) | [static] |
Tests whether the character set identified by the specified ID is encoded using 8 bits or not.
TUint aCharSetId | A character set ID. |
const TDesC & | EscapeChar | ( | TBool | aIsShiftJis | ) | [private, static] |
If using shifjis charset return shiftjis charset as generated by relevant charconv plugin else return standard unicode escape charcter \
TBool aIsShiftJis |
IMPORT_C void | FreeAdditionalPropertyStorageL | ( | const CParserProperty & | aProperty | ) | [static] |
Frees any additional storage associated with the specified property.
Additional storage may have previously been allocated using AllocateAdditionalPropertyStorageL() .
This is called by CParserProperty's destructor.
const CParserProperty & aProperty | The property which may have additional storage associated with it. |
IMPORT_C const TDesC8 & | IANACharacterSetName | ( | Versit::TVersitCharSet | aCharSet | ) | [static] |
Returns the IANA character set name corresponding to the specified character set identifier.
Versit::TVersitCharSet aCharSet | A character set. |
IMPORT_C const TDesC8 & | IANAEncodingName | ( | Versit::TVersitEncoding | aEncoding | ) | [static] |
Returns the MIME encoding type corresponding to the specified encoding.
Versit::TVersitEncoding aEncoding | An encoding type. |
TBool | IsBeginOrEnd | ( | TUid | aUid | ) | [static, inline] |
Tests whether the specified UID is the Versit Begin or End UID (KVersitTokenBeginUid or KVersitTokenEndUid).
TUid aUid | The UID to test. |
IMPORT_C TBool | IsNoneWhiteSpaceChar | ( | const TDesC8 & | aString | ) | [static] |
Tests whether the specified 8 bit string contains no white spaces.
Any CR/LF pair at the end of the string is disregarded.
const TDesC8 & aString | The string to test. |
IMPORT_C TBool | IsNoneWhiteSpaceWideChar | ( | const TDesC16 & | aString | ) | [static] |
Tests whether the specified 16 bit string contains no white spaces.
Any CR/LF pair at the end of the string is disregarded.
const TDesC16 & aString | The string to test. |
TBool | IsWhiteSpace | ( | TUint | aChar | ) | [static, inline] |
Tests whether the specified character is white space (either a tab or a space character).
TUint aChar | The character to test. |
IMPORT_C CDesCArray * | ParseForArrayPropertiesL | ( | TPtr16 | aStringValue, |
TUint | aLineCharacterSetId | |||
) | [static] |
Parses a compound property value string.
The sub-values found are appended to an array, after removal of escape characters. The array is returned, and ownership is transferred to the caller.
IMPORT_C void | RemoveEscapeChars | ( | TPtr8 & | aText | ) | [static] |
Removes escape characters (backslashes) from the specified 8-bit string.
TPtr8 & aText | A raw 8-bit string value. |
IMPORT_C void | RemoveEscapeChars | ( | HBufC16 & | aText | ) | [static] |
Removes escape characters (backslashes) from the specified 16-bit string.
HBufC16 & aText | A raw 16-bit string value. |
IMPORT_C void | RemoveEscapeChars | ( | HBufC16 & | aText, |
TUint | aCharSetUid | |||
) | [static] |
Removes escape characters (backslashes or for the Shift-JIS character set, Yen-symbols/backslashes, Shift-JIS behaviour is platform dependent) from the specified 16-bit string.
IMPORT_C void | RemoveEscapeChars | ( | TPtr16 & | aText, |
TUint | aCharSetUid | |||
) | [static] |
Removes escape characters (backslashes or for the Shift-JIS character set, Yen-symbols/backslashes, Shift-JIS behaviour is platform dependent) from the specified 16-bit string.
IMPORT_C TBool | RequiresEncoding | ( | const TDesC & | aText | ) | [static] |
Tests whether the specified text requires encoding.
const TDesC & aText | Text to be tested. |
IMPORT_C void | StripWhiteSpace | ( | TPtr8 & | aString | ) | [static] |
Strips white space from the beginning and end of the specified 8-bit string.
TPtr8 & aString | A 8-bit string. |
IMPORT_C void | StripWhiteSpace | ( | TPtr16 & | aString | ) | [static] |
Strips white space from the beginning and end of the specified 16-bit string.
TPtr16 & aString | A 16-bit string. |
IMPORT_C void | UncodeToNarrowL | ( | const TDesC & | aUnicode, |
TDes8 & | aNarrow, | |||
const Versit::TEncodingAndCharset & | aEncodingCharset | |||
) | [static] |
Converts Unicode text to 8-bit, using the specified character set converter.
const TDesC & aUnicode | The Unicode text to be converted. |
TDes8 & aNarrow | On return, the converted text. |
const Versit::TEncodingAndCharset & aEncodingCharset | Specifies the character set converter to use. |
IMPORT_C void | WrapLinesL | ( | CBufBase & | aBuffer, |
TInt | aMaxLineLength | |||
) | [static] |
Ensures that a buffer doesn't contain any lines longer than the specified length.
Any lines longer than the specified length are wrapped.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.