mmserv/tms/tmsutility/src/tmsutility.cpp
changeset 33 5e8b14bae8c3
parent 20 b67dd1fc57c5
equal deleted inserted replaced
28:ebf79c79991a 33:5e8b14bae8c3
     1 /*
     1 /*
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     2  * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
     3  * All rights reserved.
     3  * All rights reserved.
     4  * This component and the accompanying materials are made available
     4  * This component and the accompanying materials are made available
     5  * under the terms of "Eclipse Public License v1.0"
     5  * under the terms of "Eclipse Public License v1.0"
     6  * which accompanies this distribution, and is available
     6  * which accompanies this distribution, and is available
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
   118         }
   118         }
   119     return result;
   119     return result;
   120     }
   120     }
   121 
   121 
   122 // -----------------------------------------------------------------------------
   122 // -----------------------------------------------------------------------------
       
   123 // TMSUtility::SymbianResult
       
   124 //
       
   125 // -----------------------------------------------------------------------------
       
   126 //
       
   127 EXPORT_C TInt TMSUtility::SymbianResult(const gint aError)
       
   128     {
       
   129     TInt result(KErrNone);
       
   130 
       
   131     if (aError <= TMS_RESULT_SUCCESS)
       
   132         {
       
   133         return aError; //return Symbian error
       
   134         }
       
   135 
       
   136     switch (aError)
       
   137         {
       
   138         case TMS_RESULT_DOES_NOT_EXIST:
       
   139             result = KErrNotFound;
       
   140             break;
       
   141         case TMS_RESULT_OPERATION_CANCELLED:
       
   142             result = KErrCancel;
       
   143             break;
       
   144         case TMS_RESULT_INSUFFICIENT_MEMORY:
       
   145             result = KErrNoMemory;
       
   146             break;
       
   147         case TMS_RESULT_ILLEGAL_OPERATION:
       
   148             result = KErrNotSupported;
       
   149             break;
       
   150         case TMS_RESULT_INVALID_ARGUMENT:
       
   151             result = KErrArgument;
       
   152             break;
       
   153         case TMS_RESULT_BUFFER_LATENCY_ERROR:
       
   154             result = KErrUnderflow;
       
   155             break;
       
   156         case TMS_RESULT_ALREADY_EXIST:
       
   157             result = KErrAlreadyExists;
       
   158             break;
       
   159         case TMS_RESULT_FATAL_ERROR:
       
   160         case TMS_RESULT_GENERAL_ERROR:
       
   161         default:
       
   162             result = KErrGeneral;
       
   163             break;
       
   164         }
       
   165     return result;
       
   166     }
       
   167 
       
   168 // -----------------------------------------------------------------------------
   123 // TMSUtility::EtelToTMSResult
   169 // TMSUtility::EtelToTMSResult
   124 //
   170 //
   125 // -----------------------------------------------------------------------------
   171 // -----------------------------------------------------------------------------
   126 //
   172 //
   127 EXPORT_C gint TMSUtility::EtelToTMSResult(const gint aError)
   173 EXPORT_C gint TMSUtility::EtelToTMSResult(const gint aError)