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::optional<std::monostate> set_unicode_extension(std::string_view k, std::string_view v);
82
88 inline std::string language() const;
89
96
102 inline std::optional<std::string> region() const;
103
110
116 inline std::optional<std::string> script() const;
117
124
131
137 inline std::string to_string() const;
138
142 inline bool normalizing_eq(std::string_view other) const;
143
147 inline int8_t compare_to_string(std::string_view other) const;
148
152 inline int8_t compare_to(const icu4x::Locale& other) const;
153 inline bool operator==(const icu4x::Locale& other) const;
154 inline bool operator!=(const icu4x::Locale& other) const;
155 inline bool operator<=(const icu4x::Locale& other) const;
156 inline bool operator>=(const icu4x::Locale& other) const;
157 inline bool operator<(const icu4x::Locale& other) const;
158 inline bool operator>(const icu4x::Locale& other) const;
159
160 inline const icu4x::capi::Locale* AsFFI() const;
161 inline icu4x::capi::Locale* AsFFI();
162 inline static const icu4x::Locale* FromFFI(const icu4x::capi::Locale* ptr);
163 inline static icu4x::Locale* FromFFI(icu4x::capi::Locale* ptr);
164 inline static void operator delete(void* ptr);
165private:
166 Locale() = delete;
167 Locale(const icu4x::Locale&) = delete;
168 Locale(icu4x::Locale&&) noexcept = delete;
169 Locale operator=(const icu4x::Locale&) = delete;
170 Locale operator=(icu4x::Locale&&) noexcept = delete;
171 static void operator delete[](void*, size_t) = delete;
172};
173
174} // namespace
175#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:138
int8_t compare_to(const icu4x::Locale &other) const
Definition Locale.hpp:180
diplomat::result< std::monostate, icu4x::LocaleParseError > set_script(std::string_view s)
Definition Locale.hpp:146
std::unique_ptr< icu4x::Locale > clone() const
Definition Locale.hpp:81
diplomat::result< std::monostate, icu4x::LocaleParseError > set_language(std::string_view s)
Definition Locale.hpp:118
diplomat::result< std::monostate, icu4x::LocaleParseError > set_region(std::string_view s)
Definition Locale.hpp:132
std::string basename() const
Definition Locale.hpp:86
bool operator>=(const icu4x::Locale &other) const
Definition Locale.hpp:197
static std::unique_ptr< icu4x::Locale > unknown()
Definition Locale.hpp:76
static diplomat::result< std::unique_ptr< icu4x::Locale >, icu4x::LocaleParseError > from_string(std::string_view name)
Definition Locale.hpp:71
bool operator>(const icu4x::Locale &other) const
Definition Locale.hpp:205
std::string to_string() const
Definition Locale.hpp:160
bool normalizing_eq(std::string_view other) const
Definition Locale.hpp:168
std::optional< std::string > get_unicode_extension(std::string_view s) const
Definition Locale.hpp:94
bool operator<=(const icu4x::Locale &other) const
Definition Locale.hpp:193
bool operator<(const icu4x::Locale &other) const
Definition Locale.hpp:201
std::optional< std::monostate > set_unicode_extension(std::string_view k, std::string_view v)
Definition Locale.hpp:103
bool operator!=(const icu4x::Locale &other) const
Definition Locale.hpp:189
std::optional< std::string > region() const
Definition Locale.hpp:124
bool operator==(const icu4x::Locale &other) const
Definition Locale.hpp:185
std::string language() const
Definition Locale.hpp:110
int8_t compare_to_string(std::string_view other) const
Definition Locale.hpp:174
static diplomat::result< std::string, icu4x::LocaleParseError > normalize(std::string_view s)
Definition Locale.hpp:152
Definition Bidi.d.hpp:14