LibreOffice Module unotools (master) 1
|
This class can be accessed without locking because we load all of the data in the constructor. More...
#include <localedatawrapper.hxx>
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 LanguageTag & | getLanguageTag () 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 | |
LocaleDataWrapper & | operator= (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 |
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.
LocaleDataWrapper::LocaleDataWrapper | ( | const css::uno::Reference< css::uno::XComponentContext > & | rxContext, |
LanguageTag | aLanguageTag | ||
) |
LocaleDataWrapper::LocaleDataWrapper | ( | LanguageTag | aLanguageTag, |
const std::vector< OUString > & | rOverrideDateAcceptancePatterns = {} |
||
) |
rOverrideDateAcceptancePatterns | Override 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 | ( | ) |
Definition at line 88 of file localedatawrapper.cxx.
|
delete |
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().
|
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().
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.
|
staticprivate |
Definition at line 1431 of file localedatawrapper.cxx.
References nLocaleDataChecking.
|
inline |
Definition at line 356 of file localedatawrapper.hxx.
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().
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().
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.
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().
|
inline |
Definition at line 358 of file localedatawrapper.hxx.
|
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.
OUString LocaleDataWrapper::getCurr | ( | sal_Int64 | nNumber, |
sal_uInt16 | nDecimals, | ||
std::u16string_view | rCurrencySymbol, | ||
bool | bUseThousandSep = true |
||
) | const |
"Secure" currency formatted string.
Definition at line 1235 of file localedatawrapper.cxx.
References aLocaleDataItem, getCurrNegativeFormat(), getCurrPositiveFormat(), getCurrZeroChar(), i, ImplAddFormatNum(), and ImplGetNumberStringLengthGuess().
const OUString & LocaleDataWrapper::getCurrBankSymbol | ( | ) | const |
Definition at line 445 of file localedatawrapper.cxx.
References aCurrBankSymbol.
sal_uInt16 LocaleDataWrapper::getCurrDigits | ( | ) | const |
Definition at line 460 of file localedatawrapper.cxx.
References nCurrDigits.
sal_uInt16 LocaleDataWrapper::getCurrNegativeFormat | ( | ) | const |
Definition at line 455 of file localedatawrapper.cxx.
References nCurrNegativeFormat.
Referenced by getCurr().
sal_uInt16 LocaleDataWrapper::getCurrPositiveFormat | ( | ) | const |
Definition at line 450 of file localedatawrapper.cxx.
References nCurrPositiveFormat.
Referenced by getCurr().
const OUString & LocaleDataWrapper::getCurrSymbol | ( | ) | const |
Definition at line 440 of file localedatawrapper.cxx.
References aCurrSymbol.
|
inline |
Definition at line 340 of file localedatawrapper.hxx.
Referenced by getCurr().
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().
const css::uno::Sequence< OUString > & LocaleDataWrapper::getDateAcceptancePatterns | ( | ) | const |
Definition at line 1479 of file localedatawrapper.cxx.
References aDateAcceptancePatterns.
DateOrder LocaleDataWrapper::getDateOrder | ( | ) | const |
Definition at line 681 of file localedatawrapper.cxx.
References nDateOrder.
Referenced by getDate().
|
inline |
Definition at line 209 of file localedatawrapper.hxx.
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().
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().
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().
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().
|
inline |
Definition at line 229 of file localedatawrapper.hxx.
|
inline |
Definition at line 227 of file localedatawrapper.hxx.
OUString LocaleDataWrapper::getDuration | ( | const tools::Duration & | rDuration, |
bool | bSec = true , |
||
bool | b100Sec = false |
||
) | const |
Definition at line 1177 of file localedatawrapper.cxx.
References aBuf, aLocaleDataItem, tools::Duration::GetDays(), tools::Time::GetHour(), tools::Time::GetMin(), tools::Time::GetNanoSec(), tools::Time::GetSec(), tools::Duration::GetTime(), ImplAdd2UNum(), ImplAdd9UNum(), ImplAddNum(), and tools::Duration::IsNegative().
|
inline |
Definition at line 354 of file localedatawrapper.hxx.
css::i18n::ForbiddenCharacters LocaleDataWrapper::getForbiddenCharacters | ( | ) | const |
Definition at line 260 of file localedatawrapper.cxx.
References Exception, getMyLocale(), TOOLS_WARN_EXCEPTION, and xLD.
|
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().
|
static |
same as the wrapper implementation but static
Definition at line 294 of file localedatawrapper.cxx.
References getAllInstalledLocaleNames(), and LANGUAGE_SYSTEM.
Referenced by getInstalledLanguageTypes().
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().
const LanguageTag & LocaleDataWrapper::getLanguageTag | ( | ) | const |
get current requested Locale
Definition at line 92 of file localedatawrapper.cxx.
References maLanguageTag.
|
inline |
Definition at line 221 of file localedatawrapper.hxx.
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().
const css::i18n::LocaleDataItem2 & LocaleDataWrapper::getLocaleItem | ( | ) | const |
NOTE: this wraps XLocaleData5::getLocaleItem2() in fact.
Definition at line 229 of file localedatawrapper.cxx.
References aLocaleDataItem.
|
inline |
Definition at line 237 of file localedatawrapper.hxx.
|
inline |
Definition at line 239 of file localedatawrapper.hxx.
|
inline |
Definition at line 241 of file localedatawrapper.hxx.
LongDateOrder LocaleDataWrapper::getLongDateOrder | ( | ) | const |
Definition at line 686 of file localedatawrapper.cxx.
References nLongDateOrder.
|
inline |
Definition at line 243 of file localedatawrapper.hxx.
|
inline |
Definition at line 231 of file localedatawrapper.hxx.
|
private |
Definition at line 97 of file localedatawrapper.cxx.
References LanguageTag::getLocale(), and maLanguageTag.
Referenced by getAllCalendars(), getAllCurrencies(), getAllFormats(), getForbiddenCharacters(), and getLanguageCountryInfo().
OUString LocaleDataWrapper::getNum | ( | sal_Int64 | nNumber, |
sal_uInt16 | nDecimals, | ||
bool | bUseThousandSep = true , |
||
bool | bTrailingZeros = true |
||
) | const |
Simple number formatting.
nNumber | value * 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().
|
inline |
Definition at line 213 of file localedatawrapper.hxx.
|
inline |
Definition at line 215 of file localedatawrapper.hxx.
|
inlinestatic |
standard decimal places
Definition at line 345 of file localedatawrapper.hxx.
|
inline |
Definition at line 211 of file localedatawrapper.hxx.
|
private |
Definition at line 370 of file localedatawrapper.cxx.
References aLocaleItem, and SAL_WARN.
|
private |
Definition at line 380 of file localedatawrapper.cxx.
References aReservedWords, EMPTY, o3tl::make_unsigned(), and SAL_WARN.
|
inline |
return a quarter abbreviation string matching nQuarter (0..3) => "Q1" .. "Q2"
Definition at line 361 of file localedatawrapper.hxx.
|
inline |
Definition at line 225 of file localedatawrapper.hxx.
|
inline |
Definition at line 223 of file localedatawrapper.hxx.
OUString LocaleDataWrapper::getTime | ( | const tools::Time & | rTime, |
bool | bSec = true , |
||
bool | b100Sec = false |
||
) | const |
TODO: leading zeros et al
Definition at line 1151 of file localedatawrapper.cxx.
References aBuf, aLocaleDataItem, tools::Time::GetHour(), tools::Time::GetMin(), tools::Time::GetNanoSec(), tools::Time::GetSec(), ImplAdd2UNum(), and ImplAdd9UNum().
Referenced by utl::GetDateTimeString().
|
inline |
Definition at line 219 of file localedatawrapper.hxx.
|
inline |
Definition at line 233 of file localedatawrapper.hxx.
|
inline |
Definition at line 235 of file localedatawrapper.hxx.
|
inline |
Definition at line 217 of file localedatawrapper.hxx.
|
inline |
Definition at line 352 of file localedatawrapper.hxx.
|
private |
Definition at line 1008 of file localedatawrapper.cxx.
References abs(), aLocaleDataItem, utl::DigitGroupingIterator::createForwardSequence(), getDigitGrouping(), i, ImplAddUNum(), and isNumLeadingZero().
|
inlinestatic |
Definition at line 342 of file localedatawrapper.hxx.
Referenced by ImplAddFormatNum().
|
inlinestatic |
Definition at line 347 of file localedatawrapper.hxx.
|
private |
Definition at line 543 of file localedatawrapper.cxx.
References appendLocaleInfo(), areChecksEnabled(), Default, LanguageTag::getLocale(), m_xContext, maLanguageTag, nCurrFormatDefault, nCurrNegativeFormat, nCurrPositiveFormat, outputCheckMessage(), scanCurrFormatImpl(), and u.
Referenced by loadData().
|
private |
Definition at line 102 of file localedatawrapper.cxx.
References aCurrBankSymbol, aCurrSymbol, aDateAcceptancePatterns, aLocaleDataItem, aLocaleItem, appendLocaleInfo(), areChecksEnabled(), aReservedWords, Exception, getAllCalendars(), getAllCurrencies(), LanguageTag::getLocale(), loadCurrencyFormats(), loadDateOrders(), loadDigitGrouping(), maLanguageTag, nCurrDigits, nCurrFormatDefault, nCurrNegativeFormat, nCurrPositiveFormat, outputCheckMessage(), TOOLS_WARN_EXCEPTION, u, xDefaultCalendar, xLD, and xSecondaryCalendar.
Referenced by LocaleDataWrapper().
|
private |
Definition at line 1486 of file localedatawrapper.cxx.
References aDateAcceptancePatterns, comphelper::containerToSequence(), Exception, LanguageTag::getLocale(), maLanguageTag, TOOLS_WARN_EXCEPTION, and xLD.
Referenced by LocaleDataWrapper().
|
private |
Definition at line 792 of file localedatawrapper.cxx.
References appendLocaleInfo(), areChecksEnabled(), Default, DMY, getDateOrderFromLongDateOrder(), LanguageTag::getLocale(), m_xContext, maLanguageTag, nDateOrder, nLongDateOrder, outputCheckMessage(), scanDateOrderImpl(), and u.
Referenced by loadData().
|
private |
Definition at line 882 of file localedatawrapper.cxx.
References aGrouping, and getLanguageCountryInfo().
Referenced by loadData().
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.
|
delete |
|
static |
Definition at line 1423 of file localedatawrapper.cxx.
References SAL_WARN.
|
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().
|
private |
Definition at line 465 of file localedatawrapper.cxx.
References aCurrSymbol, p, and o3tl::starts_with().
Referenced by loadCurrencyFormats().
|
private |
Definition at line 691 of file localedatawrapper.cxx.
References appendLocaleInfo(), areChecksEnabled(), DMY, MDY, outputCheckMessage(), u, YDM, and YMD.
Referenced by loadDateOrders().
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.
pBegin | The string position to start parsing a floating point number. |
pEnd | The string position to stop parsing, exclusive. |
bUseGroupSep | Whether group separator is used/accepted during parsing. |
pStatus | Pointer to receive the conversion status as in rtl_math_uStringToDouble(). |
pParseEnd | Pointer to receive the parse end (exclusive) as in rtl_math_uStringToDouble(). |
Definition at line 1382 of file localedatawrapper.cxx.
References aLocaleDataItem.
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.
aString | The string to parse as floating point number. |
bUseGroupSep | Whether group separator is used/accepted during parsing. |
pStatus | Pointer to receive the conversion status as in rtl::math::stringToDouble(). |
pParseEnd | Pointer to receive the parse end (exclusive) as in rtl::math::stringToDouble(). |
Definition at line 1372 of file localedatawrapper.cxx.
References stringToDouble().
Referenced by stringToDouble().
|
private |
Definition at line 92 of file localedatawrapper.hxx.
Referenced by getCurrBankSymbol(), and loadData().
|
private |
Definition at line 91 of file localedatawrapper.hxx.
Referenced by getCurrSymbol(), loadData(), and scanCurrFormatImpl().
|
private |
Definition at line 86 of file localedatawrapper.hxx.
Referenced by getDateAcceptancePatterns(), loadData(), and loadDateAcceptancePatterns().
|
private |
Definition at line 87 of file localedatawrapper.hxx.
Referenced by getDigitGrouping(), and loadDigitGrouping().
|
private |
Definition at line 85 of file localedatawrapper.hxx.
Referenced by getCurr(), getDate(), getDuration(), getLocaleItem(), getNum(), getTime(), ImplAddFormatNum(), loadData(), and stringToDouble().
|
private |
Definition at line 89 of file localedatawrapper.hxx.
Referenced by getOneLocaleItem(), and loadData().
|
private |
Definition at line 90 of file localedatawrapper.hxx.
Referenced by getOneReservedWord(), and loadData().
|
private |
Definition at line 80 of file localedatawrapper.hxx.
Referenced by loadCurrencyFormats(), and loadDateOrders().
|
private |
Definition at line 82 of file localedatawrapper.hxx.
Referenced by appendLocaleInfo(), getLanguageTag(), getMyLocale(), loadCurrencyFormats(), loadData(), loadDateAcceptancePatterns(), and loadDateOrders().
|
private |
Definition at line 97 of file localedatawrapper.hxx.
Referenced by getCurrDigits(), and loadData().
|
private |
Definition at line 96 of file localedatawrapper.hxx.
Referenced by getCurrNegativeFormat(), loadCurrencyFormats(), and loadData().
|
private |
Definition at line 95 of file localedatawrapper.hxx.
Referenced by getCurrPositiveFormat(), loadCurrencyFormats(), and loadData().
|
private |
Definition at line 93 of file localedatawrapper.hxx.
Referenced by getDateOrder(), and loadDateOrders().
|
staticprivate |
Definition at line 78 of file localedatawrapper.hxx.
Referenced by evaluateLocaleDataChecking().
|
private |
Definition at line 94 of file localedatawrapper.hxx.
Referenced by getLongDateOrder(), and loadDateOrders().
|
private |
Definition at line 83 of file localedatawrapper.hxx.
Referenced by getDefaultCalendar(), and loadData().
|
private |
Definition at line 81 of file localedatawrapper.hxx.
Referenced by getAllCalendars(), getAllCurrencies(), getAllFormats(), getAllInstalledLocaleNames(), getForbiddenCharacters(), getLanguageCountryInfo(), loadData(), and loadDateAcceptancePatterns().
|
private |
Definition at line 84 of file localedatawrapper.hxx.
Referenced by doesSecondaryCalendarUseEC(), and loadData().