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