Xml::CCharSetConverter Class Reference
class Xml::CCharSetConverter : public CBase |
Public Member Functions |
---|
| ~CCharSetConverter() |
IMPORT_C void | ConvertCharacterSetIdentifierToStandardNameL(TUint32, HBufC8 *&) |
IMPORT_C TInt | ConvertFromUnicodeL(const TDesC16 &, TUint32, HBufC8 *&) |
IMPORT_C TInt | ConvertFromUnicodeL(const TDesC16 &, TUint32, TPtr8 &) |
IMPORT_C TInt | ConvertToUnicodeL(TUint32, const TDesC8 &, HBufC16 *&) |
IMPORT_C TInt | ConvertToUnicodeL(TUint32, const TDesC8 &, TPtr16 &) |
IMPORT_C TInt | ConvertUcs4CharactersToEncodingL(TUint32 *, TInt, TUint32, HBufC8 *&) |
CCharSetConverter * | NewL() |
IMPORT_C void | PrepareCharConvL(TUint &, const TDesC8 &) |
IMPORT_C void | PrepareCharConvL(TUint &, TInt) |
IMPORT_C void | PrepareToConvertToOrFromL(TUint32) |
Constructor & Destructor Documentation
CCharSetConverter()
CCharSetConverter | ( | ) | [private] |
CCharSetConverter(const CCharSetConverter &)
~CCharSetConverter()
~CCharSetConverter | ( | ) | [virtual] |
Destructor. The framework is responsible for destroying this object.
- Post-condition
- This object is properly destroyed.
Member Functions Documentation
ConstructL()
void | ConstructL | ( | ) | [private] |
This method provides some construction of this object.
ConvertCharacterSetIdentifierToStandardNameL(TUint32, HBufC8 *&)
IMPORT_C void | ConvertCharacterSetIdentifierToStandardNameL | ( | TUint32 | aCharSetUid, |
| HBufC8 *& | aCharSet |
| ) | |
This method is a helper function that obtains a standand character encoding name from a character set identifer.
Parameters
TUint32 aCharSetUid | The character set to obtain the name for. |
HBufC8 *& aCharSet | On return holds the Internet-standard name or MIME name of the character set. The name is encoded in 8 bit ASCII. |
ConvertFromUnicodeL(const TDesC16 &, TUint32, HBufC8 *&)
This method converts the given unicode to the specified encoding. If this function leaves, memory is cleaned up. This overload allocates memory for the output itself.
-
leave
- KErrXmlUnavailableCharacterSet - Charset not available.
Parameters
const TDesC16 & aUnicodeConversion | The unicode to convert. |
TUint32 aDestCharset | The character set encoding to convert to. |
HBufC8 *& aOutputBuffer | On return, contains the specified conversion. |
ConvertFromUnicodeL(const TDesC16 &, TUint32, TPtr8 &)
This method converts the given unicode to the specified encoding. If this function leaves, memory is cleaned up. This overload stores the conversion output in memory already allocated, for the sole use of the TPtr versions of overloaded ConvertToUnicodeL and ConvertFromUnicodeL functions. You must make sure you have finished with the output from a previous call to either (TPtr overload of) ConvertToUnicodeL or ConvertFromUnicodeL before calling either again, as the previous output will be overwritten with the new output. This version is more efficient than the HBufC alternative and so should be used whenever possible.
-
leave
- KErrXmlUnavailableCharacterSet - Charset not available.
Parameters
const TDesC16 & aUnicodeConversion | The unicode to convert. |
TUint32 aDestCharset | The character set encoding to convert to. |
TPtr8 & aOutput | The characters after conversion. |
ConvertToUnicodeL(TUint32, const TDesC8 &, HBufC16 *&)
This method converts the given bytes to unicode. If this function leaves, memory is cleaned up. This overload allocates memory for the output itself.
-
leave
- KErrXmlUnavailableCharacterSet - CharSet not available.
Parameters
TUint32 aSrcCharset | The character set encoding to convert from. |
const TDesC8 & aInputBuffer | The characters to be converted. |
HBufC16 *& aUnicodeConversion | On return, contains the unicode conversion. |
ConvertToUnicodeL(TUint32, const TDesC8 &, TPtr16 &)
This method converts the given bytes to unicode. If this function leaves, memory is cleaned up. This overload stores the conversion output in memory already allocated, for the sole use of the TPtr versions of overloaded ConvertToUnicodeL and ConvertFromUnicodeL functions. You must make sure you have finished with the output from a previous call to either (TPtr overload of) ConvertToUnicodeL or ConvertFromUnicodeL before calling either again, as the previous output will be overwritten with the new output. This version is more efficient than the HBufC alternative and so should be used whenever possible.
-
leave
- KErrXmlUnavailableCharacterSet - CharSet not available.
Parameters
TUint32 aSrcCharset | The character set encoding to convert from. |
const TDesC8 & aInputBuffer | The characters to be converted. |
TPtr16 & aOutput | On return, contains the unicode conversion. |
ConvertUcs4CharactersToEncodingL(TUint32 *, TInt, TUint32, HBufC8 *&)
This method converts ucs-4 characters to the desired non-modal encoding. aConversion should be NULL on calling of this function. If this function leaves, memory is cleaned up. There is no TPtr overload of this method, as currently it is only called a few times and so would not produce any noticable benefits.
-
leave
- KErrXmlBadCharacterConversion
Parameters
TUint32 * aUcs4Src | list of ucs-4 characters. |
TInt aUcs4Count | number of ucs4 characters. |
TUint32 aDestCharset | the desired encoding. |
HBufC8 *& aConversion | On return, points to the converted encoding. |
NewL()
This method creates an instance of this class. The framework is responsible for creating this object.
-
leave
- ... One of the system wide error codes e.g. KErrNoMemory
PrepareCharConvL(TUint &, const TDesC8 &)
IMPORT_C void | PrepareCharConvL | ( | TUint & | aCharSetUid, |
| const TDesC8 & | aEncoding |
| ) | |
This method prepares CharConv to encode from the standard name.
- Post-condition
- CharConv has been prepared.
-
leave
- KErrXmlUnsupportedCharacterSet - Charset not supported.
-
leave
- KErrXmlUnavailableCharacterSet - Charset not available
Parameters
TUint & aCharSetUid | On return, contains the character set identifier of the encoding. |
const TDesC8 & aEncoding | the encoding to prepare for. |
PrepareCharConvL(TUint &, TInt)
IMPORT_C void | PrepareCharConvL | ( | TUint & | aCharSetUid, |
| TInt | aMibEnum |
| ) | |
This method prepares CharConv to encode from the mib enum.
Parameters
TUint & aCharSetUid | On return, contains the character set identifier of the encoding. |
TInt aMibEnum | The IANA specified mib enum for this encoding |
PrepareToConvertToOrFromL(TUint32)
IMPORT_C void | PrepareToConvertToOrFromL | ( | TUint32 | aCharSetUid | ) | |
This method is a helper function that prepares CharConv for a conversion.
Parameters
TUint32 aCharSetUid | The character set encoding to convert to. |
Utf32ToUtf16(TText16 *, TUint32)
This method converts a ucs-4 character to unicode.
Parameters
TText16 * aUtf16Out | On return, contains the unicode character conversion. |
TUint32 aUtf32 | The ucs-4 character |
operator=(const CCharSetConverter &)
Member Data Documentation
CCnvCharacterSetConverter * iCnvCharacterSetConverter
The CharConv instance that we use to help in the character conversions.
TAny * iConversionBuffer
TAny * | iConversionBuffer | [private] |
The buffer used to store the unicode conversion output.
TUint32
iConversionBufferSize
TUint32
| iConversionBufferSize | [private] |
The size of the unicode conversion buffer.
RFs
iFs
The File Server session handle.
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.