ICU4X
International Components for Unicode
Loading...
Searching...
No Matches
Locale.d.hpp
Go to the documentation of this file.
1#ifndef icu4x_Locale_D_HPP
2#define icu4x_Locale_D_HPP
3
4#include <stdio.h>
5#include <stdint.h>
6#include <stddef.h>
7#include <stdbool.h>
8#include <memory>
9#include <functional>
10#include <optional>
11#include <cstdlib>
13
14namespace icu4x {
15namespace capi { struct Locale; }
16class Locale;
18}
19
20
21namespace icu4x {
22namespace capi {
23 struct Locale;
24} // namespace capi
25} // namespace
26
27namespace icu4x {
33class Locale {
34public:
35
46
52 inline static std::unique_ptr<icu4x::Locale> unknown();
53
59 inline std::unique_ptr<icu4x::Locale> clone() const;
60
67 inline std::string basename() const;
68
74 inline std::optional<std::string> get_unicode_extension(std::string_view s) const;
75
81 inline std::string language() const;
82
89
95 inline std::optional<std::string> region() const;
96
103
109 inline std::optional<std::string> script() const;
110
117
124
130 inline std::string to_string() const;
131
135 inline bool normalizing_eq(std::string_view other) const;
136
140 inline int8_t compare_to_string(std::string_view other) const;
141
145 inline int8_t compare_to(const icu4x::Locale& other) const;
146 inline bool operator==(const icu4x::Locale& other) const;
147 inline bool operator!=(const icu4x::Locale& other) const;
148 inline bool operator<=(const icu4x::Locale& other) const;
149 inline bool operator>=(const icu4x::Locale& other) const;
150 inline bool operator<(const icu4x::Locale& other) const;
151 inline bool operator>(const icu4x::Locale& other) const;
152
153 inline const icu4x::capi::Locale* AsFFI() const;
154 inline icu4x::capi::Locale* AsFFI();
155 inline static const icu4x::Locale* FromFFI(const icu4x::capi::Locale* ptr);
156 inline static icu4x::Locale* FromFFI(icu4x::capi::Locale* ptr);
157 inline static void operator delete(void* ptr);
158private:
159 Locale() = delete;
160 Locale(const icu4x::Locale&) = delete;
161 Locale(icu4x::Locale&&) noexcept = delete;
162 Locale operator=(const icu4x::Locale&) = delete;
163 Locale operator=(icu4x::Locale&&) noexcept = delete;
164 static void operator delete[](void*, size_t) = delete;
165};
166
167} // namespace
168#endif // icu4x_Locale_D_HPP
Definition diplomat_runtime.hpp:140
Definition LocaleParseError.d.hpp:32
Definition Locale.d.hpp:33
std::optional< std::string > script() const
Definition Locale.hpp:128
int8_t compare_to(const icu4x::Locale &other) const
Definition Locale.hpp:170
diplomat::result< std::monostate, icu4x::LocaleParseError > set_script(std::string_view s)
Definition Locale.hpp:136
std::unique_ptr< icu4x::Locale > clone() const
Definition Locale.hpp:78
diplomat::result< std::monostate, icu4x::LocaleParseError > set_language(std::string_view s)
Definition Locale.hpp:108
diplomat::result< std::monostate, icu4x::LocaleParseError > set_region(std::string_view s)
Definition Locale.hpp:122
std::string basename() const
Definition Locale.hpp:83
bool operator>=(const icu4x::Locale &other) const
Definition Locale.hpp:187
static std::unique_ptr< icu4x::Locale > unknown()
Definition Locale.hpp:73
static diplomat::result< std::unique_ptr< icu4x::Locale >, icu4x::LocaleParseError > from_string(std::string_view name)
Definition Locale.hpp:68
bool operator>(const icu4x::Locale &other) const
Definition Locale.hpp:195
std::string to_string() const
Definition Locale.hpp:150
bool normalizing_eq(std::string_view other) const
Definition Locale.hpp:158
std::optional< std::string > get_unicode_extension(std::string_view s) const
Definition Locale.hpp:91
bool operator<=(const icu4x::Locale &other) const
Definition Locale.hpp:183
bool operator<(const icu4x::Locale &other) const
Definition Locale.hpp:191
bool operator!=(const icu4x::Locale &other) const
Definition Locale.hpp:179
std::optional< std::string > region() const
Definition Locale.hpp:114
bool operator==(const icu4x::Locale &other) const
Definition Locale.hpp:175
std::string language() const
Definition Locale.hpp:100
int8_t compare_to_string(std::string_view other) const
Definition Locale.hpp:164
static diplomat::result< std::string, icu4x::LocaleParseError > normalize(std::string_view s)
Definition Locale.hpp:142
Definition Bidi.d.hpp:14