ICU4X
International Components for Unicode
Loading...
Searching...
No Matches
ICU4XCustomTimeZone Class Reference

#include <ICU4XCustomTimeZone.hpp>

Public Member Functions

diplomat::result< std::monostate, ICU4XErrortry_set_gmt_offset_seconds (int32_t offset_seconds)
 
void clear_gmt_offset ()
 
diplomat::result< int32_t, ICU4XErrorgmt_offset_seconds () const
 
diplomat::result< bool, ICU4XErroris_gmt_offset_positive () const
 
diplomat::result< bool, ICU4XErroris_gmt_offset_zero () const
 
diplomat::result< bool, ICU4XErrorgmt_offset_has_minutes () const
 
diplomat::result< bool, ICU4XErrorgmt_offset_has_seconds () const
 
diplomat::result< std::monostate, ICU4XErrortry_set_time_zone_id (const std::string_view id)
 
diplomat::result< std::monostate, ICU4XErrortry_set_iana_time_zone_id (const ICU4XIanaToBcp47Mapper &mapper, const std::string_view id)
 
diplomat::result< std::monostate, ICU4XErrortry_set_iana_time_zone_id_2 (const ICU4XTimeZoneIdMapper &mapper, const std::string_view id)
 
void clear_time_zone_id ()
 
template<typename W>
diplomat::result< std::monostate, ICU4XErrortime_zone_id_to_writeable (W &write) const
 
diplomat::result< std::string, ICU4XErrortime_zone_id () const
 
diplomat::result< std::monostate, ICU4XErrortry_set_metazone_id (const std::string_view id)
 
void clear_metazone_id ()
 
template<typename W>
diplomat::result< std::monostate, ICU4XErrormetazone_id_to_writeable (W &write) const
 
diplomat::result< std::string, ICU4XErrormetazone_id () const
 
diplomat::result< std::monostate, ICU4XErrortry_set_zone_variant (const std::string_view id)
 
void clear_zone_variant ()
 
template<typename W>
diplomat::result< std::monostate, ICU4XErrorzone_variant_to_writeable (W &write) const
 
diplomat::result< std::string, ICU4XErrorzone_variant () const
 
void set_standard_time ()
 
void set_daylight_time ()
 
diplomat::result< bool, ICU4XErroris_standard_time () const
 
diplomat::result< bool, ICU4XErroris_daylight_time () const
 
void maybe_calculate_metazone (const ICU4XMetazoneCalculator &metazone_calculator, const ICU4XIsoDateTime &local_datetime)
 
 ICU4XCustomTimeZone (capi::ICU4XCustomTimeZone *i)
 
 ICU4XCustomTimeZone ()=default
 
 ICU4XCustomTimeZone (ICU4XCustomTimeZone &&) noexcept=default
 
ICU4XCustomTimeZoneoperator= (ICU4XCustomTimeZone &&other) noexcept=default
 

Static Public Member Functions

static diplomat::result< ICU4XCustomTimeZone, ICU4XErrorcreate_from_string (const std::string_view s)
 
static ICU4XCustomTimeZone create_empty ()
 
static ICU4XCustomTimeZone create_utc ()
 

Detailed Description

See the Rust documentation for CustomTimeZone for more information.

Constructor & Destructor Documentation

◆ ICU4XCustomTimeZone() [1/3]

ICU4XCustomTimeZone::ICU4XCustomTimeZone ( capi::ICU4XCustomTimeZone * i)
inlineexplicit

◆ ICU4XCustomTimeZone() [2/3]

ICU4XCustomTimeZone::ICU4XCustomTimeZone ( )
default

◆ ICU4XCustomTimeZone() [3/3]

ICU4XCustomTimeZone::ICU4XCustomTimeZone ( ICU4XCustomTimeZone && )
defaultnoexcept

Member Function Documentation

◆ clear_gmt_offset()

void ICU4XCustomTimeZone::clear_gmt_offset ( )
inline

Clears the gmt_offset field.

See the Rust documentation for offset_seconds for more information.

Additional information: 1

◆ clear_metazone_id()

void ICU4XCustomTimeZone::clear_metazone_id ( )
inline

Clears the metazone_id field.

See the Rust documentation for metazone_id for more information.

Additional information: 1

◆ clear_time_zone_id()

void ICU4XCustomTimeZone::clear_time_zone_id ( )
inline

Clears the time_zone_id field.

See the Rust documentation for time_zone_id for more information.

Additional information: 1

◆ clear_zone_variant()

void ICU4XCustomTimeZone::clear_zone_variant ( )
inline

Clears the zone_variant field.

See the Rust documentation for zone_variant for more information.

Additional information: 1

◆ create_empty()

ICU4XCustomTimeZone ICU4XCustomTimeZone::create_empty ( )
inlinestatic

Creates a time zone with no information.

See the Rust documentation for new_empty for more information.

◆ create_from_string()

diplomat::result< ICU4XCustomTimeZone, ICU4XError > ICU4XCustomTimeZone::create_from_string ( const std::string_view s)
inlinestatic

Creates a time zone from an offset string.

See the Rust documentation for from_str for more information.

◆ create_utc()

ICU4XCustomTimeZone ICU4XCustomTimeZone::create_utc ( )
inlinestatic

Creates a time zone for UTC.

See the Rust documentation for utc for more information.

◆ gmt_offset_has_minutes()

diplomat::result< bool, ICU4XError > ICU4XCustomTimeZone::gmt_offset_has_minutes ( ) const
inline

Returns whether the gmt_offset field has nonzero minutes.

Errors if the gmt_offset field is empty.

See the Rust documentation for has_minutes for more information.

◆ gmt_offset_has_seconds()

diplomat::result< bool, ICU4XError > ICU4XCustomTimeZone::gmt_offset_has_seconds ( ) const
inline

Returns whether the gmt_offset field has nonzero seconds.

Errors if the gmt_offset field is empty.

See the Rust documentation for has_seconds for more information.

◆ gmt_offset_seconds()

diplomat::result< int32_t, ICU4XError > ICU4XCustomTimeZone::gmt_offset_seconds ( ) const
inline

Returns the value of the gmt_offset field as offset seconds.

Errors if the gmt_offset field is empty.

See the Rust documentation for offset_seconds for more information.

Additional information: 1

◆ is_daylight_time()

diplomat::result< bool, ICU4XError > ICU4XCustomTimeZone::is_daylight_time ( ) const
inline

Returns whether the zone_variant field is daylight time.

Errors if the zone_variant field is empty.

See the Rust documentation for daylight for more information.

Additional information: 1

◆ is_gmt_offset_positive()

diplomat::result< bool, ICU4XError > ICU4XCustomTimeZone::is_gmt_offset_positive ( ) const
inline

Returns whether the gmt_offset field is positive.

Errors if the gmt_offset field is empty.

See the Rust documentation for is_positive for more information.

◆ is_gmt_offset_zero()

diplomat::result< bool, ICU4XError > ICU4XCustomTimeZone::is_gmt_offset_zero ( ) const
inline

Returns whether the gmt_offset field is zero.

Errors if the gmt_offset field is empty (which is not the same as zero).

See the Rust documentation for is_zero for more information.

◆ is_standard_time()

diplomat::result< bool, ICU4XError > ICU4XCustomTimeZone::is_standard_time ( ) const
inline

Returns whether the zone_variant field is standard time.

Errors if the zone_variant field is empty.

See the Rust documentation for standard for more information.

Additional information: 1

◆ maybe_calculate_metazone()

void ICU4XCustomTimeZone::maybe_calculate_metazone ( const ICU4XMetazoneCalculator & metazone_calculator,
const ICU4XIsoDateTime & local_datetime )
inline

Sets the metazone based on the time zone and the local timestamp.

See the Rust documentation for maybe_calculate_metazone for more information.

Additional information: 1

◆ metazone_id()

diplomat::result< std::string, ICU4XError > ICU4XCustomTimeZone::metazone_id ( ) const
inline

Writes the value of the metazone_id field as a string.

Errors if the metazone_id field is empty.

See the Rust documentation for metazone_id for more information.

Additional information: 1

◆ metazone_id_to_writeable()

template<typename W>
diplomat::result< std::monostate, ICU4XError > ICU4XCustomTimeZone::metazone_id_to_writeable ( W & write) const
inline

Writes the value of the metazone_id field as a string.

Errors if the metazone_id field is empty.

See the Rust documentation for metazone_id for more information.

Additional information: 1

◆ operator=()

ICU4XCustomTimeZone & ICU4XCustomTimeZone::operator= ( ICU4XCustomTimeZone && other)
defaultnoexcept

◆ set_daylight_time()

void ICU4XCustomTimeZone::set_daylight_time ( )
inline

Sets the zone_variant field to "daylight" time, which may or may not correspond to a display name with "Daylight" in its name.

See the Rust documentation for daylight for more information.

Additional information: 1

◆ set_standard_time()

void ICU4XCustomTimeZone::set_standard_time ( )
inline

Sets the zone_variant field to "standard" time, which may or may not correspond to a display name with "Standard" in its name.

See the Rust documentation for standard for more information.

Additional information: 1

◆ time_zone_id()

diplomat::result< std::string, ICU4XError > ICU4XCustomTimeZone::time_zone_id ( ) const
inline

Writes the value of the time_zone_id field as a string.

Errors if the time_zone_id field is empty.

See the Rust documentation for time_zone_id for more information.

Additional information: 1

◆ time_zone_id_to_writeable()

template<typename W>
diplomat::result< std::monostate, ICU4XError > ICU4XCustomTimeZone::time_zone_id_to_writeable ( W & write) const
inline

Writes the value of the time_zone_id field as a string.

Errors if the time_zone_id field is empty.

See the Rust documentation for time_zone_id for more information.

Additional information: 1

◆ try_set_gmt_offset_seconds()

diplomat::result< std::monostate, ICU4XError > ICU4XCustomTimeZone::try_set_gmt_offset_seconds ( int32_t offset_seconds)
inline

Sets the gmt_offset field from offset seconds.

Errors if the offset seconds are out of range.

See the Rust documentation for try_from_offset_seconds for more information.

Additional information: 1

◆ try_set_iana_time_zone_id()

diplomat::result< std::monostate, ICU4XError > ICU4XCustomTimeZone::try_set_iana_time_zone_id ( const ICU4XIanaToBcp47Mapper & mapper,
const std::string_view id )
inline

Sets the time_zone_id field from an IANA string by looking up the corresponding BCP-47 string.

Errors if the string is not a valid BCP-47 time zone ID.

See the Rust documentation for get for more information.

◆ try_set_iana_time_zone_id_2()

diplomat::result< std::monostate, ICU4XError > ICU4XCustomTimeZone::try_set_iana_time_zone_id_2 ( const ICU4XTimeZoneIdMapper & mapper,
const std::string_view id )
inline

Sets the time_zone_id field from an IANA string by looking up the corresponding BCP-47 string.

Errors if the string is not a valid BCP-47 time zone ID.

◆ try_set_metazone_id()

diplomat::result< std::monostate, ICU4XError > ICU4XCustomTimeZone::try_set_metazone_id ( const std::string_view id)
inline

Sets the metazone_id field from a string.

Errors if the string is not a valid BCP-47 metazone ID.

See the Rust documentation for metazone_id for more information.

Additional information: 1

◆ try_set_time_zone_id()

diplomat::result< std::monostate, ICU4XError > ICU4XCustomTimeZone::try_set_time_zone_id ( const std::string_view id)
inline

Sets the time_zone_id field from a BCP-47 string.

Errors if the string is not a valid BCP-47 time zone ID.

See the Rust documentation for time_zone_id for more information.

Additional information: 1

◆ try_set_zone_variant()

diplomat::result< std::monostate, ICU4XError > ICU4XCustomTimeZone::try_set_zone_variant ( const std::string_view id)
inline

Sets the zone_variant field from a string.

Errors if the string is not a valid zone variant.

See the Rust documentation for zone_variant for more information.

Additional information: 1

◆ zone_variant()

diplomat::result< std::string, ICU4XError > ICU4XCustomTimeZone::zone_variant ( ) const
inline

Writes the value of the zone_variant field as a string.

Errors if the zone_variant field is empty.

See the Rust documentation for zone_variant for more information.

Additional information: 1

◆ zone_variant_to_writeable()

template<typename W>
diplomat::result< std::monostate, ICU4XError > ICU4XCustomTimeZone::zone_variant_to_writeable ( W & write) const
inline

Writes the value of the zone_variant field as a string.

Errors if the zone_variant field is empty.

See the Rust documentation for zone_variant for more information.

Additional information: 1


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