CultureInfo

CultureInfo class

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.

class CultureInfo : public virtual System::Object,
                    public System::IFormatProvider,
                    public System::ICloneable

Methods

MethodDescription
void ClearCachedData()Refreshes cached culture information.
SharedPtr<Object> Clone() overrideClones culture info.
static CultureInfoPtr CreateSpecificCulture(const String&)Creates culture by name.
explicit CultureInfo(int)RTTI information.
CultureInfo(int, bool)Constructor.
explicit CultureInfo(const String&)Constructor.
CultureInfo(const String&, bool)Constructor.
CultureInfo(std::nullptr_t)Always throws ArgumentNullException.
bool Equals(SharedPtr<Object>) overrideCompares objects.
virtual bool Equals(ptr)Compares objects using C# Object.Equals semantics.
static std::enable_if<IsSmartPtr<T1>::value&&IsSmartPtr<T2>::value, bool>::type Equals(T1 const&, T2 const&)Compares reference type objects in C# style.
static bool Equals(float const&, float const&)Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN.
static bool Equals(double const&, double const&)Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN.
virtual bool FastCast(const Details::FastRttiBase&, void **) constFor internal purposes only.
virtual CalendarPtr get_Calendar() constGets calendar used by the culture.
virtual CompareInfoPtr get_CompareInfo() constGets string comparer that adheres to culture rules.
CultureTypes get_CultureTypes() constGets bitwise joint of culture types that describe the current culture.
static const CultureInfoPtr& get_CurrentCulture()Gets culture set for current thread.
static const CultureInfoPtr& get_CurrentUICulture()Gets current thread’s UI culture.
virtual DateTimeFormatInfoPtr get_DateTimeFormat() constGets date format information.
static CultureInfoPtr get_DefaultThreadCurrentCulture()Gets default culture in the current application domain.
static CultureInfoPtr get_DefaultThreadCurrentUICulture()Gets default UI culture in the current application domain.
virtual String get_DisplayName() constGets culture display name.
virtual String get_EnglishName() constGets culture English name.
String get_IetfLanguageTag() constGets the RFC 4646 name for a language.
static const CultureInfoPtr& get_InstalledUICulture()Gets culture installed with the operating system.
static const CultureInfoPtr& get_InvariantCulture()Gets invariant culture.
virtual bool get_IsNeutralCulture() constChecks whether the culture is neutral.
bool get_IsReadOnly() constChecks if culture object is read-only.
virtual int get_KeyboardLayoutId() constGets active input locale identifier.
virtual int get_LCID() constGets culture identifier.
virtual String get_Name() constGets culture name.
virtual String get_NativeName() constGets culture native name.
virtual NumberFormatInfoPtr get_NumberFormat() constGets number format information.
virtual ArrayPtr<CalendarPtr> get_OptionalCalendars() constList of calendars that can be used with the culture.
virtual CultureInfoPtr get_Parent() constGets parent culture.
virtual TextInfoPtr get_TextInfo() constGets text parameters used by the culture.
virtual String get_ThreeLetterISOLanguageName() constGets three-letter ISO 639-2 language code.
virtual String get_ThreeLetterWindowsLanguageName() constGets three-letter code for language as defined in Windows API.
virtual String get_TwoLetterISOLanguageName() constGets two letters ISO language name associated with culture.
bool get_UseUserOverride() constGets a flag indicating whether the CultureInfo uses user-selected culture settings.
CultureInfoPtr GetConsoleFallbackUICulture() constGets alternate culture suitable for console applications.
Detail::SmartPtrCounter * GetCounter()Gets reference counter data structure associated with the object.
static CultureInfoPtr GetCultureInfo(const String&)Gets culture by its name. Same as CreateSpecificCulture.
static CultureInfoPtr GetCultureInfo(const String&, const String&)Gets culture by its name.
static CultureInfoPtr GetCultureInfo(int32_t)Gets culture by id.
static CultureInfoPtr GetCultureInfoByIetfLanguageTag(const String&)Deprecated. Gets a read-only CultureInfo object by the specified RFC 4646 language tag.
static ArrayPtr<CultureInfoPtr> GetCultures(CultureTypes)Gets cultures that fall into specified types.
SharedPtr<Object> GetFormat(const TypeInfo&) overrideGets format object for specific type.
int GetHashCode() const overrideReturns object hash code.
virtual const TypeInfo& GetType() constGets actual type of object. Analog of C# System.Object.GetType() call.
virtual bool Is(const TypeInfo&) constCheck if object represents an instance of type described by targetType. Analog of C# ‘is’ operator.
bool IsInherited() constGets is-inherited flag. FOR INTERNAL USE.
virtual ptr MemberwiseClone() constAnalog of C# Object.MemberwiseClone() method. Enables cloning custom types.
Object()Creates object. Initializes all internal data structures.
Object(Object const&)Copy constructor. Doesn’t copy anything, really, just initializes new object and enables copy constructing subclasses.
CultureInfo& operator=(const CultureInfo&)
Object& operator=(Object const&)Assignment operator. Doesn’t copy anything, really, just initializes new object and enables copy constructing subclasses.
bool operator==(const CultureInfo&) constCompares culture parameters.
static CultureInfoPtr ReadOnly(const CultureInfoPtr&)Gets a read only version of culture.
static bool ReferenceEquals(ptr const&, ptr const&)Compares objects by reference.
static std::enable_if<!IsSmartPtr<T>::value, bool>::type ReferenceEquals(T const&, T const&)Compares objects by reference.
static std::enable_if<!IsSmartPtr<T>::value, bool>::type ReferenceEquals(T const&, std::nullptr_t)Reference-compares value type object with nullptr.
bool ReferenceEquals(String const&, std::nullptr_t)Specialization of Object::ReferenceEquals for case of string and nullptr.
bool ReferenceEquals(String const&, String const&)Specialization of Object::ReferenceEquals for case of strings.
int RemovedSharedRefs(int)Decreases shared reference count by specified value.
static void set_CurrentCulture(const CultureInfoPtr&)Sets culture for current thread.
static void set_CurrentUICulture(const CultureInfoPtr&)Sets current thread’s UI culture.
virtual void set_DateTimeFormat(DateTimeFormatInfoPtr)Sets date format information.
static void set_DefaultThreadCurrentCulture(const CultureInfoPtr&)Sets default culture in the current application domain.
static void set_DefaultThreadCurrentUICulture(const CultureInfoPtr&)Sets default UI culture in the current application domain.
virtual void set_NumberFormat(NumberFormatInfoPtr)Gets number format information.
virtual void SetTemplateWeakPtr(uint32_t)Set n’th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode.
int SharedCount() constGets current value of shared reference counter.
Object * SharedRefAdded()Increments shared reference count. Shouldn’t be called directly; instead, use smart pointers or ThisProtector.
int SharedRefRemovedSafe()Decrements and returns shared reference count. Shouldn’t be called directly; instead, use smart pointers or ThisProtector.
String ToString() const overrideConverts culture to string.
static const TypeInfo& Type()Implements C# typeof(System.Object) construct.
void Unlock()Implements C# lock() statement unlocking. Call directly or use LockContext sentry object.
Detail::SmartPtrCounter * WeakRefAdded()Increments weak reference count. Shouldn’t be called directly; instead, use smart pointers or ThisProtector.
void WeakRefRemoved()Decrements weak reference count. Shouldn’t be called directly; instead, use smart pointers or ThisProtector.
virtual ~Object()Destroys object. Frees all internal data structures.

See Also