ICU4X
International Components for Unicode
Loading...
Searching...
No Matches
Weekday.d.hpp
Go to the documentation of this file.
1#ifndef ICU4X_Weekday_D_HPP
2#define ICU4X_Weekday_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"
13
14
15namespace icu4x {
16namespace capi {
17 enum Weekday {
18 Weekday_Monday = 1,
19 Weekday_Tuesday = 2,
20 Weekday_Wednesday = 3,
21 Weekday_Thursday = 4,
22 Weekday_Friday = 5,
23 Weekday_Saturday = 6,
24 Weekday_Sunday = 7,
25 };
26
27 typedef struct Weekday_option {union { Weekday ok; }; bool is_ok; } Weekday_option;
28} // namespace capi
29} // namespace
30
31namespace icu4x {
35class Weekday {
36public:
37 enum Value {
38 Monday = 1,
42 Friday = 5,
44 Sunday = 7,
45 };
46
47 Weekday(): value(Value::Monday) {}
48
49 // Implicit conversions between enum and ::Value
50 constexpr Weekday(Value v) : value(v) {}
51 constexpr operator Value() const { return value; }
52 // Prevent usage as boolean value
53 explicit operator bool() const = delete;
54
55 inline icu4x::capi::Weekday AsFFI() const;
56 inline static icu4x::Weekday FromFFI(icu4x::capi::Weekday c_enum);
57private:
58 Value value;
59};
60
61} // namespace
62#endif // ICU4X_Weekday_D_HPP
Definition Weekday.d.hpp:35
Weekday()
Definition Weekday.d.hpp:47
constexpr Weekday(Value v)
Definition Weekday.d.hpp:50
Value
Definition Weekday.d.hpp:37
@ Friday
Definition Weekday.d.hpp:42
@ Wednesday
Definition Weekday.d.hpp:40
@ Sunday
Definition Weekday.d.hpp:44
@ Thursday
Definition Weekday.d.hpp:41
@ Tuesday
Definition Weekday.d.hpp:39
@ Saturday
Definition Weekday.d.hpp:43
@ Monday
Definition Weekday.d.hpp:38
Definition Bidi.d.hpp:13