PluralOperands.d.hpp (2169B)
1 #ifndef icu4x_PluralOperands_D_HPP 2 #define icu4x_PluralOperands_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 namespace capi { struct Decimal; } 16 class Decimal; 17 namespace capi { struct PluralOperands; } 18 class PluralOperands; 19 class DecimalParseError; 20 } 21 22 23 namespace icu4x { 24 namespace capi { 25 struct PluralOperands; 26 } // namespace capi 27 } // namespace 28 29 namespace icu4x { 30 /** 31 * See the [Rust documentation for `PluralOperands`](https://docs.rs/icu/latest/icu/plurals/struct.PluralOperands.html) for more information. 32 */ 33 class PluralOperands { 34 public: 35 36 /** 37 * Construct for a given string representing a number 38 * 39 * See the [Rust documentation for `from_str`](https://docs.rs/icu/latest/icu/plurals/struct.PluralOperands.html#method.from_str) for more information. 40 */ 41 inline static diplomat::result<std::unique_ptr<icu4x::PluralOperands>, icu4x::DecimalParseError> from_string(std::string_view s); 42 43 /** 44 * Construct for a given integer 45 */ 46 inline static std::unique_ptr<icu4x::PluralOperands> from(int64_t i); 47 48 /** 49 * Construct from a FixedDecimal 50 * 51 * Retains at most 18 digits each from the integer and fraction parts. 52 */ 53 inline static std::unique_ptr<icu4x::PluralOperands> from_fixed_decimal(const icu4x::Decimal& x); 54 55 inline const icu4x::capi::PluralOperands* AsFFI() const; 56 inline icu4x::capi::PluralOperands* AsFFI(); 57 inline static const icu4x::PluralOperands* FromFFI(const icu4x::capi::PluralOperands* ptr); 58 inline static icu4x::PluralOperands* FromFFI(icu4x::capi::PluralOperands* ptr); 59 inline static void operator delete(void* ptr); 60 private: 61 PluralOperands() = delete; 62 PluralOperands(const icu4x::PluralOperands&) = delete; 63 PluralOperands(icu4x::PluralOperands&&) noexcept = delete; 64 PluralOperands operator=(const icu4x::PluralOperands&) = delete; 65 PluralOperands operator=(icu4x::PluralOperands&&) noexcept = delete; 66 static void operator delete[](void*, size_t) = delete; 67 }; 68 69 } // namespace 70 #endif // icu4x_PluralOperands_D_HPP