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

#include <ICU4XLocale.hpp>

Public Member Functions

ICU4XLocale clone () const
 
template<typename W >
diplomat::result< std::monostate, ICU4XErrorbasename_to_writeable (W &write) const
 
diplomat::result< std::string, ICU4XErrorbasename () const
 
template<typename W >
diplomat::result< std::monostate, ICU4XErrorget_unicode_extension_to_writeable (const std::string_view bytes, W &write) const
 
diplomat::result< std::string, ICU4XErrorget_unicode_extension (const std::string_view bytes) const
 
template<typename W >
diplomat::result< std::monostate, ICU4XErrorlanguage_to_writeable (W &write) const
 
diplomat::result< std::string, ICU4XErrorlanguage () const
 
diplomat::result< std::monostate, ICU4XErrorset_language (const std::string_view bytes)
 
template<typename W >
diplomat::result< std::monostate, ICU4XErrorregion_to_writeable (W &write) const
 
diplomat::result< std::string, ICU4XErrorregion () const
 
diplomat::result< std::monostate, ICU4XErrorset_region (const std::string_view bytes)
 
template<typename W >
diplomat::result< std::monostate, ICU4XErrorscript_to_writeable (W &write) const
 
diplomat::result< std::string, ICU4XErrorscript () const
 
diplomat::result< std::monostate, ICU4XErrorset_script (const std::string_view bytes)
 
template<typename W >
diplomat::result< std::monostate, ICU4XErrorto_string_to_writeable (W &write) const
 
diplomat::result< std::string, ICU4XErrorto_string () const
 
bool normalizing_eq (const std::string_view other) const
 
ICU4XOrdering strict_cmp (const std::string_view other) const
 
ICU4XOrdering total_cmp (const ICU4XLocale &other) const
 
 ICU4XLocale (capi::ICU4XLocale *i)
 
 ICU4XLocale ()=default
 
 ICU4XLocale (ICU4XLocale &&) noexcept=default
 
ICU4XLocaleoperator= (ICU4XLocale &&other) noexcept=default
 

Static Public Member Functions

static diplomat::result< ICU4XLocale, ICU4XErrorcreate_from_string (const std::string_view name)
 
static ICU4XLocale create_und ()
 
template<typename W >
static diplomat::result< std::monostate, ICU4XErrorcanonicalize_to_writeable (const std::string_view bytes, W &write)
 
static diplomat::result< std::string, ICU4XErrorcanonicalize (const std::string_view bytes)
 
static ICU4XLocale create_en ()
 
static ICU4XLocale create_bn ()
 

Detailed Description

An ICU4X Locale, capable of representing strings like "en-US".

See the Rust documentation for Locale for more information.

Constructor & Destructor Documentation

◆ ICU4XLocale() [1/3]

ICU4XLocale::ICU4XLocale ( capi::ICU4XLocale *  i)
inlineexplicit

◆ ICU4XLocale() [2/3]

ICU4XLocale::ICU4XLocale ( )
default

◆ ICU4XLocale() [3/3]

ICU4XLocale::ICU4XLocale ( ICU4XLocale &&  )
defaultnoexcept

Member Function Documentation

◆ basename()

diplomat::result< std::string, ICU4XError > ICU4XLocale::basename ( ) const
inline

Write a string representation of the LanguageIdentifier part of [ICU4XLocale] to write.

See the Rust documentation for id for more information.

◆ basename_to_writeable()

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

Write a string representation of the LanguageIdentifier part of [ICU4XLocale] to write.

See the Rust documentation for id for more information.

◆ canonicalize()

diplomat::result< std::string, ICU4XError > ICU4XLocale::canonicalize ( const std::string_view  bytes)
inlinestatic

Best effort locale canonicalizer that doesn't need any data

Use ICU4XLocaleCanonicalizer for better control and functionality

See the Rust documentation for canonicalize for more information.

◆ canonicalize_to_writeable()

template<typename W >
diplomat::result< std::monostate, ICU4XError > ICU4XLocale::canonicalize_to_writeable ( const std::string_view  bytes,
W &  write 
)
inlinestatic

Best effort locale canonicalizer that doesn't need any data

Use ICU4XLocaleCanonicalizer for better control and functionality

See the Rust documentation for canonicalize for more information.

◆ clone()

ICU4XLocale ICU4XLocale::clone ( ) const
inline

Clones the [ICU4XLocale].

See the Rust documentation for Locale for more information.

◆ create_bn()

ICU4XLocale ICU4XLocale::create_bn ( )
inlinestatic

Deprecated

Use `create_from_string("bn").

◆ create_en()

ICU4XLocale ICU4XLocale::create_en ( )
inlinestatic

Deprecated

Use `create_from_string("en").

◆ create_from_string()

diplomat::result< ICU4XLocale, ICU4XError > ICU4XLocale::create_from_string ( const std::string_view  name)
inlinestatic

Construct an [ICU4XLocale] from an locale identifier.

This will run the complete locale parsing algorithm. If code size and performance are critical and the locale is of a known shape (such as aa-BB) use create_und, set_language, set_script, and set_region.

See the Rust documentation for try_from_bytes for more information.

◆ create_und()

ICU4XLocale ICU4XLocale::create_und ( )
inlinestatic

Construct a default undefined [ICU4XLocale] "und".

See the Rust documentation for UND for more information.

◆ get_unicode_extension()

diplomat::result< std::string, ICU4XError > ICU4XLocale::get_unicode_extension ( const std::string_view  bytes) const
inline

Write a string representation of the unicode extension to write

See the Rust documentation for extensions for more information.

◆ get_unicode_extension_to_writeable()

template<typename W >
diplomat::result< std::monostate, ICU4XError > ICU4XLocale::get_unicode_extension_to_writeable ( const std::string_view  bytes,
W &  write 
) const
inline

Write a string representation of the unicode extension to write

See the Rust documentation for extensions for more information.

◆ language()

diplomat::result< std::string, ICU4XError > ICU4XLocale::language ( ) const
inline

Write a string representation of [ICU4XLocale] language to write

See the Rust documentation for id for more information.

◆ language_to_writeable()

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

Write a string representation of [ICU4XLocale] language to write

See the Rust documentation for id for more information.

◆ normalizing_eq()

bool ICU4XLocale::normalizing_eq ( const std::string_view  other) const
inline

See the Rust documentation for normalizing_eq for more information.

◆ operator=()

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

◆ region()

diplomat::result< std::string, ICU4XError > ICU4XLocale::region ( ) const
inline

Write a string representation of [ICU4XLocale] region to write

See the Rust documentation for id for more information.

◆ region_to_writeable()

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

Write a string representation of [ICU4XLocale] region to write

See the Rust documentation for id for more information.

◆ script()

diplomat::result< std::string, ICU4XError > ICU4XLocale::script ( ) const
inline

Write a string representation of [ICU4XLocale] script to write

See the Rust documentation for id for more information.

◆ script_to_writeable()

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

Write a string representation of [ICU4XLocale] script to write

See the Rust documentation for id for more information.

◆ set_language()

diplomat::result< std::monostate, ICU4XError > ICU4XLocale::set_language ( const std::string_view  bytes)
inline

Set the language part of the [ICU4XLocale].

See the Rust documentation for try_from_bytes for more information.

◆ set_region()

diplomat::result< std::monostate, ICU4XError > ICU4XLocale::set_region ( const std::string_view  bytes)
inline

Set the region part of the [ICU4XLocale].

See the Rust documentation for try_from_bytes for more information.

◆ set_script()

diplomat::result< std::monostate, ICU4XError > ICU4XLocale::set_script ( const std::string_view  bytes)
inline

Set the script part of the [ICU4XLocale]. Pass an empty string to remove the script.

See the Rust documentation for try_from_bytes for more information.

◆ strict_cmp()

ICU4XOrdering ICU4XLocale::strict_cmp ( const std::string_view  other) const
inline

See the Rust documentation for strict_cmp for more information.

◆ to_string()

diplomat::result< std::string, ICU4XError > ICU4XLocale::to_string ( ) const
inline

Write a string representation of [ICU4XLocale] to write

See the Rust documentation for write_to for more information.

◆ to_string_to_writeable()

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

Write a string representation of [ICU4XLocale] to write

See the Rust documentation for write_to for more information.

◆ total_cmp()

ICU4XOrdering ICU4XLocale::total_cmp ( const ICU4XLocale other) const
inline

See the Rust documentation for total_cmp for more information.


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