System::Globalization::CultureInfo Class Reference

Inherits System::Object, System::IFormatProvider, and System::ICloneable.

Public Member Functions

ASPOSECPP_SHARED_API CultureInfo (int culture)
 
ASPOSECPP_SHARED_API CultureInfo (int culture, bool use_user_override)
 
ASPOSECPP_SHARED_API CultureInfo (const String &name)
 
ASPOSECPP_SHARED_API CultureInfo (const String &name, bool use_user_override)
 
ASPOSECPP_SHARED_API CultureInfo (std::nullptr_t)
 Always throws ArgumentNullException. More...
 
virtual ASPOSECPP_SHARED_API String get_Name () const
 
virtual ASPOSECPP_SHARED_API String get_EnglishName () const
 
virtual ASPOSECPP_SHARED_API String get_NativeName () const
 
virtual ASPOSECPP_SHARED_API String get_DisplayName () const
 
virtual ASPOSECPP_SHARED_API int get_LCID () const
 
ASPOSECPP_SHARED_API String get_IetfLanguageTag () const
 
virtual ASPOSECPP_SHARED_API bool get_IsNeutralCulture () const
 
virtual ASPOSECPP_SHARED_API String get_ThreeLetterWindowsLanguageName () const
 
virtual ASPOSECPP_SHARED_API String get_ThreeLetterISOLanguageName () const
 
virtual ASPOSECPP_SHARED_API String get_TwoLetterISOLanguageName () const
 
ASPOSECPP_SHARED_API bool get_UseUserOverride () const
 
ASPOSECPP_SHARED_API bool get_IsReadOnly () const
 
ASPOSECPP_SHARED_API CultureTypes get_CultureTypes () const
 
virtual ASPOSECPP_SHARED_API int get_KeyboardLayoutId () const
 
virtual ASPOSECPP_SHARED_API CultureInfoPtr get_Parent () const
 
virtual ASPOSECPP_SHARED_API TextInfoPtr get_TextInfo () const
 
virtual ASPOSECPP_SHARED_API CompareInfoPtr get_CompareInfo () const
 
virtual ASPOSECPP_SHARED_API CalendarPtr get_Calendar () const
 
virtual ASPOSECPP_SHARED_API ArrayPtr< CalendarPtrget_OptionalCalendars () const
 
virtual ASPOSECPP_SHARED_API NumberFormatInfoPtr get_NumberFormat () const
 
virtual ASPOSECPP_SHARED_API void set_NumberFormat (const NumberFormatInfoPtr &value)
 
virtual ASPOSECPP_SHARED_API DateTimeFormatInfoPtr get_DateTimeFormat () const
 
virtual ASPOSECPP_SHARED_API void set_DateTimeFormat (const DateTimeFormatInfoPtr &value)
 
ASPOSECPP_SHARED_API void ClearCachedData ()
 Refreshes cached culture information. More...
 
ASPOSECPP_SHARED_API CultureInfoPtr GetConsoleFallbackUICulture () const
 
ASPOSECPP_SHARED_API bool operator== (const CultureInfo &other) const
 
ASPOSECPP_SHARED_API bool Equals (SharedPtr< Object > obj) override
 
ASPOSECPP_SHARED_API String ToString () ASPOSE_CONST override
 
ASPOSECPP_SHARED_API int GetHashCode () const override
 Returns object hash code. More...
 
ASPOSECPP_SHARED_API SharedPtr< ObjectClone () override
 
ASPOSECPP_SHARED_API SharedPtr< ObjectGetFormat (const TypeInfo &format_type) override
 
bool IsInherited () const
 Gets is-inherited flag. FOR INTERNAL USE. More...
 
CultureInfooperator= (const CultureInfo &)=delete
 
- Public Member Functions inherited from System::Object
ASPOSECPP_SHARED_API Object ()
 Creates object. Initializes all internal data structures. More...
 
virtual ASPOSECPP_SHARED_API ~Object ()
 Destroys object. Frees all internal data structures. More...
 
ASPOSECPP_SHARED_API Object (Object const &x)
 Copy constructor. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
Objectoperator= (Object const &x)
 Assignment operator. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
ObjectSharedRefAdded ()
 Increments shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int SharedRefRemovedSafe ()
 Decrements and returns shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int RemovedSharedRefs (int count)
 Decreases shared reference count by specified value. More...
 
Detail::SmartPtrCounter * WeakRefAdded ()
 Increments weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
void WeakRefRemoved ()
 Decrements weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
Detail::SmartPtrCounter * GetCounter ()
 Gets reference counter data structure associated with the object. More...
 
int SharedCount () const
 Gets current value of shared refernce counter. More...
 
ASPOSECPP_SHARED_API void Lock ()
 Implements C# lock() statement locking. Call directly or use LockContext sentry object. More...
 
ASPOSECPP_SHARED_API void Unlock ()
 Implements C# lock() statement unlocking. Call directly or use LockContext sentry object. More...
 
virtual ASPOSECPP_SHARED_API bool Equals (ptr obj)
 Compares objects using C# Object.Equals semantics. More...
 
virtual ASPOSECPP_SHARED_API ptr MemberwiseClone () const
 Analog of C# Object.MemberwiseClone() method. Enables cloning custom types. More...
 
virtual ASPOSECPP_SHARED_API const TypeInfoGetType () const
 Gets actual type of object. Analog of C# System.Object.GetType() call. More...
 
virtual ASPOSECPP_SHARED_API bool Is (const TypeInfo &targetType) const
 Check if object represents an instance of type described by targetType. Analog of C# 'is' operator. More...
 
virtual ASPOSECPP_SHARED_API void SetTemplateWeakPtr (unsigned int argument)
 Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode. More...
 
template<>
bool Equals (float const &objA, float const &objB)
 
template<>
bool Equals (double const &objA, double const &objB)
 
template<>
bool ReferenceEquals (String const &str, std::nullptr_t)
 
template<>
bool ReferenceEquals (String const &str1, String const &str2)
 

Static Public Member Functions

static ASPOSECPP_SHARED_API const CultureInfoPtrget_InvariantCulture ()
 
static ASPOSECPP_SHARED_API CultureInfoPtr get_DefaultThreadCurrentCulture ()
 
static ASPOSECPP_SHARED_API void set_DefaultThreadCurrentCulture (const CultureInfoPtr &value)
 
static ASPOSECPP_SHARED_API const CultureInfoPtrget_InstalledUICulture ()
 
static ASPOSECPP_SHARED_API const CultureInfoPtrget_CurrentUICulture ()
 
static ASPOSECPP_SHARED_API void set_CurrentUICulture (const CultureInfoPtr &value)
 
static ASPOSECPP_SHARED_API const CultureInfoPtrget_CurrentCulture ()
 
static ASPOSECPP_SHARED_API void set_CurrentCulture (const CultureInfoPtr &value)
 
static ASPOSECPP_SHARED_API CultureInfoPtr get_DefaultThreadCurrentUICulture ()
 
static ASPOSECPP_SHARED_API void set_DefaultThreadCurrentUICulture (const CultureInfoPtr &value)
 
static ASPOSECPP_SHARED_API CultureInfoPtr CreateSpecificCulture (const String &name)
 
static ASPOSECPP_SHARED_API CultureInfoPtr GetCultureInfo (const String &name)
 
static ASPOSECPP_SHARED_API CultureInfoPtr GetCultureInfo (const String &name, const String &text_and_compare_culture_name)
 
static ASPOSECPP_SHARED_API CultureInfoPtr GetCultureInfo (int32_t culture)
 
static ASPOSECPP_SHARED_API CultureInfoPtr GetCultureInfoByIetfLanguageTag (const String &name)
 
static ASPOSECPP_SHARED_API ArrayPtr< CultureInfoPtrGetCultures (CultureTypes types)
 
static ASPOSECPP_SHARED_API CultureInfoPtr ReadOnly (const CultureInfoPtr &culture_info)
 
- Static Public Member Functions inherited from System::Object
static bool ReferenceEquals (ptr const &objA, ptr const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, T const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, std::nullptr_t)
 Reference-compares value type object with nullptr. More...
 
template<typename T1 , typename T2 >
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares reference type objects in C# style. More...
 
template<typename T1 , typename T2 >
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares value type objects in C# style. More...
 
static const TypeInfoType ()
 Impleemnts C# typeof(System.Object) construct. More...
 

Additional Inherited Members

- Public Types inherited from System::Object
typedef SmartPtr< Objectptr
 Alias for smart pointer type. More...
 
typedef System::Details::SharedMembersType shared_members_type
 structure to keep list of shared pointers contained in object. More...
 

Detailed Description

Collection of culture-specific values and algorithms. Setter operations are only enabled on non-read-only objects. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument.

Constructor & Destructor Documentation

◆ CultureInfo() [1/5]

ASPOSECPP_SHARED_API System::Globalization::CultureInfo::CultureInfo ( int  culture)
explicit

Constructor.

Parameters
cultureCulture identifier.

◆ CultureInfo() [2/5]

ASPOSECPP_SHARED_API System::Globalization::CultureInfo::CultureInfo ( int  culture,
bool  use_user_override 
)

Constructor.

Parameters
cultureCulture identifier.
use_user_overrideIf true, use user-defined values instead of systems; PARAMETER IGNORED.

◆ CultureInfo() [3/5]

ASPOSECPP_SHARED_API System::Globalization::CultureInfo::CultureInfo ( const String name)
explicit

Constructor.

Parameters
nameCulture name.

◆ CultureInfo() [4/5]

ASPOSECPP_SHARED_API System::Globalization::CultureInfo::CultureInfo ( const String name,
bool  use_user_override 
)

Constructor.

Parameters
nameCulture name.
use_user_overrideIf true, use user-defined values instead of systems; PARAMETER IGNORED.

◆ CultureInfo() [5/5]

ASPOSECPP_SHARED_API System::Globalization::CultureInfo::CultureInfo ( std::nullptr_t  )

Always throws ArgumentNullException.

Member Function Documentation

◆ ClearCachedData()

ASPOSECPP_SHARED_API void System::Globalization::CultureInfo::ClearCachedData ( )

Refreshes cached culture information.

◆ Clone()

ASPOSECPP_SHARED_API SharedPtr<Object> System::Globalization::CultureInfo::Clone ( )
overridevirtual

Clones culture info.

Returns
Newly created culture info object with same data as current one.

Implements System::ICloneable.

◆ CreateSpecificCulture()

static ASPOSECPP_SHARED_API CultureInfoPtr System::Globalization::CultureInfo::CreateSpecificCulture ( const String name)
static

Creates culture by name.

Parameters
namePredefined culture name or existing culture object's name.
Returns
Culture object.

◆ Equals()

ASPOSECPP_SHARED_API bool System::Globalization::CultureInfo::Equals ( SharedPtr< Object obj)
override

Compares objects.

Parameters
objObject to compare to.
Returns
True if obj is CultureInfo and has same parameters as this object, false otherwise.

◆ get_Calendar()

virtual ASPOSECPP_SHARED_API CalendarPtr System::Globalization::CultureInfo::get_Calendar ( ) const
virtual

Gets calendar used by the culture.

Returns
Calendar object.

◆ get_CompareInfo()

virtual ASPOSECPP_SHARED_API CompareInfoPtr System::Globalization::CultureInfo::get_CompareInfo ( ) const
virtual

Gets string comparer that adheres to culture rules.

Returns
String comparer object.

◆ get_CultureTypes()

ASPOSECPP_SHARED_API CultureTypes System::Globalization::CultureInfo::get_CultureTypes ( ) const

Gets bitwise joint of culture types that describe the current culture.

Returns
Culture types bitwise joint.

◆ get_CurrentCulture()

static ASPOSECPP_SHARED_API const CultureInfoPtr& System::Globalization::CultureInfo::get_CurrentCulture ( )
static

Gets culture set for current thread.

Returns
Culture object.

◆ get_CurrentUICulture()

static ASPOSECPP_SHARED_API const CultureInfoPtr& System::Globalization::CultureInfo::get_CurrentUICulture ( )
static

Gets current thread's UI culture.

Returns
Culture object.

◆ get_DateTimeFormat()

virtual ASPOSECPP_SHARED_API DateTimeFormatInfoPtr System::Globalization::CultureInfo::get_DateTimeFormat ( ) const
virtual

Gets date format information.

Returns
Date format info structure associated with culture.

◆ get_DefaultThreadCurrentCulture()

static ASPOSECPP_SHARED_API CultureInfoPtr System::Globalization::CultureInfo::get_DefaultThreadCurrentCulture ( )
static

Gets default culture in the current application domain.

Returns
Culture object.

◆ get_DefaultThreadCurrentUICulture()

static ASPOSECPP_SHARED_API CultureInfoPtr System::Globalization::CultureInfo::get_DefaultThreadCurrentUICulture ( )
static

Gets default UI culture in the current application domain.

Returns
Culture object.

◆ get_DisplayName()

virtual ASPOSECPP_SHARED_API String System::Globalization::CultureInfo::get_DisplayName ( ) const
virtual

Gets culture display name.

Returns
Culture display name.

◆ get_EnglishName()

virtual ASPOSECPP_SHARED_API String System::Globalization::CultureInfo::get_EnglishName ( ) const
virtual

Gets culture English name.

Returns
Culture English name.

◆ get_IetfLanguageTag()

ASPOSECPP_SHARED_API String System::Globalization::CultureInfo::get_IetfLanguageTag ( ) const

Gets the RFC 4646 name for a language.

Returns
Language tag.

◆ get_InstalledUICulture()

static ASPOSECPP_SHARED_API const CultureInfoPtr& System::Globalization::CultureInfo::get_InstalledUICulture ( )
static

Gets culture installed with the operating system.

Returns
Culture object.

◆ get_InvariantCulture()

static ASPOSECPP_SHARED_API const CultureInfoPtr& System::Globalization::CultureInfo::get_InvariantCulture ( )
static

Gets invariant culture.

Returns
Culture object.

◆ get_IsNeutralCulture()

virtual ASPOSECPP_SHARED_API bool System::Globalization::CultureInfo::get_IsNeutralCulture ( ) const
virtual

Checks whether the culture is neutral.

Returns
False if culture is associated with language but not with country or region, false otherwise.

◆ get_IsReadOnly()

ASPOSECPP_SHARED_API bool System::Globalization::CultureInfo::get_IsReadOnly ( ) const

Checks if culture object is read-only.

Returns
True if culture is read-only, false otherwise.

◆ get_KeyboardLayoutId()

virtual ASPOSECPP_SHARED_API int System::Globalization::CultureInfo::get_KeyboardLayoutId ( ) const
virtual

Gets active input locale identifier.

Returns
Input locale identifier.

◆ get_LCID()

virtual ASPOSECPP_SHARED_API int System::Globalization::CultureInfo::get_LCID ( ) const
virtual

Gets culture identifier.

Returns
Culture identifier.

◆ get_Name()

virtual ASPOSECPP_SHARED_API String System::Globalization::CultureInfo::get_Name ( ) const
virtual

Gets culture name.

Returns
Culture name.

◆ get_NativeName()

virtual ASPOSECPP_SHARED_API String System::Globalization::CultureInfo::get_NativeName ( ) const
virtual

Gets culture native name.

Returns
Culture native name.

◆ get_NumberFormat()

virtual ASPOSECPP_SHARED_API NumberFormatInfoPtr System::Globalization::CultureInfo::get_NumberFormat ( ) const
virtual

Gets number format information.

Returns
Number format info structure associated with culture.

◆ get_OptionalCalendars()

virtual ASPOSECPP_SHARED_API ArrayPtr<CalendarPtr> System::Globalization::CultureInfo::get_OptionalCalendars ( ) const
virtual

List of calendars that can be used with the culture.

Returns
Calendar array.

◆ get_Parent()

virtual ASPOSECPP_SHARED_API CultureInfoPtr System::Globalization::CultureInfo::get_Parent ( ) const
virtual

Gets parent culture.

Returns
Parent culture object.

◆ get_TextInfo()

virtual ASPOSECPP_SHARED_API TextInfoPtr System::Globalization::CultureInfo::get_TextInfo ( ) const
virtual

Gets text parameters used by the culture.

Returns
Text information object.

◆ get_ThreeLetterISOLanguageName()

virtual ASPOSECPP_SHARED_API String System::Globalization::CultureInfo::get_ThreeLetterISOLanguageName ( ) const
virtual

Gets three-letter ISO 639-2 language code.

Returns
Three-letter code.

◆ get_ThreeLetterWindowsLanguageName()

virtual ASPOSECPP_SHARED_API String System::Globalization::CultureInfo::get_ThreeLetterWindowsLanguageName ( ) const
virtual

Gets three-letter code for language as defined in Windows API.

Returns
Three-letter code.

◆ get_TwoLetterISOLanguageName()

virtual ASPOSECPP_SHARED_API String System::Globalization::CultureInfo::get_TwoLetterISOLanguageName ( ) const
virtual

Gets two letters ISO language name associated with culture.

Returns
Two-letter ISO language name.

◆ get_UseUserOverride()

ASPOSECPP_SHARED_API bool System::Globalization::CultureInfo::get_UseUserOverride ( ) const

Gets a flag indicating whether the CultureInfo uses user-selected culture settings.

Returns
True if CultureInfo uses user-selected culture settings, false otherwise

◆ GetConsoleFallbackUICulture()

ASPOSECPP_SHARED_API CultureInfoPtr System::Globalization::CultureInfo::GetConsoleFallbackUICulture ( ) const

Gets alternate culture suitable for console applications.

Returns
Culture object.

◆ GetCultureInfo() [1/3]

static ASPOSECPP_SHARED_API CultureInfoPtr System::Globalization::CultureInfo::GetCultureInfo ( const String name)
static

Gets culture by its name. Same as CreateSpecificCulture.

Parameters
namePredefined culture name or existing culture object's name.
Returns
Newly created culture object.

◆ GetCultureInfo() [2/3]

static ASPOSECPP_SHARED_API CultureInfoPtr System::Globalization::CultureInfo::GetCultureInfo ( const String name,
const String text_and_compare_culture_name 
)
static

Gets culture by its name.

Parameters
nameCulture name.
text_and_compare_culture_nameCulture name used for TextInfo and CompareInfo objects.
Returns
Culture object.

◆ GetCultureInfo() [3/3]

static ASPOSECPP_SHARED_API CultureInfoPtr System::Globalization::CultureInfo::GetCultureInfo ( int32_t  culture)
static

Gets culture by id.

Parameters
cultureCulture identifier.
Returns
Newly created culture object.

◆ GetCultureInfoByIetfLanguageTag()

static ASPOSECPP_SHARED_API CultureInfoPtr System::Globalization::CultureInfo::GetCultureInfoByIetfLanguageTag ( const String name)
static

Deprecated. Gets a read-only CultureInfo object by the specified RFC 4646 language tag.

Parameters
nameName of a language.
Returns
A read-only CultureInfo object.

◆ GetCultures()

static ASPOSECPP_SHARED_API ArrayPtr<CultureInfoPtr> System::Globalization::CultureInfo::GetCultures ( CultureTypes  types)
static

Gets cultures that fall into specified types.

Parameters
typesLimits what cultures are fetched.
Returns
Array of cultures selected.

◆ GetFormat()

ASPOSECPP_SHARED_API SharedPtr<Object> System::Globalization::CultureInfo::GetFormat ( const TypeInfo format_type)
overridevirtual

Gets format object for specific type.

Parameters
format_typeFormat object type.
Returns
Format info object or null if not found.

Implements System::IFormatProvider.

◆ GetHashCode()

ASPOSECPP_SHARED_API int System::Globalization::CultureInfo::GetHashCode ( ) const
overridevirtual

Returns object hash code.

Reimplemented from System::Object.

◆ IsInherited()

bool System::Globalization::CultureInfo::IsInherited ( ) const

Gets is-inherited flag. FOR INTERNAL USE.

◆ operator=()

CultureInfo& System::Globalization::CultureInfo::operator= ( const CultureInfo )
delete

◆ operator==()

ASPOSECPP_SHARED_API bool System::Globalization::CultureInfo::operator== ( const CultureInfo other) const

Compares culture parameters.

Parameters
otherCulture to compare to.
Returns
True if culture parameters match, false otherwise.

◆ ReadOnly()

static ASPOSECPP_SHARED_API CultureInfoPtr System::Globalization::CultureInfo::ReadOnly ( const CultureInfoPtr culture_info)
static

Gets a read only version of culture.

Parameters
culture_infoCulture to wrap as read-only.
Returns
If culture_info is read-only, returns same object, otherwise creates a read-only copy.

◆ set_CurrentCulture()

static ASPOSECPP_SHARED_API void System::Globalization::CultureInfo::set_CurrentCulture ( const CultureInfoPtr value)
static

Sets culture for current thread.

Parameters
valueCulture to set.

◆ set_CurrentUICulture()

static ASPOSECPP_SHARED_API void System::Globalization::CultureInfo::set_CurrentUICulture ( const CultureInfoPtr value)
static

Sets current thread's UI culture.

Parameters
valueCulture object.

◆ set_DateTimeFormat()

virtual ASPOSECPP_SHARED_API void System::Globalization::CultureInfo::set_DateTimeFormat ( const DateTimeFormatInfoPtr value)
virtual

Sets date format information.

Parameters
valueDate time format information.
Exceptions
InvalidOperationExceptionIf culture is read-only.

◆ set_DefaultThreadCurrentCulture()

static ASPOSECPP_SHARED_API void System::Globalization::CultureInfo::set_DefaultThreadCurrentCulture ( const CultureInfoPtr value)
static

Sets default culture in the current application domain.

Parameters
valueCulture object.

◆ set_DefaultThreadCurrentUICulture()

static ASPOSECPP_SHARED_API void System::Globalization::CultureInfo::set_DefaultThreadCurrentUICulture ( const CultureInfoPtr value)
static

Sets default UI culture in the current application domain.

Parameters
valueCulture to set.

◆ set_NumberFormat()

virtual ASPOSECPP_SHARED_API void System::Globalization::CultureInfo::set_NumberFormat ( const NumberFormatInfoPtr value)
virtual

Gets number format information.

Parameters
valueNumber format information.
Exceptions
InvalidOperationExceptionIf culture is read-only.

◆ ToString()

ASPOSECPP_SHARED_API String System::Globalization::CultureInfo::ToString ( )
overridevirtual

Converts culture to string.

Returns
The name of the CultureInfo, eg. "de-DE_phoneb", "en-US", or "fj-FJ".

Reimplemented from System::Object.