os/security/securityanddataprivacytools/securitytools/certapp/utils/stringconv.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
#ifndef __STRINGCONV_H__
sl@0
     2
#define __STRINGCONV_H__/*
sl@0
     3
* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     4
* All rights reserved.
sl@0
     5
* This component and the accompanying materials are made available
sl@0
     6
* under the terms of the License "Eclipse Public License v1.0"
sl@0
     7
* which accompanies this distribution, and is available
sl@0
     8
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     9
*
sl@0
    10
* Initial Contributors:
sl@0
    11
* Nokia Corporation - initial contribution.
sl@0
    12
*
sl@0
    13
* Contributors:
sl@0
    14
*
sl@0
    15
* Description: 
sl@0
    16
*
sl@0
    17
*/
sl@0
    18
sl@0
    19
sl@0
    20
#include <string>
sl@0
    21
#include <e32base.h>
sl@0
    22
sl@0
    23
/**
sl@0
    24
 * @file
sl@0
    25
 * @internalComponent
sl@0
    26
 */
sl@0
    27
sl@0
    28
// Converts the utf16 input into a new buffer and returns that buffer
sl@0
    29
TUint8 *cstrFromUtf16(const TText *aUtf16, TInt aLength, TInt &outLen); // length is in chars not bytes
sl@0
    30
std::string stringFromUtf16(const TText *aUtf16, TInt aLength); // length is in chars not bytes
sl@0
    31
std::string stringFromUtf16(const TDesC &aUtf16);
sl@0
    32
sl@0
    33
// Converts the utf8 input into a new buffer and returns that buffer
sl@0
    34
// The new buffer will be NUL terminated, but the NUL is not included in the outputWords length
sl@0
    35
TText *utf16FromUtf8(const TUint8 *aUtf8, TInt aLength, TInt &outputWords);
sl@0
    36
sl@0
    37
sl@0
    38
#endif