os/ossrv/genericopenlibs/openenvcore/libc/inc/localetlsinfo.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2006-2009 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 * Name        : localetlsinfo.h
    16 * Part of     : LIBC
    17 * Contains the class declartion for locale related functions
    18 * Version     : 
    19 * This material, including documentation and any related 
    20 * computer programs, is protected by copyright controlled by 
    21 * Nokia Corporation. All rights are reserved. Copying, 
    22 * including reproducing, storing, adapting or translating, any 
    23 * or all of this material requires the prior written consent of 
    24 * Nokia Corporation. This material also contains confidential 
    25 * information which may not be disclosed to others without the 
    26 * prior written consent of Nokia Corporation.
    27 *
    28 */
    29 
    30 
    31 
    32 #ifndef _LOCALETLSINFO_H_
    33 #define _LOCALETLSINFO_H_
    34 
    35 #include <e32def.h>
    36 #include <e32cmn.h>
    37 #include "sysif.h"
    38 
    39 #define LANG_VARIANT_DLL_NAME 10
    40 #ifdef SYMBIAN_DISTINCT_LOCALE_MODEL
    41 #define NEW_LANG_VARIANT_DLL_NAME 30
    42 #endif
    43 class CLocale;
    44 struct lc_monetary_T;
    45 struct lc_time_T;
    46 struct lc_numeric_T;
    47 
    48 struct LocaleInfo
    49 {
    50 	CLocale *_s_iNewLocale;
    51 	lc_monetary_T*_s_iMonetary_locale;
    52 	lc_numeric_T * _s_iNumeric_locale;
    53 	lc_time_T * _s_iTime_locale;
    54 
    55 	TText8 *_s_numericLocale;
    56 	TText8 *_s_monetaryLocale;
    57 	TText8 *_s_timeLocale;
    58 
    59 	TBuf<LANG_VARIANT_DLL_NAME> _s_DllName;
    60 #ifdef SYMBIAN_DISTINCT_LOCALE_MODEL
    61 	TBuf<NEW_LANG_VARIANT_DLL_NAME> _s_ColDllName;
    62 #endif
    63 	/*******************************************************************
    64 	Overloading new and delete operators so that they will
    65 	allocate and deallocare memory from/to the private heap of backend
    66 	********************************************************************/
    67 	inline TAny* operator new(TUint aSize, TAny* aBase) __NO_THROW
    68 		{
    69 		Mem::FillZ(aBase, aSize); return aBase;
    70 		}
    71 		
    72 	inline TAny* operator new(TUint aSize) __NO_THROW
    73 		{
    74 		return Backend()->Alloc(aSize);
    75 		}
    76 		
    77 	inline TAny* operator new(TUint aSize, TLeave)
    78 		{
    79 		TAny* ptr = Backend()->Alloc(aSize);
    80 		if (ptr == NULL)
    81 			{
    82 			User::Leave(KErrNoMemory);
    83 			}
    84 		return ptr;
    85 		}
    86 		
    87 	inline TAny* operator new(TUint aSize, TUint aExtraSize) __NO_THROW
    88 		{
    89 		return Backend()->Alloc(aSize + aExtraSize);
    90 		}
    91 		
    92 	inline TAny* operator new(TUint aSize, TLeave, TUint aExtraSize)
    93 		{
    94 		TAny* ptr = Backend()->Alloc(aSize + aExtraSize);
    95 		if (ptr == NULL)
    96 			{
    97 			User::Leave(KErrNoMemory);
    98 			}
    99 		return ptr;
   100 		}
   101 	
   102 	inline void operator delete(TAny *aPtr) __NO_THROW
   103 		{
   104 		Backend()->Free( aPtr );
   105 		}
   106 };
   107 
   108 typedef struct LocaleInfo _localeinfo;
   109 
   110 #endif //_LOCALETLSINFO_H_
   111 
   112 
   113