1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/genericopenlibs/openenvcore/libc/inc/localetlsinfo.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,113 @@
1.4 +/*
1.5 +* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +* Name : localetlsinfo.h
1.19 +* Part of : LIBC
1.20 +* Contains the class declartion for locale related functions
1.21 +* Version :
1.22 +* This material, including documentation and any related
1.23 +* computer programs, is protected by copyright controlled by
1.24 +* Nokia Corporation. All rights are reserved. Copying,
1.25 +* including reproducing, storing, adapting or translating, any
1.26 +* or all of this material requires the prior written consent of
1.27 +* Nokia Corporation. This material also contains confidential
1.28 +* information which may not be disclosed to others without the
1.29 +* prior written consent of Nokia Corporation.
1.30 +*
1.31 +*/
1.32 +
1.33 +
1.34 +
1.35 +#ifndef _LOCALETLSINFO_H_
1.36 +#define _LOCALETLSINFO_H_
1.37 +
1.38 +#include <e32def.h>
1.39 +#include <e32cmn.h>
1.40 +#include "sysif.h"
1.41 +
1.42 +#define LANG_VARIANT_DLL_NAME 10
1.43 +#ifdef SYMBIAN_DISTINCT_LOCALE_MODEL
1.44 +#define NEW_LANG_VARIANT_DLL_NAME 30
1.45 +#endif
1.46 +class CLocale;
1.47 +struct lc_monetary_T;
1.48 +struct lc_time_T;
1.49 +struct lc_numeric_T;
1.50 +
1.51 +struct LocaleInfo
1.52 +{
1.53 + CLocale *_s_iNewLocale;
1.54 + lc_monetary_T*_s_iMonetary_locale;
1.55 + lc_numeric_T * _s_iNumeric_locale;
1.56 + lc_time_T * _s_iTime_locale;
1.57 +
1.58 + TText8 *_s_numericLocale;
1.59 + TText8 *_s_monetaryLocale;
1.60 + TText8 *_s_timeLocale;
1.61 +
1.62 + TBuf<LANG_VARIANT_DLL_NAME> _s_DllName;
1.63 +#ifdef SYMBIAN_DISTINCT_LOCALE_MODEL
1.64 + TBuf<NEW_LANG_VARIANT_DLL_NAME> _s_ColDllName;
1.65 +#endif
1.66 + /*******************************************************************
1.67 + Overloading new and delete operators so that they will
1.68 + allocate and deallocare memory from/to the private heap of backend
1.69 + ********************************************************************/
1.70 + inline TAny* operator new(TUint aSize, TAny* aBase) __NO_THROW
1.71 + {
1.72 + Mem::FillZ(aBase, aSize); return aBase;
1.73 + }
1.74 +
1.75 + inline TAny* operator new(TUint aSize) __NO_THROW
1.76 + {
1.77 + return Backend()->Alloc(aSize);
1.78 + }
1.79 +
1.80 + inline TAny* operator new(TUint aSize, TLeave)
1.81 + {
1.82 + TAny* ptr = Backend()->Alloc(aSize);
1.83 + if (ptr == NULL)
1.84 + {
1.85 + User::Leave(KErrNoMemory);
1.86 + }
1.87 + return ptr;
1.88 + }
1.89 +
1.90 + inline TAny* operator new(TUint aSize, TUint aExtraSize) __NO_THROW
1.91 + {
1.92 + return Backend()->Alloc(aSize + aExtraSize);
1.93 + }
1.94 +
1.95 + inline TAny* operator new(TUint aSize, TLeave, TUint aExtraSize)
1.96 + {
1.97 + TAny* ptr = Backend()->Alloc(aSize + aExtraSize);
1.98 + if (ptr == NULL)
1.99 + {
1.100 + User::Leave(KErrNoMemory);
1.101 + }
1.102 + return ptr;
1.103 + }
1.104 +
1.105 + inline void operator delete(TAny *aPtr) __NO_THROW
1.106 + {
1.107 + Backend()->Free( aPtr );
1.108 + }
1.109 +};
1.110 +
1.111 +typedef struct LocaleInfo _localeinfo;
1.112 +
1.113 +#endif //_LOCALETLSINFO_H_
1.114 +
1.115 +
1.116 +