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>
12#include "diplomat_runtime.hpp"
13namespace icu4x {
14namespace capi { struct Locale; }
15class Locale;
17} // namespace icu4x
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 template<typename W>
69 inline void basename_write(W& writeable_output) const;
70
76 inline std::optional<std::string> get_unicode_extension(std::string_view s) const;
77 template<typename W>
78 inline std::optional<std::monostate> get_unicode_extension_write(std::string_view s, W& writeable_output) const;
79
85 inline std::optional<std::monostate> set_unicode_extension(std::string_view k, std::string_view v);
86
92 inline std::string language() const;
93 template<typename W>
94 inline void language_write(W& writeable_output) const;
95
102
108 inline std::optional<std::string> region() const;
109 template<typename W>
110 inline std::optional<std::monostate> region_write(W& writeable_output) const;
111
118
124 inline std::optional<std::string> script() const;
125 template<typename W>
126 inline std::optional<std::monostate> script_write(W& writeable_output) const;
127
134
141 template<typename W>
142 inline static icu4x::diplomat::result<std::monostate, icu4x::LocaleParseError> normalize_write(std::string_view s, W& writeable_output);
143
149 inline std::string to_string() const;
150 template<typename W>
151 inline void to_string_write(W& writeable_output) const;
152
156 inline bool normalizing_eq(std::string_view other) const;
157
161 inline int8_t compare_to_string(std::string_view other) const;
162
166 inline int8_t compare_to(const icu4x::Locale& other) const;
167 inline bool operator==(const icu4x::Locale& other) const;
168 inline bool operator!=(const icu4x::Locale& other) const;
169 inline bool operator<=(const icu4x::Locale& other) const;
170 inline bool operator>=(const icu4x::Locale& other) const;
171 inline bool operator<(const icu4x::Locale& other) const;
172 inline bool operator>(const icu4x::Locale& other) const;
173
174 inline const icu4x::capi::Locale* AsFFI() const;
175 inline icu4x::capi::Locale* AsFFI();
176 inline static const icu4x::Locale* FromFFI(const icu4x::capi::Locale* ptr);
177 inline static icu4x::Locale* FromFFI(icu4x::capi::Locale* ptr);
178 inline static void operator delete(void* ptr);
179private:
180 Locale() = delete;
181 Locale(const icu4x::Locale&) = delete;
182 Locale(icu4x::Locale&&) noexcept = delete;
183 Locale operator=(const icu4x::Locale&) = delete;
184 Locale operator=(icu4x::Locale&&) noexcept = delete;
185 static void operator delete[](void*, size_t) = delete;
186};
187
188} // namespace
189#endif // ICU4X_Locale_D_HPP
Definition LocaleParseError.d.hpp:32
Definition Locale.d.hpp:33
std::optional< std::string > script() const
Definition Locale.hpp:165
int8_t compare_to(const icu4x::Locale &other) const
Definition Locale.hpp:227
std::unique_ptr< icu4x::Locale > clone() const
Definition Locale.hpp:81
std::optional< std::monostate > script_write(W &writeable_output) const
Definition Locale.hpp:173
std::string basename() const
Definition Locale.hpp:86
static icu4x::diplomat::result< std::string, icu4x::LocaleParseError > normalize(std::string_view s)
Definition Locale.hpp:186
bool operator>=(const icu4x::Locale &other) const
Definition Locale.hpp:244
static std::unique_ptr< icu4x::Locale > unknown()
Definition Locale.hpp:76
void basename_write(W &writeable_output) const
Definition Locale.hpp:94
void language_write(W &writeable_output) const
Definition Locale.hpp:132
bool operator>(const icu4x::Locale &other) const
Definition Locale.hpp:252
std::string to_string() const
Definition Locale.hpp:201
bool normalizing_eq(std::string_view other) const
Definition Locale.hpp:215
std::optional< std::string > get_unicode_extension(std::string_view s) const
Definition Locale.hpp:100
bool operator<=(const icu4x::Locale &other) const
Definition Locale.hpp:240
icu4x::diplomat::result< std::monostate, icu4x::LocaleParseError > set_script(std::string_view s)
Definition Locale.hpp:180
std::optional< std::monostate > get_unicode_extension_write(std::string_view s, W &writeable_output) const
Definition Locale.hpp:109
bool operator<(const icu4x::Locale &other) const
Definition Locale.hpp:248
static icu4x::diplomat::result< std::monostate, icu4x::LocaleParseError > normalize_write(std::string_view s, W &writeable_output)
Definition Locale.hpp:194
std::optional< std::monostate > region_write(W &writeable_output) const
Definition Locale.hpp:152
std::optional< std::monostate > set_unicode_extension(std::string_view k, std::string_view v)
Definition Locale.hpp:117
void to_string_write(W &writeable_output) const
Definition Locale.hpp:209
bool operator!=(const icu4x::Locale &other) const
Definition Locale.hpp:236
static icu4x::diplomat::result< std::unique_ptr< icu4x::Locale >, icu4x::LocaleParseError > from_string(std::string_view name)
Definition Locale.hpp:71
std::optional< std::string > region() const
Definition Locale.hpp:144
bool operator==(const icu4x::Locale &other) const
Definition Locale.hpp:232
icu4x::diplomat::result< std::monostate, icu4x::LocaleParseError > set_region(std::string_view s)
Definition Locale.hpp:159
icu4x::diplomat::result< std::monostate, icu4x::LocaleParseError > set_language(std::string_view s)
Definition Locale.hpp:138
std::string language() const
Definition Locale.hpp:124
int8_t compare_to_string(std::string_view other) const
Definition Locale.hpp:221
Definition diplomat_runtime.hpp:166
Definition Bidi.d.hpp:13