javauis/javalegacyutils/src/NativeError.cpp
changeset 76 4ad59aaee882
parent 69 773449708c84
child 79 2f468c1958d0
equal deleted inserted replaced
69:773449708c84 76:4ad59aaee882
     1 /*
       
     2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "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".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <jutils.h>
       
    20 #include "com_nokia_mj_impl_rt_legacy_NativeError.h"
       
    21 #include <textresolver.h>
       
    22 
       
    23 jstring getErrorL(JNIEnv* aJni, jint aError)
       
    24 {
       
    25     jstring result = NULL;
       
    26     CTextResolver* iTextResolver = CTextResolver::NewLC();
       
    27     TPtrC errorMsg;
       
    28     errorMsg.Set(iTextResolver->ResolveErrorString(aError));
       
    29     result = CreateJavaString(*aJni, errorMsg);
       
    30     CleanupStack::PopAndDestroy(); // iTextResolver
       
    31     return result;
       
    32 }
       
    33 
       
    34 JNIEXPORT jstring JNICALL Java_com_nokia_mj_impl_rt_legacy_NativeError__1getNativeErrorMessage
       
    35 (JNIEnv* aJni, jclass /* aPeer */, jint aError)
       
    36 {
       
    37     jstring result = NULL;
       
    38     TRAP_IGNORE(result = getErrorL(aJni, aError));
       
    39     return result;
       
    40 }