CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
|
Represents an information destribing a particular time zone. 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. More...
#include <timezone_info.h>
Inherits System::IEquatable< TimeZoneInfoPtr >.
Classes | |
class | AdjustmentRule |
Provides information about a time zone adjustment. 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. More... | |
class | TransitionTime |
RTTI information. More... | |
Public Types | |
typedef SharedPtr< AdjustmentRule > | AdjustmentRulePtr |
An alias for a shared pointer to an instance of AdjustmentRule class. More... | |
![]() | |
typedef SmartPtr< Object > | ptr |
Alias for smart pointer type. More... | |
Public Member Functions | |
bool | get_SupportsDaylightSavingTime () const |
Gets flag indicating if time zone has daylight saving time rules. More... | |
TimeSpan | get_BaseUtcOffset () const |
Returns an instance of TimeSpan that represents a time interval between the current time zone's standard time and UTC time. More... | |
String | get_DaylightName () const |
Gets name for the current time zone's daylight saving time. More... | |
String | get_StandardName () const |
Gets name for the current time zone's standart time. More... | |
String | get_DisplayName () const |
Gets name for the current time zone. More... | |
String | get_Id () const |
Returns the identifier of the time zone represented by the current object. More... | |
ArrayPtr< AdjustmentRulePtr > | GetAdjustmentRules () const |
Returns an array consisting of AdjustmentRule objects that represent adjustment rules that apply to the current TimeZoneInfo object. More... | |
ArrayPtr< TimeSpan > | GetAmbiguousTimeOffsets (DateTime date_time) const |
Gets UTC dates and times that a specified date and time can be mapped to. More... | |
ArrayPtr< TimeSpan > | GetAmbiguousTimeOffsets (const DateTimeOffset &date_time_offset) const |
Gets UTC dates and times that a specified date and time can be mapped to. More... | |
TimeSpan | GetUtcOffset (DateTime date_time) const |
Calculates difference between time in this time zone and UTC time zone for a specified date and time. More... | |
TimeSpan | GetUtcOffsetNoThrow (DateTime date_time) const |
Calculates difference between time in this time zone and UTC time zone for a specified date and time. FOR INTERNAL USE. More... | |
TimeSpan | GetUtcOffset (const DateTimeOffset &date_time_offset) const |
Calculates difference between time in this time zone and UTC time zone for a specified date and time. More... | |
bool | HasSameRules (const TimeZoneInfoPtr &other) const |
Checks if current and another time zones have the same adjustment rules. More... | |
bool | IsAmbiguousTime (DateTime date_time) const |
Checks if specified date and time is ambiguous and can be mapped to many UTC times. More... | |
bool | IsAmbiguousTime (const DateTimeOffset &date_time_offset) const |
Checks if specified date and time is ambiguous and can be mapped to many UTC times. More... | |
bool | IsDaylightSavingTime (DateTime date_time) const |
Checks if specified date and time falls in range of daylight saving time. More... | |
bool | IsDaylightSavingTimeNoThrow (DateTime date_time) const |
Checks if specified date and time falls in range of daylight saving time. More... | |
bool | IsDaylightSavingTime (const DateTimeOffset &date_time_offset) const |
Checks if specified date and time falls in range of daylight saving time. More... | |
bool | IsInvalidTime (DateTime date_time) const |
Checks if specified date and time is invalid. More... | |
bool | Equals (SharedPtr< Object > obj) override |
bool | Equals (TimeZoneInfoPtr other) override |
Determines if the the current and specified objects are equal. More... | |
int | GetHashCode () const override |
Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More... | |
String | ToString () const override |
Analog of C# Object.ToString() method. Enables converting custom objects to string. More... | |
virtual bool | Equals (TimeZoneInfoPtr other)=0 |
Determines if the the current and specified objects are equal. More... | |
![]() | |
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... | |
Object & | operator= (Object const &x) |
Assignment operator. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More... | |
Object * | SharedRefAdded () |
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 reference 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 bool | Equals (ptr obj) |
Compares objects using C# Object.Equals semantics. More... | |
virtual int32_t | GetHashCode () const |
Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More... | |
virtual String | ToString () const |
Analog of C# Object.ToString() method. Enables converting custom objects to string. More... | |
virtual ptr | MemberwiseClone () const |
Analog of C# Object.MemberwiseClone() method. Enables cloning custom types. More... | |
virtual const TypeInfo & | GetType () 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 (uint32_t argument) |
Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode. More... | |
virtual bool | FastCast (const Details::FastRttiBase &helper, void **out_ptr) const |
For internal purposes only. More... | |
template<> | |
bool | ReferenceEquals (String const &str, std::nullptr_t) |
Specialization of Object::ReferenceEquals for case of string and nullptr. More... | |
template<> | |
bool | ReferenceEquals (String const &str1, String const &str2) |
Specialization of Object::ReferenceEquals for case of strings. More... | |
Static Public Member Functions | |
static TimeZoneInfoPtr | get_Utc () |
Returns an instance of TimeZoneInfo that represents a UTC time zone. More... | |
static TimeZoneInfoPtr | get_Local () |
Returns an instance of TimeZoneInfo that represents a local time zone. More... | |
static void | ClearCachedData () |
Clear cached time zone data. More... | |
static DateTime | ConvertTime (DateTime date_time, const TimeZoneInfoPtr &source_time_zone, const TimeZoneInfoPtr &destination_time_zone) |
Convert time from one time zone to another. More... | |
static DateTimeOffset | ConvertTime (const DateTimeOffset &date_time_offset, const TimeZoneInfoPtr &destination_time_zone) |
Convert time to the time in a specified time zone. More... | |
static DateTime | ConvertTime (DateTime date_time, const TimeZoneInfoPtr &destination_time_zone) |
Convert time to the time in a specified time zone. More... | |
static DateTime | ConvertTimeBySystemTimeZoneId (DateTime date_time, const String &destination_time_zone_id) |
Convert time to the time in a specified time zone. More... | |
static DateTimeOffset | ConvertTimeBySystemTimeZoneId (const DateTimeOffset &date_time_offset, const String &destination_time_zone_id) |
Convert time to the time in a specified time zone. More... | |
static DateTime | ConvertTimeBySystemTimeZoneId (DateTime date_time, const String &source_time_zone_id, const String &destination_time_zone_id) |
Convert time to the time in a specified time zone. More... | |
static DateTime | ConvertTimeFromUtc (DateTime date_time, const TimeZoneInfoPtr &destination_time_zone) |
Converts UTC-time to the time in a specified time zone. More... | |
static DateTime | ConvertTimeToUtc (DateTime date_time, const TimeZoneInfoPtr &source_time_zone) |
Converts time to UTC-time. More... | |
static DateTime | ConvertTimeToUtc (DateTime date_time) |
Converts time to UTC-time. More... | |
static DateTime | ConvertTimeToUtcNoThrow (DateTime date_time) |
Converts time to UTC-time. FOR INTERNAL USE. More... | |
static TimeZoneInfoPtr | CreateCustomTimeZone (const String &id, TimeSpan base_utc_offset, const String &display_name, const String &standard_display_name, const String &daylight_display_name, const ArrayPtr< AdjustmentRulePtr > &adjustment_rules, bool disable_daylight_saving_time) |
Creates a custom time zone. More... | |
static TimeZoneInfoPtr | CreateCustomTimeZone (const String &id, TimeSpan base_utc_offset, const String &display_name, const String &standard_display_name, const String &daylight_display_name, const ArrayPtr< AdjustmentRulePtr > &adjustment_rules) |
Creates a custom time zone. More... | |
static TimeZoneInfoPtr | CreateCustomTimeZone (const String &id, TimeSpan base_utc_offset, const String &display_name, const String &standard_display_name) |
Creates a custom time zone. More... | |
static TimeZoneInfoPtr | FindSystemTimeZoneById (const String &id) |
Gets time zone with specified identifier. More... | |
static SharedPtr< System::Collections::ObjectModel::ReadOnlyCollection< TimeZoneInfoPtr > > | GetSystemTimeZones () |
Gets sorted collection of all time zones available on the local system. More... | |
static TimeSpan | GetUtcOffsetFromUtc (DateTime time, const TimeZoneInfoPtr &zone) |
Internal helper function that returns the UTC offset for a UTC-datetime in a specified time zone. FOR INTERNAL USE. More... | |
static TimeSpan | GetUtcOffsetFromUtc (DateTime time, const TimeZoneInfoPtr &zone, bool &is_daylight_savings, bool &is_ambiguous_local_dst) |
Internal helper function that returns the UTC offset for a UTC-datetime in a specified time zone. FOR INTERNAL USE. More... | |
static DateTime | TransitionTimeToDateTime (int32_t year, const TransitionTime &transitionTime) |
Helper function that converts a year and TransitionTime into a DateTime. More... | |
![]() | |
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 TypeInfo & | Type () |
Implements C# typeof(System.Object) construct. More... | |
template<> | |
bool | Equals (float const &objA, float const &objB) |
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. More... | |
template<> | |
bool | Equals (double const &objA, double const &objB) |
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. More... | |
Protected Member Functions | |
~TimeZoneInfo () override | |
Destructor. More... | |
TimeZoneInfo (const String &id, TimeSpan base_utc_offset, const String &display_name, const String &standard_display_name, const String &daylight_display_name, const ArrayPtr< AdjustmentRulePtr > &adjustment_rules, bool disable_daylight_saving_time, std::unique_ptr< const codeporting_icu::BasicTimeZone > &&icu_time_zone, DateTimeKind time_zone_kind=DateTimeKind::Unspecified) | |
Constructs an instance of TimeZoneInfo. More... | |
const ArrayPtr< AdjustmentRulePtr > & | AdjustmentRules () const |
Static Protected Member Functions | |
static DateTime | ConvertTime (DateTime date_time, const TimeZoneInfoPtr &source_time_zone, const TimeZoneInfoPtr &destination_time_zone, bool throw_on_invalid_time) |
Convert time from one time zone to another. More... | |
static void | VerifyTimeZoneInfo (const String &id, TimeSpan base_utc_offset, const ArrayPtr< AdjustmentRulePtr > &adjustment_rules) |
Verify time zone information. More... | |
static TimeZoneInfoPtr | CreateTimeZoneInfoFromIcuTimeZone (std::unique_ptr< const codeporting_icu::BasicTimeZone > &&time_zone, DateTimeKind time_zone_kind=DateTimeKind::Unspecified) |
Protected Attributes | |
const String | m_id |
The identifier of the time zone. More... | |
const String | m_display_name |
The display name for the time zone. More... | |
const String | m_standard_display_name |
The display name for the standard time of the time zone. More... | |
const String | m_daylight_display_name |
The dispaly name for the daylight saving time of the time zone. More... | |
const TimeSpan | m_base_utc_offset |
A time interval between the current time zone's standard time and UTC time. More... | |
const bool | m_supports_daylight_saving_time |
Indicates whether the time zone represented by the current object assumes transition to daylight saving time. More... | |
System::Details::Lazy< ArrayPtr< AdjustmentRulePtr > > | m_adjustment_rules |
Adjustment rules that apply to the current time zone. More... | |
const std::unique_ptr< const codeporting_icu::BasicTimeZone > | m_icu_time_zone |
ICU Time zone. More... | |
const DateTimeKind | m_time_zone_kind |
Time zone kind (UTC, Local or Unspecified). More... | |
Represents an information destribing a particular time zone. 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.
An alias for a shared pointer to an instance of AdjustmentRule class.
|
overrideprotected |
Destructor.
|
protected |
Constructs an instance of TimeZoneInfo.
id | The identifier of the time zone represented by the object being constructed. |
base_utc_offset | A time interval between the time zone's standard time and UTC time |
display_name | The display name for the time zone represented by the object being constructed. |
standard_display_name | The display name for the standard time of the time zone represented by the object being constructed. |
daylight_display_name | The dispaly name for the daylight saving time of the time zone reprsented by the object being constructed. |
adjustment_rules | The array containing the AdjustmentRule objects representing adjustment rules that apply to the time zone represented by the object being created. |
disable_daylight_saving_time | Specifies whether the time zone represented by the object being constructed assumes transition to daylight saving time. |
icu_time_zone | ICU Time zone. |
time_zone_kind | Time zone kind (UTC, Local or Unspecified). |
|
protected |
|
static |
Clear cached time zone data.
|
static |
Convert time to the time in a specified time zone.
date_time_offset | Date and time to convert. |
destination_time_zone | Destination time zone. |
|
static |
Convert time to the time in a specified time zone.
date_time | Date and time to convert. |
destination_time_zone | Destination time zone. |
|
static |
Convert time from one time zone to another.
date_time | Date and time to convert. |
source_time_zone | Source time zone. |
destination_time_zone | Destination time zone. |
|
staticprotected |
Convert time from one time zone to another.
date_time | Date and time to convert. |
source_time_zone | Source time zone. |
destination_time_zone | Destination time zone. |
throw_on_invalid_time | Throws exception in date_time is invalid. |
|
static |
Convert time to the time in a specified time zone.
date_time_offset | Date and time to convert. |
destination_time_zone_id | Identifier of the destination time zone. |
|
static |
Convert time to the time in a specified time zone.
date_time | Date and time to convert. |
destination_time_zone_id | Identifier of the destination time zone. |
|
static |
Convert time to the time in a specified time zone.
date_time | Date and time to convert. |
source_time_zone_id | Identifier of the source time zone. |
destination_time_zone_id | Identifier of the destination time zone. |
|
static |
Converts UTC-time to the time in a specified time zone.
date_time | Date and time to convert. |
destination_time_zone | Destination time zone. |
Converts time to UTC-time.
date_time | Date and time to convert. |
|
static |
Converts time to UTC-time.
date_time | Date and time to convert. |
source_time_zone | Source time zone. |
Converts time to UTC-time. FOR INTERNAL USE.
date_time | Date and time to convert. |
|
static |
Creates a custom time zone.
id | Time zone identifier. |
base_utc_offset | Time interval between the current time zone's standard time and UTC time. |
display_name | Display name. |
standard_display_name | Standard time name. |
|
static |
Creates a custom time zone.
id | Time zone identifier. |
base_utc_offset | Time interval between the current time zone's standard time and UTC time. |
display_name | Display name. |
standard_display_name | Standard time name. |
daylight_display_name | Daylight saving time name. |
adjustment_rules | Array of adjustment rules. |
|
static |
Creates a custom time zone.
id | Time zone identifier. |
base_utc_offset | Time interval between the current time zone's standard time and UTC time. |
display_name | Display name. |
standard_display_name | Standard time name. |
daylight_display_name | Daylight saving time name. |
adjustment_rules | Array of adjustment rules. |
disable_daylight_saving_time | True to discard any daylight saving time information present in adjustment_rules. |
|
staticprotected |
|
overridevirtual |
Determines if the the current and specified objects are equal.
other | The object to compare the current object with |
Implements System::IEquatable< TimeZoneInfoPtr >.
|
static |
Gets time zone with specified identifier.
id | Time zone identifier. |
TimeSpan System::TimeZoneInfo::get_BaseUtcOffset | ( | ) | const |
Returns an instance of TimeSpan that represents a time interval between the current time zone's standard time and UTC time.
String System::TimeZoneInfo::get_DaylightName | ( | ) | const |
Gets name for the current time zone's daylight saving time.
String System::TimeZoneInfo::get_DisplayName | ( | ) | const |
Gets name for the current time zone.
String System::TimeZoneInfo::get_Id | ( | ) | const |
Returns the identifier of the time zone represented by the current object.
|
static |
Returns an instance of TimeZoneInfo that represents a local time zone.
String System::TimeZoneInfo::get_StandardName | ( | ) | const |
Gets name for the current time zone's standart time.
bool System::TimeZoneInfo::get_SupportsDaylightSavingTime | ( | ) | const |
Gets flag indicating if time zone has daylight saving time rules.
|
static |
Returns an instance of TimeZoneInfo that represents a UTC time zone.
ArrayPtr< AdjustmentRulePtr > System::TimeZoneInfo::GetAdjustmentRules | ( | ) | const |
Returns an array consisting of AdjustmentRule objects that represent adjustment rules that apply to the current TimeZoneInfo object.
ArrayPtr< TimeSpan > System::TimeZoneInfo::GetAmbiguousTimeOffsets | ( | const DateTimeOffset & | date_time_offset | ) | const |
Gets UTC dates and times that a specified date and time can be mapped to.
date_time_offset | Date and time. |
Gets UTC dates and times that a specified date and time can be mapped to.
date_time | Date and time. |
|
overridevirtual |
Analog of C# Object.GetHashCode() method. Enables hashing of custom objects.
Reimplemented from System::Object.
|
static |
Gets sorted collection of all time zones available on the local system.
TimeSpan System::TimeZoneInfo::GetUtcOffset | ( | const DateTimeOffset & | date_time_offset | ) | const |
Calculates difference between time in this time zone and UTC time zone for a specified date and time.
date_time_offset | Date and time. |
Calculates difference between time in this time zone and UTC time zone for a specified date and time.
date_time | Date and time. |
|
static |
Internal helper function that returns the UTC offset for a UTC-datetime in a specified time zone. FOR INTERNAL USE.
|
static |
Internal helper function that returns the UTC offset for a UTC-datetime in a specified time zone. FOR INTERNAL USE.
Calculates difference between time in this time zone and UTC time zone for a specified date and time. FOR INTERNAL USE.
date_time | Date and time. |
bool System::TimeZoneInfo::HasSameRules | ( | const TimeZoneInfoPtr & | other | ) | const |
Checks if current and another time zones have the same adjustment rules.
other | Time zone info. |
bool System::TimeZoneInfo::IsAmbiguousTime | ( | const DateTimeOffset & | date_time_offset | ) | const |
Checks if specified date and time is ambiguous and can be mapped to many UTC times.
date_time_offset | Date and Time. |
bool System::TimeZoneInfo::IsAmbiguousTime | ( | DateTime | date_time | ) | const |
Checks if specified date and time is ambiguous and can be mapped to many UTC times.
date_time | Date and Time. |
bool System::TimeZoneInfo::IsDaylightSavingTime | ( | const DateTimeOffset & | date_time_offset | ) | const |
Checks if specified date and time falls in range of daylight saving time.
date_time_offset | Date and Time. |
bool System::TimeZoneInfo::IsDaylightSavingTime | ( | DateTime | date_time | ) | const |
Checks if specified date and time falls in range of daylight saving time.
date_time | Date and Time. |
bool System::TimeZoneInfo::IsDaylightSavingTimeNoThrow | ( | DateTime | date_time | ) | const |
Checks if specified date and time falls in range of daylight saving time.
date_time | Date and Time. |
bool System::TimeZoneInfo::IsInvalidTime | ( | DateTime | date_time | ) | const |
Checks if specified date and time is invalid.
date_time | Date and Time. |
|
overridevirtual |
Analog of C# Object.ToString() method. Enables converting custom objects to string.
Reimplemented from System::Object.
|
static |
Helper function that converts a year and TransitionTime into a DateTime.
|
staticprotected |
Verify time zone information.
|
mutableprotected |
Adjustment rules that apply to the current time zone.
|
protected |
A time interval between the current time zone's standard time and UTC time.
|
protected |
The dispaly name for the daylight saving time of the time zone.
|
protected |
The display name for the time zone.
|
protected |
ICU Time zone.
|
protected |
The identifier of the time zone.
|
protected |
The display name for the standard time of the time zone.
|
protected |
Indicates whether the time zone represented by the current object assumes transition to daylight saving time.
|
protected |
Time zone kind (UTC, Local or Unspecified).