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

A wrapper of I18N wrappers. More...

#include <intlwrapper.hxx>

Collaboration diagram for IntlWrapper:
[legend]

Public Member Functions

 IntlWrapper (LanguageTag aLanguageTag)
 
 ~IntlWrapper ()
 
const LocaleDataWrappergetLocaleData () const
 
const CollatorWrappergetCollator () const
 case insensitive collator, simple IGNORE_CASE More...
 
const CollatorWrappergetCaseCollator () const
 case sensitive collator More...
 

Private Member Functions

void ImplNewLocaleData () const
 
void ImplNewCollator (bool bCaseSensitive) const
 

Private Attributes

LanguageTag maLanguageTag
 
css::uno::Reference< css::uno::XComponentContext > m_xContext
 
std::unique_ptr< LocaleDataWrapperpLocaleData
 
std::optional< CollatorWrappermoCollator
 
std::optional< CollatorWrappermoCaseCollator
 

Detailed Description

A wrapper of I18N wrappers.

Using this is more expensive than using some single wrapper classes so use it only if you must pass a single pointer without knowing in advance what is needed, e.g. for SfxPoolItem::GetPresentation(). Remember that this wrapper was only created for convenience to bypass some oddities, if possible don't use it.

Implemented are only the const get...() methods of the wrappers, which are loaded on demand, for consistency reasons no change of locale is possible. Only default calendar and default collator are supported.

One exception though is the calendar wrapper: to be able to set a value and retrieve calendar values it is not const, so methods using this should reset the calendar to the previous value if it isn't sure where the IntlWrapper did come from.

Definition at line 51 of file intlwrapper.hxx.

Constructor & Destructor Documentation

◆ IntlWrapper()

IntlWrapper::IntlWrapper ( LanguageTag  aLanguageTag)

Definition at line 27 of file intlwrapper.cxx.

References getProcessComponentContext(), m_xContext, and maLanguageTag.

◆ ~IntlWrapper()

IntlWrapper::~IntlWrapper ( )

Definition at line 34 of file intlwrapper.cxx.

Member Function Documentation

◆ getCaseCollator()

const CollatorWrapper * IntlWrapper::getCaseCollator ( ) const
inline

case sensitive collator

Definition at line 82 of file intlwrapper.hxx.

◆ getCollator()

const CollatorWrapper * IntlWrapper::getCollator ( ) const
inline

case insensitive collator, simple IGNORE_CASE

Definition at line 75 of file intlwrapper.hxx.

◆ getLocaleData()

const LocaleDataWrapper * IntlWrapper::getLocaleData ( ) const
inline

Definition at line 68 of file intlwrapper.hxx.

◆ ImplNewCollator()

void IntlWrapper::ImplNewCollator ( bool  bCaseSensitive) const
private

◆ ImplNewLocaleData()

void IntlWrapper::ImplNewLocaleData ( ) const
private

Definition at line 38 of file intlwrapper.cxx.

References m_xContext, maLanguageTag, and pLocaleData.

Member Data Documentation

◆ m_xContext

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

Definition at line 55 of file intlwrapper.hxx.

Referenced by ImplNewCollator(), and ImplNewLocaleData().

◆ maLanguageTag

LanguageTag IntlWrapper::maLanguageTag
private

Definition at line 54 of file intlwrapper.hxx.

Referenced by ImplNewCollator(), and ImplNewLocaleData().

◆ moCaseCollator

std::optional<CollatorWrapper> IntlWrapper::moCaseCollator
private

Definition at line 59 of file intlwrapper.hxx.

Referenced by ImplNewCollator().

◆ moCollator

std::optional<CollatorWrapper> IntlWrapper::moCollator
private

Definition at line 58 of file intlwrapper.hxx.

Referenced by ImplNewCollator().

◆ pLocaleData

std::unique_ptr<LocaleDataWrapper> IntlWrapper::pLocaleData
private

Definition at line 57 of file intlwrapper.hxx.

Referenced by ImplNewLocaleData().


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