LibreOffice Module unotools (master) 1
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
LocaleDataWrapper Class Reference

This class can be accessed without locking because we load all of the data in the constructor. More...

#include <localedatawrapper.hxx>

Collaboration diagram for LocaleDataWrapper:
[legend]

Public Member Functions

 LocaleDataWrapper (const css::uno::Reference< css::uno::XComponentContext > &rxContext, LanguageTag aLanguageTag)
 
 LocaleDataWrapper (LanguageTag aLanguageTag, const std::vector< OUString > &rOverrideDateAcceptancePatterns={})
 
 ~LocaleDataWrapper ()
 
const css::uno::Reference< css::uno::XComponentContext > & getComponentContext () const
 Get the service factory, meant to be able to create a CalendarWrapper from a LocaleDataWrapper. More...
 
const LanguageTaggetLanguageTag () const
 get current requested Locale More...
 
LanguageTag getLoadedLanguageTag () const
 get current loaded Locale, which might differ from the requested Locale More...
 
css::i18n::LanguageCountryInfo getLanguageCountryInfo () const
 
const css::i18n::LocaleDataItem2 & getLocaleItem () const
 NOTE: this wraps XLocaleData5::getLocaleItem2() in fact. More...
 
css::uno::Sequence< css::i18n::Calendar2 > getAllCalendars () const
 NOTE: this wraps XLocaleData3::getAllCalendars2() in fact. More...
 
css::uno::Sequence< css::i18n::Currency2 > getAllCurrencies () const
 NOTE: this wraps XLocaleData2::getAllCurrencies2() in fact. More...
 
css::uno::Sequence< css::i18n::FormatElement > getAllFormats () const
 
css::i18n::ForbiddenCharacters getForbiddenCharacters () const
 
const css::uno::Sequence< css::lang::Locale > & getAllInstalledLocaleNames () const
 
const css::uno::Sequence< OUString > & getDateAcceptancePatterns () const
 
MeasurementSystem mapMeasurementStringToEnum (std::u16string_view rMS) const
 maps the LocaleData string to the International enum More...
 
const std::shared_ptr< css::i18n::Calendar2 > & getDefaultCalendar () const
 Convenience method to obtain the default calendar. More...
 
css::uno::Sequence< css::i18n::CalendarItem2 > const & getDefaultCalendarDays () const
 Convenience method to obtain the day names of the default calendar. More...
 
css::uno::Sequence< css::i18n::CalendarItem2 > const & getDefaultCalendarMonths () const
 Convenience method to obtain the month names of the default calendar. More...
 
bool doesSecondaryCalendarUseEC (std::u16string_view rName) const
 If the secondary calendar, if any, is of the name passed AND number formats using it usually use the E or EE keyword (EC|EEC). More...
 
const css::uno::Sequence< sal_Int32 > & getDigitGrouping () const
 Obtain digit grouping. More...
 
const OUString & getDateSep () const
 
const OUString & getNumThousandSep () const
 
const OUString & getNumDecimalSep () const
 
const OUString & getNumDecimalSepAlt () const
 
const OUString & getTimeSep () const
 
const OUString & getTime100SecSep () const
 
const OUString & getListSep () const
 
const OUString & getQuotationMarkStart () const
 
const OUString & getQuotationMarkEnd () const
 
const OUString & getDoubleQuotationMarkStart () const
 
const OUString & getDoubleQuotationMarkEnd () const
 
MeasurementSystem getMeasurementSystemEnum () const
 
const OUString & getTimeAM () const
 
const OUString & getTimePM () const
 
const OUString & getLongDateDayOfWeekSep () const
 
const OUString & getLongDateDaySep () const
 
const OUString & getLongDateMonthSep () const
 
const OUString & getLongDateYearSep () const
 
double stringToDouble (std::u16string_view aString, bool bUseGroupSep, rtl_math_ConversionStatus *pStatus, sal_Int32 *pParseEnd) const
 A wrapper around rtl::math::stringToDouble() using the locale dependent decimal separator, group separator, and if needed decimal separator alternative. More...
 
double stringToDouble (const sal_Unicode *pBegin, const sal_Unicode *pEnd, bool bUseGroupSep, rtl_math_ConversionStatus *pStatus, const sal_Unicode **ppParseEnd) const
 A wrapper around rtl_math_uStringToDouble() using the locale dependent decimal separator, group separator, and if needed decimal separator alternative. More...
 
const OUString & getCurrSymbol () const
 
const OUString & getCurrBankSymbol () const
 
sal_uInt16 getCurrPositiveFormat () const
 
sal_uInt16 getCurrNegativeFormat () const
 
sal_uInt16 getCurrDigits () const
 
DateOrder getDateOrder () const
 
LongDateOrder getLongDateOrder () const
 
OUString getDate (const Date &rDate) const
 only numerical values of Gregorian calendar More...
 
OUString getTime (const tools::Time &rTime, bool bSec=true, bool b100Sec=false) const
 
OUString getDuration (const tools::Duration &rDuration, bool bSec=true, bool b100Sec=false) const
 
OUString getNum (sal_Int64 nNumber, sal_uInt16 nDecimals, bool bUseThousandSep=true, bool bTrailingZeros=true) const
 Simple number formatting. More...
 
OUString getCurr (sal_Int64 nNumber, sal_uInt16 nDecimals, std::u16string_view rCurrencySymbol, bool bUseThousandSep=true) const
 "Secure" currency formatted string. More...
 
sal_Unicode getCurrZeroChar () const
 
const OUString & getTrueWord () const
 
const OUString & getFalseWord () const
 
const OUString & getAboveWord () const
 
const OUString & getBelowWord () const
 
const OUString & getQuarterAbbreviation (sal_Int16 nQuarter) const
 return a quarter abbreviation string matching nQuarter (0..3) => "Q1" .. "Q2" More...
 
OUString appendLocaleInfo (std::u16string_view rDebugMsg) const
 Append locale info to string, used with locale data checking. More...
 
 LocaleDataWrapper (const LocaleDataWrapper &)=delete
 
LocaleDataWrapperoperator= (const LocaleDataWrapper &)=delete
 

Static Public Member Functions

static const css::uno::Sequence< css::lang::Locale > & getInstalledLocaleNames ()
 same as the wrapper implementation but static More...
 
static const std::vector< LanguageType > & getInstalledLanguageTypes ()
 Get LanguageTypes for all installed locales which are unambiguous convertible back and forth between locale ISO strings and MS-LCID LanguageType. More...
 
static bool isNumLeadingZero ()
 
static sal_uInt16 getNumDigits ()
 standard decimal places More...
 
static bool isNumTrailingZeros ()
 
static bool areChecksEnabled ()
 Return whether locale data checks are enabled. More...
 
static void outputCheckMessage (std::u16string_view rMsg)
 Output a message during locale data checking. More...
 
static void outputCheckMessage (const char *pStr)
 

Private Member Functions

void loadData ()
 
void loadDateAcceptancePatterns (const std::vector< OUString > &rOverrideDateAcceptancePatterns)
 
const OUString & getOneLocaleItem (sal_Int16 nItem) const
 
const OUString & getOneReservedWord (sal_Int16 nWord) const
 
void loadCurrencyFormats ()
 
void scanCurrFormatImpl (std::u16string_view rCode, sal_Int32 nStart, sal_Int32 &nSign, sal_Int32 &nPar, sal_Int32 &nNum, sal_Int32 &nBlank, sal_Int32 &nSym) const
 
void loadDateOrders ()
 
LongDateOrder scanDateOrderImpl (std::u16string_view rCode) const
 
void ImplAddFormatNum (rtl::OUStringBuffer &rBuf, sal_Int64 nNumber, sal_uInt16 nDecimals, bool bUseThousandSep, bool bTrailingZeros) const
 
void loadDigitGrouping ()
 
const css::lang::Locale & getMyLocale () const
 

Static Private Member Functions

static void evaluateLocaleDataChecking ()
 

Private Attributes

css::uno::Reference< css::uno::XComponentContext > m_xContext
 
css::uno::Reference< css::i18n::XLocaleData5 > xLD
 
LanguageTag maLanguageTag
 
std::shared_ptr< css::i18n::Calendar2 > xDefaultCalendar
 
std::shared_ptr< css::i18n::Calendar2 > xSecondaryCalendar
 
css::i18n::LocaleDataItem2 aLocaleDataItem
 
css::uno::Sequence< OUString > aDateAcceptancePatterns
 
css::uno::Sequence< sal_Int32 > aGrouping
 
OUString aLocaleItem [css::i18n::LocaleItem::COUNT2]
 
std::vector< OUString > aReservedWords
 
OUString aCurrSymbol
 
OUString aCurrBankSymbol
 
DateOrder nDateOrder
 
LongDateOrder nLongDateOrder
 
sal_uInt16 nCurrPositiveFormat
 
sal_uInt16 nCurrNegativeFormat
 
sal_uInt16 nCurrDigits
 

Static Private Attributes

static sal_uInt8 nLocaleDataChecking = 0
 

Detailed Description

This class can be accessed without locking because we load all of the data in the constructor.

Definition at line 76 of file localedatawrapper.hxx.

Constructor & Destructor Documentation

◆ LocaleDataWrapper() [1/3]

LocaleDataWrapper::LocaleDataWrapper ( const css::uno::Reference< css::uno::XComponentContext > &  rxContext,
LanguageTag  aLanguageTag 
)

◆ LocaleDataWrapper() [2/3]

LocaleDataWrapper::LocaleDataWrapper ( LanguageTag  aLanguageTag,
const std::vector< OUString > &  rOverrideDateAcceptancePatterns = {} 
)
Parameters
rOverrideDateAcceptancePatternsOverride locale's date acceptance patterns. An empty sequence resets the patterns to the locale's pattern sequence.

Definition at line 75 of file localedatawrapper.cxx.

References create(), getProcessComponentContext(), loadData(), loadDateAcceptancePatterns(), m_xContext, and maLanguageTag.

◆ ~LocaleDataWrapper()

LocaleDataWrapper::~LocaleDataWrapper ( )

Definition at line 88 of file localedatawrapper.cxx.

◆ LocaleDataWrapper() [3/3]

LocaleDataWrapper::LocaleDataWrapper ( const LocaleDataWrapper )
delete

Member Function Documentation

◆ appendLocaleInfo()

OUString LocaleDataWrapper::appendLocaleInfo ( std::u16string_view  rDebugMsg) const

Append locale info to string, used with locale data checking.

A string similar to "de_DE requested\n en_US loaded" is appended.

Definition at line 1409 of file localedatawrapper.cxx.

References LanguageTag::getBcp47(), getLoadedLanguageTag(), and maLanguageTag.

Referenced by loadCurrencyFormats(), loadData(), loadDateOrders(), and scanDateOrderImpl().

◆ areChecksEnabled()

static bool LocaleDataWrapper::areChecksEnabled ( )
inlinestatic

Return whether locale data checks are enabled.

Checks are enabled if the environment variable OOO_ENABLE_LOCALE_DATA_CHECKS is set to 'Y' or 'Yes' (or any other string starting with 'Y') or '1'. Also used in conjunction with the number formatter.

Definition at line 369 of file localedatawrapper.hxx.

Referenced by getInstalledLanguageTypes(), loadCurrencyFormats(), loadData(), loadDateOrders(), and scanDateOrderImpl().

◆ doesSecondaryCalendarUseEC()

bool LocaleDataWrapper::doesSecondaryCalendarUseEC ( std::u16string_view  rName) const

If the secondary calendar, if any, is of the name passed AND number formats using it usually use the E or EE keyword (EC|EEC).

Definition at line 400 of file localedatawrapper.cxx.

References LanguageTag::getBcp47(), getLoadedLanguageTag(), and xSecondaryCalendar.

◆ evaluateLocaleDataChecking()

void LocaleDataWrapper::evaluateLocaleDataChecking ( )
staticprivate

Definition at line 1431 of file localedatawrapper.cxx.

References nLocaleDataChecking.

◆ getAboveWord()

const OUString & LocaleDataWrapper::getAboveWord ( ) const
inline

Definition at line 356 of file localedatawrapper.hxx.

◆ getAllCalendars()

css::uno::Sequence< css::i18n::Calendar2 > LocaleDataWrapper::getAllCalendars ( ) const

NOTE: this wraps XLocaleData3::getAllCalendars2() in fact.

Definition at line 1464 of file localedatawrapper.cxx.

References Exception, getMyLocale(), TOOLS_WARN_EXCEPTION, and xLD.

Referenced by loadData().

◆ getAllCurrencies()

css::uno::Sequence< css::i18n::Currency2 > LocaleDataWrapper::getAllCurrencies ( ) const

NOTE: this wraps XLocaleData2::getAllCurrencies2() in fact.

Definition at line 234 of file localedatawrapper.cxx.

References Exception, getMyLocale(), TOOLS_WARN_EXCEPTION, and xLD.

Referenced by loadData().

◆ getAllFormats()

css::uno::Sequence< css::i18n::FormatElement > LocaleDataWrapper::getAllFormats ( ) const

Definition at line 247 of file localedatawrapper.cxx.

References Exception, getMyLocale(), TOOLS_WARN_EXCEPTION, and xLD.

◆ getAllInstalledLocaleNames()

const css::uno::Sequence< css::lang::Locale > & LocaleDataWrapper::getAllInstalledLocaleNames ( ) const

Definition at line 273 of file localedatawrapper.cxx.

References Exception, TOOLS_WARN_EXCEPTION, and xLD.

Referenced by getInstalledLocaleNames().

◆ getBelowWord()

const OUString & LocaleDataWrapper::getBelowWord ( ) const
inline

Definition at line 358 of file localedatawrapper.hxx.

◆ getComponentContext()

const css::uno::Reference< css::uno::XComponentContext > & LocaleDataWrapper::getComponentContext ( ) const
inline

Get the service factory, meant to be able to create a CalendarWrapper from a LocaleDataWrapper.

Note that the service factory may be non-existent if this LocaleDataWrapper was created without one and lives "on the grassland". The CalendarWrapper ctor can handle that though.

Definition at line 143 of file localedatawrapper.hxx.

References m_xContext.

◆ getCurr()

OUString LocaleDataWrapper::getCurr ( sal_Int64  nNumber,
sal_uInt16  nDecimals,
std::u16string_view  rCurrencySymbol,
bool  bUseThousandSep = true 
) const

◆ getCurrBankSymbol()

const OUString & LocaleDataWrapper::getCurrBankSymbol ( ) const

Definition at line 445 of file localedatawrapper.cxx.

References aCurrBankSymbol.

◆ getCurrDigits()

sal_uInt16 LocaleDataWrapper::getCurrDigits ( ) const

Definition at line 460 of file localedatawrapper.cxx.

References nCurrDigits.

◆ getCurrNegativeFormat()

sal_uInt16 LocaleDataWrapper::getCurrNegativeFormat ( ) const

Definition at line 455 of file localedatawrapper.cxx.

References nCurrNegativeFormat.

Referenced by getCurr().

◆ getCurrPositiveFormat()

sal_uInt16 LocaleDataWrapper::getCurrPositiveFormat ( ) const

Definition at line 450 of file localedatawrapper.cxx.

References nCurrPositiveFormat.

Referenced by getCurr().

◆ getCurrSymbol()

const OUString & LocaleDataWrapper::getCurrSymbol ( ) const

Definition at line 440 of file localedatawrapper.cxx.

References aCurrSymbol.

◆ getCurrZeroChar()

sal_Unicode LocaleDataWrapper::getCurrZeroChar ( ) const
inline

Definition at line 340 of file localedatawrapper.hxx.

Referenced by getCurr().

◆ getDate()

OUString LocaleDataWrapper::getDate ( const Date rDate) const

only numerical values of Gregorian calendar

TODO: leading zeros et al

Definition at line 1107 of file localedatawrapper.cxx.

References aBuf, aLocaleDataItem, DMY, getDateOrder(), Date::GetDay(), Date::GetMonth(), Date::GetYear(), ImplAdd2UNum(), ImplAddNum(), and MDY.

Referenced by utl::GetDateString(), and utl::GetDateTimeString().

◆ getDateAcceptancePatterns()

const css::uno::Sequence< OUString > & LocaleDataWrapper::getDateAcceptancePatterns ( ) const

Definition at line 1479 of file localedatawrapper.cxx.

References aDateAcceptancePatterns.

◆ getDateOrder()

DateOrder LocaleDataWrapper::getDateOrder ( ) const

Definition at line 681 of file localedatawrapper.cxx.

References nDateOrder.

Referenced by getDate().

◆ getDateSep()

const OUString & LocaleDataWrapper::getDateSep ( ) const
inline

Definition at line 209 of file localedatawrapper.hxx.

◆ getDefaultCalendar()

const std::shared_ptr< css::i18n::Calendar2 > & LocaleDataWrapper::getDefaultCalendar ( ) const

Convenience method to obtain the default calendar.

Definition at line 423 of file localedatawrapper.cxx.

References xDefaultCalendar.

Referenced by getDefaultCalendarDays(), and getDefaultCalendarMonths().

◆ getDefaultCalendarDays()

css::uno::Sequence< css::i18n::CalendarItem2 > const & LocaleDataWrapper::getDefaultCalendarDays ( ) const

Convenience method to obtain the day names of the default calendar.

Definition at line 428 of file localedatawrapper.cxx.

References getDefaultCalendar().

◆ getDefaultCalendarMonths()

css::uno::Sequence< css::i18n::CalendarItem2 > const & LocaleDataWrapper::getDefaultCalendarMonths ( ) const

Convenience method to obtain the month names of the default calendar.

Definition at line 433 of file localedatawrapper.cxx.

References getDefaultCalendar().

◆ getDigitGrouping()

const css::uno::Sequence< sal_Int32 > & LocaleDataWrapper::getDigitGrouping ( ) const

Obtain digit grouping.

The usually known grouping by thousands (#,###) is actually only one of possible groupings. Another one, for example, used in India is group by 3 and then by 2 indefinitely (#,##,###). The integer sequence returned here specifies grouping from right to left (!), with a 0 entry designating the end of rules and the previous value to be repeated indefinitely. Hence the sequence {3,0} specifies the usual grouping by thousands, whereas the sequence {3,2,0} specifies Indian grouping. The sal_Int32* getConstArray() can be passed directly to the ::rtl::math::doubleToString() methods as argument for the pGroups parameter.

Definition at line 906 of file localedatawrapper.cxx.

References aGrouping.

Referenced by ImplAddFormatNum().

◆ getDoubleQuotationMarkEnd()

const OUString & LocaleDataWrapper::getDoubleQuotationMarkEnd ( ) const
inline

Definition at line 229 of file localedatawrapper.hxx.

◆ getDoubleQuotationMarkStart()

const OUString & LocaleDataWrapper::getDoubleQuotationMarkStart ( ) const
inline

Definition at line 227 of file localedatawrapper.hxx.

◆ getDuration()

OUString LocaleDataWrapper::getDuration ( const tools::Duration rDuration,
bool  bSec = true,
bool  b100Sec = false 
) const

◆ getFalseWord()

const OUString & LocaleDataWrapper::getFalseWord ( ) const
inline

Definition at line 354 of file localedatawrapper.hxx.

◆ getForbiddenCharacters()

css::i18n::ForbiddenCharacters LocaleDataWrapper::getForbiddenCharacters ( ) const

Definition at line 260 of file localedatawrapper.cxx.

References Exception, getMyLocale(), TOOLS_WARN_EXCEPTION, and xLD.

◆ getInstalledLanguageTypes()

const std::vector< LanguageType > & LocaleDataWrapper::getInstalledLanguageTypes ( )
static

Get LanguageTypes for all installed locales which are unambiguous convertible back and forth between locale ISO strings and MS-LCID LanguageType.

Upon the first time the function is called when locale data checking is enabled, messages are shown for locales not matching, excluding already known problems. (e.g. used in number formatter dialog init)

Definition at line 307 of file localedatawrapper.cxx.

References areChecksEnabled(), LanguageTag::getBcp47(), getInstalledLocaleNames(), LanguageTag::getLanguageType(), LANGUAGE_DONTKNOW, LANGUAGE_NORWEGIAN, nCount, and outputCheckMessage().

◆ getInstalledLocaleNames()

const css::uno::Sequence< css::lang::Locale > & LocaleDataWrapper::getInstalledLocaleNames ( )
static

same as the wrapper implementation but static

Definition at line 294 of file localedatawrapper.cxx.

References getAllInstalledLocaleNames(), and LANGUAGE_SYSTEM.

Referenced by getInstalledLanguageTypes().

◆ getLanguageCountryInfo()

css::i18n::LanguageCountryInfo LocaleDataWrapper::getLanguageCountryInfo ( ) const

Definition at line 216 of file localedatawrapper.cxx.

References Exception, getMyLocale(), TOOLS_WARN_EXCEPTION, and xLD.

Referenced by getLoadedLanguageTag(), and loadDigitGrouping().

◆ getLanguageTag()

const LanguageTag & LocaleDataWrapper::getLanguageTag ( ) const

get current requested Locale

Definition at line 92 of file localedatawrapper.cxx.

References maLanguageTag.

◆ getListSep()

const OUString & LocaleDataWrapper::getListSep ( ) const
inline

Definition at line 221 of file localedatawrapper.hxx.

◆ getLoadedLanguageTag()

LanguageTag LocaleDataWrapper::getLoadedLanguageTag ( ) const

get current loaded Locale, which might differ from the requested Locale

Definition at line 1403 of file localedatawrapper.cxx.

References getLanguageCountryInfo().

Referenced by appendLocaleInfo(), and doesSecondaryCalendarUseEC().

◆ getLocaleItem()

const css::i18n::LocaleDataItem2 & LocaleDataWrapper::getLocaleItem ( ) const

NOTE: this wraps XLocaleData5::getLocaleItem2() in fact.

Definition at line 229 of file localedatawrapper.cxx.

References aLocaleDataItem.

◆ getLongDateDayOfWeekSep()

const OUString & LocaleDataWrapper::getLongDateDayOfWeekSep ( ) const
inline

Definition at line 237 of file localedatawrapper.hxx.

◆ getLongDateDaySep()

const OUString & LocaleDataWrapper::getLongDateDaySep ( ) const
inline

Definition at line 239 of file localedatawrapper.hxx.

◆ getLongDateMonthSep()

const OUString & LocaleDataWrapper::getLongDateMonthSep ( ) const
inline

Definition at line 241 of file localedatawrapper.hxx.

◆ getLongDateOrder()

LongDateOrder LocaleDataWrapper::getLongDateOrder ( ) const

Definition at line 686 of file localedatawrapper.cxx.

References nLongDateOrder.

◆ getLongDateYearSep()

const OUString & LocaleDataWrapper::getLongDateYearSep ( ) const
inline

Definition at line 243 of file localedatawrapper.hxx.

◆ getMeasurementSystemEnum()

MeasurementSystem LocaleDataWrapper::getMeasurementSystemEnum ( ) const
inline

Definition at line 231 of file localedatawrapper.hxx.

◆ getMyLocale()

const css::lang::Locale & LocaleDataWrapper::getMyLocale ( ) const
private

◆ getNum()

OUString LocaleDataWrapper::getNum ( sal_Int64  nNumber,
sal_uInt16  nDecimals,
bool  bUseThousandSep = true,
bool  bTrailingZeros = true 
) const

Simple number formatting.

Parameters
nNumbervalue * 10**nDecimals
bTrailingZeros</sal_True> := always display trailing zeros in decimal places, even if integer value. </sal_False> := trailing zeros are only displayed if the value is not an integer value.

Definition at line 1222 of file localedatawrapper.cxx.

References aBuf, aLocaleDataItem, ImplAddFormatNum(), and ImplGetNumberStringLengthGuess().

◆ getNumDecimalSep()

const OUString & LocaleDataWrapper::getNumDecimalSep ( ) const
inline

Definition at line 213 of file localedatawrapper.hxx.

◆ getNumDecimalSepAlt()

const OUString & LocaleDataWrapper::getNumDecimalSepAlt ( ) const
inline

Definition at line 215 of file localedatawrapper.hxx.

◆ getNumDigits()

static sal_uInt16 LocaleDataWrapper::getNumDigits ( )
inlinestatic

standard decimal places

Definition at line 345 of file localedatawrapper.hxx.

◆ getNumThousandSep()

const OUString & LocaleDataWrapper::getNumThousandSep ( ) const
inline

Definition at line 211 of file localedatawrapper.hxx.

◆ getOneLocaleItem()

const OUString & LocaleDataWrapper::getOneLocaleItem ( sal_Int16  nItem) const
private

Definition at line 370 of file localedatawrapper.cxx.

References aLocaleItem, and SAL_WARN.

◆ getOneReservedWord()

const OUString & LocaleDataWrapper::getOneReservedWord ( sal_Int16  nWord) const
private

Definition at line 380 of file localedatawrapper.cxx.

References aReservedWords, EMPTY, o3tl::make_unsigned(), and SAL_WARN.

◆ getQuarterAbbreviation()

const OUString & LocaleDataWrapper::getQuarterAbbreviation ( sal_Int16  nQuarter) const
inline

return a quarter abbreviation string matching nQuarter (0..3) => "Q1" .. "Q2"

Definition at line 361 of file localedatawrapper.hxx.

◆ getQuotationMarkEnd()

const OUString & LocaleDataWrapper::getQuotationMarkEnd ( ) const
inline

Definition at line 225 of file localedatawrapper.hxx.

◆ getQuotationMarkStart()

const OUString & LocaleDataWrapper::getQuotationMarkStart ( ) const
inline

Definition at line 223 of file localedatawrapper.hxx.

◆ getTime()

OUString LocaleDataWrapper::getTime ( const tools::Time rTime,
bool  bSec = true,
bool  b100Sec = false 
) const

◆ getTime100SecSep()

const OUString & LocaleDataWrapper::getTime100SecSep ( ) const
inline

Definition at line 219 of file localedatawrapper.hxx.

◆ getTimeAM()

const OUString & LocaleDataWrapper::getTimeAM ( ) const
inline

Definition at line 233 of file localedatawrapper.hxx.

◆ getTimePM()

const OUString & LocaleDataWrapper::getTimePM ( ) const
inline

Definition at line 235 of file localedatawrapper.hxx.

◆ getTimeSep()

const OUString & LocaleDataWrapper::getTimeSep ( ) const
inline

Definition at line 217 of file localedatawrapper.hxx.

◆ getTrueWord()

const OUString & LocaleDataWrapper::getTrueWord ( ) const
inline

Definition at line 352 of file localedatawrapper.hxx.

◆ ImplAddFormatNum()

void LocaleDataWrapper::ImplAddFormatNum ( rtl::OUStringBuffer &  rBuf,
sal_Int64  nNumber,
sal_uInt16  nDecimals,
bool  bUseThousandSep,
bool  bTrailingZeros 
) const
private

◆ isNumLeadingZero()

static bool LocaleDataWrapper::isNumLeadingZero ( )
inlinestatic

Definition at line 342 of file localedatawrapper.hxx.

Referenced by ImplAddFormatNum().

◆ isNumTrailingZeros()

static bool LocaleDataWrapper::isNumTrailingZeros ( )
inlinestatic

Definition at line 347 of file localedatawrapper.hxx.

◆ loadCurrencyFormats()

void LocaleDataWrapper::loadCurrencyFormats ( )
private

◆ loadData()

void LocaleDataWrapper::loadData ( )
private

◆ loadDateAcceptancePatterns()

void LocaleDataWrapper::loadDateAcceptancePatterns ( const std::vector< OUString > &  rOverrideDateAcceptancePatterns)
private

◆ loadDateOrders()

void LocaleDataWrapper::loadDateOrders ( )
private

◆ loadDigitGrouping()

void LocaleDataWrapper::loadDigitGrouping ( )
private

Definition at line 882 of file localedatawrapper.cxx.

References aGrouping, and getLanguageCountryInfo().

Referenced by loadData().

◆ mapMeasurementStringToEnum()

MeasurementSystem LocaleDataWrapper::mapMeasurementStringToEnum ( std::u16string_view  rMS) const

maps the LocaleData string to the International enum

TODO: could be cached too

TODO: other measurement systems? => extend enum MeasurementSystem

Definition at line 391 of file localedatawrapper.cxx.

References o3tl::equalsIgnoreAsciiCase(), Metric, u, and US.

◆ operator=()

LocaleDataWrapper & LocaleDataWrapper::operator= ( const LocaleDataWrapper )
delete

◆ outputCheckMessage() [1/2]

void LocaleDataWrapper::outputCheckMessage ( const char *  pStr)
static

Definition at line 1423 of file localedatawrapper.cxx.

References SAL_WARN.

◆ outputCheckMessage() [2/2]

void LocaleDataWrapper::outputCheckMessage ( std::u16string_view  rMsg)
static

Output a message during locale data checking.

The (UTF-8) string is written to stderr and in a non-product build or if DBG_UTIL is enabled also raised as an assertion message box.

Definition at line 1417 of file localedatawrapper.cxx.

References OUStringToOString(), and outputCheckMessage().

Referenced by getInstalledLanguageTypes(), loadCurrencyFormats(), loadData(), loadDateOrders(), outputCheckMessage(), and scanDateOrderImpl().

◆ scanCurrFormatImpl()

void LocaleDataWrapper::scanCurrFormatImpl ( std::u16string_view  rCode,
sal_Int32  nStart,
sal_Int32 &  nSign,
sal_Int32 &  nPar,
sal_Int32 &  nNum,
sal_Int32 &  nBlank,
sal_Int32 &  nSym 
) const
private

Definition at line 465 of file localedatawrapper.cxx.

References aCurrSymbol, p, and o3tl::starts_with().

Referenced by loadCurrencyFormats().

◆ scanDateOrderImpl()

LongDateOrder LocaleDataWrapper::scanDateOrderImpl ( std::u16string_view  rCode) const
private

Definition at line 691 of file localedatawrapper.cxx.

References appendLocaleInfo(), areChecksEnabled(), DMY, MDY, outputCheckMessage(), u, YDM, and YMD.

Referenced by loadDateOrders().

◆ stringToDouble() [1/2]

double LocaleDataWrapper::stringToDouble ( const sal_Unicode pBegin,
const sal_Unicode pEnd,
bool  bUseGroupSep,
rtl_math_ConversionStatus *  pStatus,
const sal_Unicode **  ppParseEnd 
) const

A wrapper around rtl_math_uStringToDouble() using the locale dependent decimal separator, group separator, and if needed decimal separator alternative.

The decimal separator is tried first, if the conversion does not match the entire string then the decimal separator alternative is tried if it occurs in the string and was the reason to stop.

Leading blanks are skipped, trailing blanks are not skipped. The number is parsed up to the first non-floating point number character, same as rtl_math_uStringToDouble() does. The caller is responsible for proper error checking and end comparison.

Parameters
pBeginThe string position to start parsing a floating point number.
pEndThe string position to stop parsing, exclusive.
bUseGroupSepWhether group separator is used/accepted during parsing.
pStatusPointer to receive the conversion status as in rtl_math_uStringToDouble().
pParseEndPointer to receive the parse end (exclusive) as in rtl_math_uStringToDouble().
Returns
The floating point number as parsed.

Definition at line 1382 of file localedatawrapper.cxx.

References aLocaleDataItem.

◆ stringToDouble() [2/2]

double LocaleDataWrapper::stringToDouble ( std::u16string_view  aString,
bool  bUseGroupSep,
rtl_math_ConversionStatus *  pStatus,
sal_Int32 *  pParseEnd 
) const

A wrapper around rtl::math::stringToDouble() using the locale dependent decimal separator, group separator, and if needed decimal separator alternative.

The decimal separator is tried first, if the conversion does not match the entire string then the decimal separator alternative is tried if it occurs in the string and was the reason to stop.

Leading blanks are skipped, trailing blanks are not skipped. The number is parsed up to the first non-floating point number character, same as rtl::math::stringToDouble() does. The caller is responsible for proper error checking and end comparison.

Parameters
aStringThe string to parse as floating point number.
bUseGroupSepWhether group separator is used/accepted during parsing.
pStatusPointer to receive the conversion status as in rtl::math::stringToDouble().
pParseEndPointer to receive the parse end (exclusive) as in rtl::math::stringToDouble().
Returns
The floating point number as parsed.

Definition at line 1372 of file localedatawrapper.cxx.

References stringToDouble().

Referenced by stringToDouble().

Member Data Documentation

◆ aCurrBankSymbol

OUString LocaleDataWrapper::aCurrBankSymbol
private

Definition at line 92 of file localedatawrapper.hxx.

Referenced by getCurrBankSymbol(), and loadData().

◆ aCurrSymbol

OUString LocaleDataWrapper::aCurrSymbol
private

Definition at line 91 of file localedatawrapper.hxx.

Referenced by getCurrSymbol(), loadData(), and scanCurrFormatImpl().

◆ aDateAcceptancePatterns

css::uno::Sequence< OUString > LocaleDataWrapper::aDateAcceptancePatterns
private

◆ aGrouping

css::uno::Sequence< sal_Int32 > LocaleDataWrapper::aGrouping
private

Definition at line 87 of file localedatawrapper.hxx.

Referenced by getDigitGrouping(), and loadDigitGrouping().

◆ aLocaleDataItem

css::i18n::LocaleDataItem2 LocaleDataWrapper::aLocaleDataItem
private

◆ aLocaleItem

OUString LocaleDataWrapper::aLocaleItem[css::i18n::LocaleItem::COUNT2]
private

Definition at line 89 of file localedatawrapper.hxx.

Referenced by getOneLocaleItem(), and loadData().

◆ aReservedWords

std::vector<OUString> LocaleDataWrapper::aReservedWords
private

Definition at line 90 of file localedatawrapper.hxx.

Referenced by getOneReservedWord(), and loadData().

◆ m_xContext

css::uno::Reference< css::uno::XComponentContext > LocaleDataWrapper::m_xContext
private

Definition at line 80 of file localedatawrapper.hxx.

Referenced by loadCurrencyFormats(), and loadDateOrders().

◆ maLanguageTag

LanguageTag LocaleDataWrapper::maLanguageTag
private

◆ nCurrDigits

sal_uInt16 LocaleDataWrapper::nCurrDigits
private

Definition at line 97 of file localedatawrapper.hxx.

Referenced by getCurrDigits(), and loadData().

◆ nCurrNegativeFormat

sal_uInt16 LocaleDataWrapper::nCurrNegativeFormat
private

Definition at line 96 of file localedatawrapper.hxx.

Referenced by getCurrNegativeFormat(), loadCurrencyFormats(), and loadData().

◆ nCurrPositiveFormat

sal_uInt16 LocaleDataWrapper::nCurrPositiveFormat
private

Definition at line 95 of file localedatawrapper.hxx.

Referenced by getCurrPositiveFormat(), loadCurrencyFormats(), and loadData().

◆ nDateOrder

DateOrder LocaleDataWrapper::nDateOrder
private

Definition at line 93 of file localedatawrapper.hxx.

Referenced by getDateOrder(), and loadDateOrders().

◆ nLocaleDataChecking

sal_uInt8 LocaleDataWrapper::nLocaleDataChecking = 0
staticprivate

Definition at line 78 of file localedatawrapper.hxx.

Referenced by evaluateLocaleDataChecking().

◆ nLongDateOrder

LongDateOrder LocaleDataWrapper::nLongDateOrder
private

Definition at line 94 of file localedatawrapper.hxx.

Referenced by getLongDateOrder(), and loadDateOrders().

◆ xDefaultCalendar

std::shared_ptr< css::i18n::Calendar2 > LocaleDataWrapper::xDefaultCalendar
private

Definition at line 83 of file localedatawrapper.hxx.

Referenced by getDefaultCalendar(), and loadData().

◆ xLD

css::uno::Reference< css::i18n::XLocaleData5 > LocaleDataWrapper::xLD
private

◆ xSecondaryCalendar

std::shared_ptr< css::i18n::Calendar2 > LocaleDataWrapper::xSecondaryCalendar
private

Definition at line 84 of file localedatawrapper.hxx.

Referenced by doesSecondaryCalendarUseEC(), and loadData().


The documentation for this class was generated from the following files: