• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef icu4x_ListFormatter_D_HPP
2 #define icu4x_ListFormatter_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 "../diplomat_runtime.hpp"
12 
13 namespace icu4x {
14 namespace capi { struct DataProvider; }
15 class DataProvider;
16 namespace capi { struct ListFormatter; }
17 class ListFormatter;
18 namespace capi { struct Locale; }
19 class Locale;
20 class DataError;
21 class ListLength;
22 }
23 
24 
25 namespace icu4x {
26 namespace capi {
27     struct ListFormatter;
28 } // namespace capi
29 } // namespace
30 
31 namespace icu4x {
32 class ListFormatter {
33 public:
34 
35   inline static diplomat::result<std::unique_ptr<icu4x::ListFormatter>, icu4x::DataError> create_and_with_length(const icu4x::Locale& locale, icu4x::ListLength length);
36 
37   inline static diplomat::result<std::unique_ptr<icu4x::ListFormatter>, icu4x::DataError> create_and_with_length_and_provider(const icu4x::DataProvider& provider, const icu4x::Locale& locale, icu4x::ListLength length);
38 
39   inline static diplomat::result<std::unique_ptr<icu4x::ListFormatter>, icu4x::DataError> create_or_with_length(const icu4x::Locale& locale, icu4x::ListLength length);
40 
41   inline static diplomat::result<std::unique_ptr<icu4x::ListFormatter>, icu4x::DataError> create_or_with_length_and_provider(const icu4x::DataProvider& provider, const icu4x::Locale& locale, icu4x::ListLength length);
42 
43   inline static diplomat::result<std::unique_ptr<icu4x::ListFormatter>, icu4x::DataError> create_unit_with_length(const icu4x::Locale& locale, icu4x::ListLength length);
44 
45   inline static diplomat::result<std::unique_ptr<icu4x::ListFormatter>, icu4x::DataError> create_unit_with_length_and_provider(const icu4x::DataProvider& provider, const icu4x::Locale& locale, icu4x::ListLength length);
46 
47   inline std::string format(diplomat::span<const std::string_view> list) const;
48 
49   inline std::string format16(diplomat::span<const std::u16string_view> list) const;
50 
51   inline const icu4x::capi::ListFormatter* AsFFI() const;
52   inline icu4x::capi::ListFormatter* AsFFI();
53   inline static const icu4x::ListFormatter* FromFFI(const icu4x::capi::ListFormatter* ptr);
54   inline static icu4x::ListFormatter* FromFFI(icu4x::capi::ListFormatter* ptr);
55   inline static void operator delete(void* ptr);
56 private:
57   ListFormatter() = delete;
58   ListFormatter(const icu4x::ListFormatter&) = delete;
59   ListFormatter(icu4x::ListFormatter&&) noexcept = delete;
60   ListFormatter operator=(const icu4x::ListFormatter&) = delete;
61   ListFormatter operator=(icu4x::ListFormatter&&) noexcept = delete;
62   static void operator delete[](void*, size_t) = delete;
63 };
64 
65 } // namespace
66 #endif // icu4x_ListFormatter_D_HPP
67