os/kernelhwsrv/kerneltest/e32test/locl/t_table.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/locl/t_table.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,257 @@
     1.4 +// Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// f32test\locl\t_table.cpp
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +#include <kernel/localise.h>
    1.22 +
    1.23 +EXPORT_C TLanguage Locl::Language()
    1.24 +//
    1.25 +// Returns the language type.
    1.26 +//
    1.27 +	{
    1.28 +
    1.29 +	return(LCountry::Language);
    1.30 +	}
    1.31 +
    1.32 +EXPORT_C void Locl::LocaleData(SLocaleData *aLocale)
    1.33 +//
    1.34 +// Create the localisation table.
    1.35 +//
    1.36 +	{
    1.37 +
    1.38 +	aLocale->iCountryCode=LCountry::CountryCode;
    1.39 +	aLocale->iUniversalTimeOffset=LCountry::UniversalTimeOffset;
    1.40 +	aLocale->iDateFormat=LCountry::DateFormat;
    1.41 +	aLocale->iTimeFormat=LCountry::TimeFormat;
    1.42 +	aLocale->iCurrencySymbolPosition=LCountry::CurrencySymbolPosition;
    1.43 +	aLocale->iCurrencySpaceBetween=LCountry::CurrencySpaceBetween;
    1.44 +	aLocale->iCurrencyDecimalPlaces=LCountry::CurrencyDecimalPlaces;
    1.45 +	aLocale->iNegativeCurrencyFormat=(TNegativeCurrencyFormat)LCountry::CurrencyNegativeInBrackets;
    1.46 +	aLocale->iCurrencyTriadsAllowed=LCountry::CurrencyTriadsAllowed;
    1.47 +	aLocale->iThousandsSeparator=*LCountry::ThousandsSeparator;
    1.48 +	aLocale->iDecimalSeparator=*LCountry::DecimalSeparator;
    1.49 +	TInt i=0;
    1.50 +	for(;i<KMaxDateSeparators;i++)
    1.51 +		aLocale->iDateSeparator[i]=*LCountry::DateSeparator[i];
    1.52 +	for(i=0;i<KMaxTimeSeparators;i++)
    1.53 +		aLocale->iTimeSeparator[i]=*LCountry::TimeSeparator[i];
    1.54 +	aLocale->iAmPmSymbolPosition=LCountry::AmPmSymbolPosition;
    1.55 +	aLocale->iAmPmSpaceBetween=LCountry::AmPmSpaceBetween;
    1.56 +//	aLocale->iDaylightSaving=LCountry::DaylightSaving;
    1.57 +	aLocale->iHomeDaylightSavingZone=LCountry::HomeDaylightSavingZone;
    1.58 +	aLocale->iWorkDays=LCountry::WorkDays;
    1.59 +	aLocale->iStartOfWeek=LCountry::StartOfWeek;
    1.60 +	aLocale->iClockFormat=LCountry::ClockFormat;
    1.61 +	aLocale->iUnitsGeneral=LCountry::UnitsGeneral;
    1.62 +	aLocale->iUnitsDistanceLong=LCountry::UnitsGeneral;
    1.63 +	aLocale->iUnitsDistanceShort=LCountry::UnitsGeneral;
    1.64 +	}
    1.65 +
    1.66 +EXPORT_C const TText * Locl::CurrencySymbol()
    1.67 +//
    1.68 +// Returns the address of the currency symbol.
    1.69 +//
    1.70 +	{
    1.71 +
    1.72 +	return(LCountry::CurrencySymbol);
    1.73 +	}
    1.74 +
    1.75 +EXPORT_C const TText* Locl::ShortDateFormatSpec()
    1.76 +//
    1.77 +// Returns the address of the short date format.
    1.78 +//
    1.79 +	{
    1.80 +
    1.81 +	return(LCountry::ShortDateFormatSpec);
    1.82 +	}
    1.83 +
    1.84 +EXPORT_C const TText* Locl::LongDateFormatSpec()
    1.85 +//
    1.86 +// Returns the address of the long date format.
    1.87 +//
    1.88 +	{
    1.89 +
    1.90 +	return(LCountry::LongDateFormatSpec);
    1.91 +	}
    1.92 +
    1.93 +EXPORT_C const TText* Locl::TimeFormatSpec()
    1.94 +//
    1.95 +// Returns the address of the long date format.
    1.96 +//
    1.97 +	{
    1.98 +
    1.99 +	return(LCountry::TimeFormatSpec);
   1.100 +	}
   1.101 +
   1.102 +EXPORT_C const TFatUtilityFunctions* Locl::FatUtilityFunctions()
   1.103 +//
   1.104 +// Returns the addresses of the FAT utility functions.
   1.105 +//
   1.106 +	{
   1.107 +
   1.108 +	return(LCountry::FatUtilityFunctions);
   1.109 +	}
   1.110 +
   1.111 +EXPORT_C const TText * const * Locl::DateSuffixTable()
   1.112 +//
   1.113 +// Returns the address of the date suffix table.
   1.114 +//
   1.115 +	{
   1.116 +
   1.117 +	return(&LLanguage::DateSuffixTable[0]);
   1.118 +	}
   1.119 +
   1.120 +EXPORT_C const TText * const * Locl::DayTable()
   1.121 +//
   1.122 +// Returns the address of the day table.
   1.123 +//
   1.124 +	{
   1.125 +
   1.126 +	return(&LLanguage::DayTable[0]);
   1.127 +	}
   1.128 +
   1.129 +EXPORT_C const TText * const * Locl::DayAbbTable()
   1.130 +//
   1.131 +// Returns the address of the abbreviated day table.
   1.132 +//
   1.133 +	{
   1.134 +
   1.135 +	return(&LLanguage::DayAbbTable[0]);
   1.136 +	}
   1.137 +
   1.138 +EXPORT_C const TText * const * Locl::MonthTable()
   1.139 +//
   1.140 +// Returns the address of the month table.
   1.141 +//
   1.142 +	{
   1.143 +
   1.144 +	return(&LLanguage::MonthTable[0]);
   1.145 +	}
   1.146 +
   1.147 +EXPORT_C const TText * const * Locl::MonthAbbTable()
   1.148 +//
   1.149 +// Returns the address of the abbreviated month table.
   1.150 +//
   1.151 +	{
   1.152 +
   1.153 +	return(&LLanguage::MonthAbbTable[0]);
   1.154 +	}
   1.155 +
   1.156 +EXPORT_C const TText * const * Locl::AmPmTable()
   1.157 +//
   1.158 +// Returns the address of the AmPm table.
   1.159 +//
   1.160 +	{
   1.161 +
   1.162 +	return(&LLanguage::AmPmTable[0]);
   1.163 +	}
   1.164 +
   1.165 +EXPORT_C const TText * const * Locl::MsgTable()
   1.166 +//
   1.167 +// Returns the address of the message table.
   1.168 +//
   1.169 +	{
   1.170 +
   1.171 +	return(&LMessages::MsgTable[0]);
   1.172 +	}
   1.173 +
   1.174 +// Return the address of the locale character set object: contains collation rules etc.
   1.175 +EXPORT_C const LCharSet* Locl::CharSet()
   1.176 +	{
   1.177 +	#ifdef _UNICODE
   1.178 +		return &TheCharSet;
   1.179 +	#else
   1.180 +		return NULL;
   1.181 +	#endif
   1.182 +	}
   1.183 +
   1.184 +// The functions returning locale-specific character attribute tables do not exist in the Unicode build.
   1.185 +EXPORT_C const TUint8 * Locl::TypeTable()
   1.186 +//
   1.187 +// Return the address of the type table.
   1.188 +//
   1.189 +	{
   1.190 +	#ifdef _UNICODE
   1.191 +		return NULL;
   1.192 +	#else
   1.193 +		return(&LAlphabet::TypeTable[0]);
   1.194 +	#endif 		
   1.195 +	}
   1.196 +
   1.197 +
   1.198 +EXPORT_C const TText * Locl::UpperTable()
   1.199 +//
   1.200 +// Return the address of the upper table.
   1.201 +//
   1.202 +	{
   1.203 +	#ifdef _UNICODE
   1.204 +		return NULL;
   1.205 +	#else
   1.206 +		return(&LAlphabet::UpperTable[0]);
   1.207 +	#endif 
   1.208 +
   1.209 +	}
   1.210 +
   1.211 +
   1.212 +EXPORT_C const TText * Locl::LowerTable()
   1.213 +//
   1.214 +// Return the address of the lower table.
   1.215 +//
   1.216 +	{
   1.217 +	#ifdef _UNICODE
   1.218 +		return NULL;
   1.219 +	#else
   1.220 +		return(&LAlphabet::LowerTable[0]);
   1.221 +	#endif 
   1.222 +	}
   1.223 +
   1.224 +
   1.225 +EXPORT_C const TText * Locl::FoldTable()
   1.226 +//
   1.227 +// Return the address of the fold table.
   1.228 +//
   1.229 +	{
   1.230 +	#ifdef _UNICODE
   1.231 +		return NULL;
   1.232 +	#else
   1.233 +		return(&LAlphabet::FoldTable[0]);
   1.234 +	#endif 
   1.235 +	}
   1.236 +
   1.237 +EXPORT_C const TText * Locl::CollTable()
   1.238 +//
   1.239 +// Return the address of the collate table.
   1.240 +//
   1.241 +	{
   1.242 +	#ifdef _UNICODE
   1.243 +		return NULL;
   1.244 +	#else
   1.245 +		return(&LAlphabet::CollTable[0]);
   1.246 +	#endif 
   1.247 +	}
   1.248 +
   1.249 +EXPORT_C TBool Locl::UniCode()
   1.250 +//
   1.251 +// Returns ETrue for Unicode Build 
   1.252 +//
   1.253 +	{
   1.254 +	#ifdef _UNICODE
   1.255 +		return ETrue;
   1.256 +	#else
   1.257 +		return EFalse;
   1.258 +	#endif 
   1.259 +	}
   1.260 +