tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

GraphemeClusterBreak.d.hpp (3249B)


      1 #ifndef icu4x_GraphemeClusterBreak_D_HPP
      2 #define icu4x_GraphemeClusterBreak_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 namespace icu4x {
     15 class GraphemeClusterBreak;
     16 }
     17 
     18 
     19 namespace icu4x {
     20 namespace capi {
     21    enum GraphemeClusterBreak {
     22      GraphemeClusterBreak_Other = 0,
     23      GraphemeClusterBreak_Control = 1,
     24      GraphemeClusterBreak_CR = 2,
     25      GraphemeClusterBreak_Extend = 3,
     26      GraphemeClusterBreak_L = 4,
     27      GraphemeClusterBreak_LF = 5,
     28      GraphemeClusterBreak_LV = 6,
     29      GraphemeClusterBreak_LVT = 7,
     30      GraphemeClusterBreak_T = 8,
     31      GraphemeClusterBreak_V = 9,
     32      GraphemeClusterBreak_SpacingMark = 10,
     33      GraphemeClusterBreak_Prepend = 11,
     34      GraphemeClusterBreak_RegionalIndicator = 12,
     35      GraphemeClusterBreak_EBase = 13,
     36      GraphemeClusterBreak_EBaseGAZ = 14,
     37      GraphemeClusterBreak_EModifier = 15,
     38      GraphemeClusterBreak_GlueAfterZwj = 16,
     39      GraphemeClusterBreak_ZWJ = 17,
     40    };
     41 
     42    typedef struct GraphemeClusterBreak_option {union { GraphemeClusterBreak ok; }; bool is_ok; } GraphemeClusterBreak_option;
     43 } // namespace capi
     44 } // namespace
     45 
     46 namespace icu4x {
     47 /**
     48 * See the [Rust documentation for `GraphemeClusterBreak`](https://docs.rs/icu/latest/icu/properties/props/struct.GraphemeClusterBreak.html) for more information.
     49 */
     50 class GraphemeClusterBreak {
     51 public:
     52  enum Value {
     53    Other = 0,
     54    Control = 1,
     55    CR = 2,
     56    Extend = 3,
     57    L = 4,
     58    LF = 5,
     59    LV = 6,
     60    LVT = 7,
     61    T = 8,
     62    V = 9,
     63    SpacingMark = 10,
     64    Prepend = 11,
     65    RegionalIndicator = 12,
     66    EBase = 13,
     67    EBaseGAZ = 14,
     68    EModifier = 15,
     69    GlueAfterZwj = 16,
     70    ZWJ = 17,
     71  };
     72 
     73  GraphemeClusterBreak() = default;
     74  // Implicit conversions between enum and ::Value
     75  constexpr GraphemeClusterBreak(Value v) : value(v) {}
     76  constexpr operator Value() const { return value; }
     77  // Prevent usage as boolean value
     78  explicit operator bool() const = delete;
     79 
     80  /**
     81   * See the [Rust documentation for `for_char`](https://docs.rs/icu/latest/icu/properties/props/trait.EnumeratedProperty.html#tymethod.for_char) for more information.
     82   */
     83  inline static icu4x::GraphemeClusterBreak for_char(char32_t ch);
     84 
     85  /**
     86   * Convert to an integer value usable with ICU4C and CodePointMapData
     87   *
     88   * See the [Rust documentation for `to_icu4c_value`](https://docs.rs/icu/latest/icu/properties/props/struct.GraphemeClusterBreak.html#method.to_icu4c_value) for more information.
     89   */
     90  inline uint8_t to_integer_value() const;
     91 
     92  /**
     93   * Convert from an integer value from ICU4C or CodePointMapData
     94   *
     95   * See the [Rust documentation for `from_icu4c_value`](https://docs.rs/icu/latest/icu/properties/props/struct.GraphemeClusterBreak.html#method.from_icu4c_value) for more information.
     96   */
     97  inline static std::optional<icu4x::GraphemeClusterBreak> from_integer_value(uint8_t other);
     98 
     99  inline icu4x::capi::GraphemeClusterBreak AsFFI() const;
    100  inline static icu4x::GraphemeClusterBreak FromFFI(icu4x::capi::GraphemeClusterBreak c_enum);
    101 private:
    102    Value value;
    103 };
    104 
    105 } // namespace
    106 #endif // icu4x_GraphemeClusterBreak_D_HPP