System::Globalization::CultureInfo Class Reference

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

Public Member Functions

 CultureInfo (int culture)
 RTTI information. More...
 
 CultureInfo (const String &name)
 
 CultureInfo (const String &name, bool useUserOverride)
 
bool operator== (const CultureInfo &other) const
 
bool Equals (ptr obj) override
 
CultureInfoPtr Clone ()
 
String ToString () ASPOSE_CONST override
 
virtual bool get_IsReadOnly () const
 
virtual SharedPtr< NumberFormatInfoget_NumberFormat () const
 
virtual SharedPtr< DateTimeFormatInfoget_DateTimeFormat () const
 
void set_DateTimeFormat (SharedPtr< DateTimeFormatInfo > format)
 
virtual int get_LCID () const
 
virtual const Stringget_Name () const
 
virtual const Stringget_EnglishName () const
 
virtual const Stringget_NativeName () const
 
virtual SharedPtr< CultureInfoget_Parent () const
 
virtual SharedPtr< Calendarget_Calendar () const
 
virtual SharedPtr< TextInfoget_TextInfo () const
 
virtual SharedPtr< CompareInfoget_CompareInfo () const
 
virtual bool get_IsNeutralCulture () const
 
virtual String get_TwoLetterISOLanguageName () const
 
CultureTypes get_CultureTypes () const
 
virtual ArrayPtr< SharedPtr< Calendar > > get_OptionalCalendars () const
 
SharedPtr< ObjectGetFormat (const TypeInfo &formatType) override
 
Details::CultureDataPtr GetCultureData ()
 
- Public Member Functions inherited from System::Object
 Object ()
 Creates object. Initializes all internal data structures. More...
 
virtual ~Object ()
 Destroys object. Frees all internal data structures. More...
 
 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...
 
void Lock ()
 Implements C# lock() statement locking. Call directly or use LockContext sentry object. More...
 
void Unlock ()
 Implements C# lock() statement unlocking. Call directly or use LockContext sentry object. More...
 
virtual int GetHashCode () const
 Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More...
 
virtual ptr MemberwiseClone () const
 Analog of C# Object.MemberwiseClone() method. Enables cloning custom types. More...
 
virtual const TypeInfoGetType () const
 Gets actual type of object. Analog of C# System.Object.GetType() call. More...
 
virtual bool Is (const TypeInfo &targetType) const
 Check if object represents an instance of type described by targetType. Analog of C# 'is' operator. More...
 
virtual 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 SharedPtr< CultureInfoget_InvariantCulture ()
 
static SharedPtr< CultureInfoget_CurrentCulture ()
 
static void set_CurrentCulture (SharedPtr< CultureInfo > culture)
 
static SharedPtr< CultureInfoget_CurrentUICulture ()
 
static SharedPtr< CultureInfoCreateSpecificCulture (const String &name)
 
static ArrayPtr< SharedPtr< CultureInfo > > GetCultures (CultureTypes types)
 
static SharedPtr< CultureInfoGetCultureByName (const String &name)
 
static SharedPtr< CultureInfoGetCultureInfo (const String &name)
 
static SharedPtr< CultureInfoGetCultureInfo (int32_t culture)
 
static CalendarPtr GetCalendarInstance (Details::CalendarId calType)
 
static CultureInfoPtr ReadOnly (CultureInfoPtr cultureInfo)
 
- 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/3]

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

RTTI information.

Constructor.

Parameters
cultureCulture identifier.

◆ CultureInfo() [2/3]

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

Constructor.

Parameters
nameCulture name.

◆ CultureInfo() [3/3]

System::Globalization::CultureInfo::CultureInfo ( const String name,
bool  useUserOverride 
)

Constructor.

Parameters
nameCulture name.
useUserOverrideIf true, use user-defined values instead of systems; not supported.

Member Function Documentation

◆ Clone()

CultureInfoPtr System::Globalization::CultureInfo::Clone ( )

Clones culture info.

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

◆ CreateSpecificCulture()

static SharedPtr<CultureInfo> 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()

bool System::Globalization::CultureInfo::Equals ( ptr  obj)
overridevirtual

Compares objects.

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

Reimplemented from System::Object.

◆ get_Calendar()

virtual SharedPtr<Calendar> System::Globalization::CultureInfo::get_Calendar ( ) const
virtual

Gets calendar used by the culture.

Returns
Calendar object.

◆ get_CompareInfo()

virtual SharedPtr<CompareInfo> System::Globalization::CultureInfo::get_CompareInfo ( ) const
virtual

Gets string comparer that adheres to culture rules.

Returns
String comparer object.

◆ get_CultureTypes()

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 SharedPtr<CultureInfo> System::Globalization::CultureInfo::get_CurrentCulture ( )
static

Gets culture set for current thread.

Returns
Culture object.

◆ get_CurrentUICulture()

static SharedPtr<CultureInfo> System::Globalization::CultureInfo::get_CurrentUICulture ( )
static

Gets current thread's UI culture.

Returns
Culture object.

◆ get_DateTimeFormat()

virtual SharedPtr<DateTimeFormatInfo> System::Globalization::CultureInfo::get_DateTimeFormat ( ) const
virtual

Gets date format information.

Returns
Date format info structure associated with culture.

◆ get_EnglishName()

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

Gets culture English name.

Returns
Culture English name.

◆ get_InvariantCulture()

static SharedPtr<CultureInfo> System::Globalization::CultureInfo::get_InvariantCulture ( )
static

Gets invariant culture.

Returns
Culture object.

◆ get_IsNeutralCulture()

virtual 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 contry or region, false otherwise.

◆ get_IsReadOnly()

virtual bool System::Globalization::CultureInfo::get_IsReadOnly ( ) const
inlinevirtual

Checks if culture object is read-only.

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

◆ get_LCID()

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

Gets culture identifier.

Returns
Culture identifier.

◆ get_Name()

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

Gets culture name.

Returns
Culture name.

◆ get_NativeName()

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

Gets culture native name.

Returns
Culture native name.

◆ get_NumberFormat()

virtual SharedPtr<NumberFormatInfo> System::Globalization::CultureInfo::get_NumberFormat ( ) const
virtual

Gets number format information.

Returns
Number format info structure associated with culture.

◆ get_OptionalCalendars()

virtual ArrayPtr<SharedPtr<Calendar> > System::Globalization::CultureInfo::get_OptionalCalendars ( ) const
virtual

List of calendars that can be used with the culture.

Returns
Calendar array.

◆ get_Parent()

virtual SharedPtr<CultureInfo> System::Globalization::CultureInfo::get_Parent ( ) const
virtual

Gets parent culture.

Returns
Parent culture object.

◆ get_TextInfo()

virtual SharedPtr<TextInfo> System::Globalization::CultureInfo::get_TextInfo ( ) const
virtual

Gets text parameters used by the culture.

Returns
Text information object.

◆ get_TwoLetterISOLanguageName()

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

Gets two letters ISO language name associated with culture.

Returns
Two-letter ISO language name.

◆ GetCalendarInstance()

static CalendarPtr System::Globalization::CultureInfo::GetCalendarInstance ( Details::CalendarId  calType)
static

Creates calendar. Only Gregorian types are supported.

Parameters
calTypeCalendar type, must be gregorian.
Returns
Newly created calendar object.

◆ GetCultureByName()

static SharedPtr<CultureInfo> System::Globalization::CultureInfo::GetCultureByName ( 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.

◆ GetCultureData()

Details::CultureDataPtr System::Globalization::CultureInfo::GetCultureData ( )

Gets culture data associated with culture.

Returns
Implementation object.

◆ GetCultureInfo() [1/2]

static SharedPtr<CultureInfo> 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/2]

static SharedPtr<CultureInfo> System::Globalization::CultureInfo::GetCultureInfo ( int32_t  culture)
static

Gets culture by id.

Parameters
cultureCulture identifier.
Returns
Newly created culture object.

◆ GetCultures()

static ArrayPtr<SharedPtr<CultureInfo> > 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()

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

Gets format object for specific type.

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

Implements System::IFormatProvider.

◆ operator==()

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 CultureInfoPtr System::Globalization::CultureInfo::ReadOnly ( CultureInfoPtr  cultureInfo)
static

Gets a read only version of culture.

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

◆ set_CurrentCulture()

static void System::Globalization::CultureInfo::set_CurrentCulture ( SharedPtr< CultureInfo culture)
static

Sets culture for current thread.

Parameters
cultureCulture to set.

◆ set_DateTimeFormat()

void System::Globalization::CultureInfo::set_DateTimeFormat ( SharedPtr< DateTimeFormatInfo format)

Sets date format information.

Returns
Date format info structure associated with culture.
Exceptions
InvalidOperationExceptionIf culture is read-only.

◆ ToString()

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

Converts culture to string.

Returns
Culture name.

Reimplemented from System::Object.