Update contrib.
2 * Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * This file contains the implementation of the teletex string ASN1 object.
16 * The teletex string includes the following characters:
17 * <character set currently unknown - awaiting ITU spec>
24 EXPORT_C TASN1DecTeletexString::TASN1DecTeletexString(void)
28 EXPORT_C TInt TASN1DecTeletexString::CheckValid(const TDesC8& /*aSource*/)
35 Decodes an ASN.1 format Teletex string.
36 @param aSource ASN.1 Teletex string to be decoded.
37 @param aPos Offset in aSource from where decoding starts.
38 @return On return, a pointer to a buffer containing the raw data converted to 16bits.
40 EXPORT_C HBufC* TASN1DecTeletexString::DecodeDERL(const TDesC8& aSource,TInt& aPos)
43 TPtrC8 Source=aSource.Mid(aPos);
44 TASN1DecGeneric gen(Source);
46 HBufC* res = DecodeContentsL(gen.GetContentDER());
51 Decodes an ASN.1 format Teletex string.
52 @param aSource ASN.1 Teletex string to be decoded.
53 @return On return, a pointer to a buffer containing the raw data converted to 16bits.
55 EXPORT_C HBufC* TASN1DecTeletexString::DecodeDERL(const TASN1DecGeneric& aSource)
58 return DecodeContentsL(aSource.GetContentDER());
61 HBufC* TASN1DecTeletexString::DecodeContentsL(const TDesC8& aSource)
63 HBufC* res = HBufC::NewL(aSource.Length());
64 TPtr pRes = res->Des();