ICU4X
International Components for Unicode
Loading...
Searching...
No Matches
diplomat_runtime.hpp File Reference
#include <optional>
#include <string>
#include <string_view>
#include <type_traits>
#include <variant>
#include <cstdint>
#include <functional>
#include <memory>
#include <limits>
#include <array>

Go to the source code of this file.

Classes

struct  icu4x::diplomat::WriteTrait< T >
 
struct  icu4x::diplomat::WriteTrait< std::string >
 
struct  icu4x::diplomat::Ok< T >
 
struct  icu4x::diplomat::Err< T >
 
class  icu4x::diplomat::result< T, E >
 
class  icu4x::diplomat::Utf8Error
 
class  icu4x::diplomat::span< T, Extent >
 
class  icu4x::diplomat::basic_string_view_for_slice< CharT, Traits >
 
struct  icu4x::diplomat::as_ffi< T, typename >
 
struct  icu4x::diplomat::as_ffi< std::unique_ptr< T > >
 
struct  icu4x::diplomat::diplomat_c_span_convert< T, typename >
 
struct  icu4x::diplomat::is_unique_ptr< T >
 
struct  icu4x::diplomat::is_unique_ptr< std::unique_ptr< T > >
 
struct  icu4x::diplomat::is_optional< T >
 
struct  icu4x::diplomat::is_optional< std::optional< T > >
 
struct  icu4x::diplomat::fn_traits< std::function< Ret(Args...)> >
 
struct  icu4x::diplomat::inner< T >
 
struct  icu4x::diplomat::inner< T * >
 
struct  icu4x::diplomat::inner< std::unique_ptr< T > >
 
struct  icu4x::diplomat::inner< std::optional< T > >
 
struct  icu4x::diplomat::has_next< T, U >
 
struct  icu4x::diplomat::has_next< T, std::void_t< decltype(std::declval< T >().next())> >
 
struct  icu4x::diplomat::next_to_iter_helper< T >
 Helper template enabling native iteration over unique ptrs to objects which implement next() More...
 

Namespaces

namespace  icu4x
 
namespace  icu4x::diplomat
 
namespace  icu4x::diplomat::fn_trait_helpers
 

Macros

#define DIPLOMAT_LIFETIME_BOUND
 
#define MAKE_SLICES(name, c_ty)
 
#define MAKE_SLICES_AND_OPTIONS(name, c_ty)
 
#define MAKE_SLICE_CONVERTERS(name, c_ty)
 

Typedefs

using icu4x::diplomat::string_view_for_slice = basic_string_view_for_slice< char >
 
using icu4x::diplomat::u16string_view_for_slice = basic_string_view_for_slice< char16_t >
 
using icu4x::diplomat::string_view_span = span< const string_view_for_slice >
 
using icu4x::diplomat::u16string_view_span = span< const u16string_view_for_slice >
 
template<typename T >
using icu4x::diplomat::as_ffi_t = typename as_ffi< T >::type
 
template<typename T >
using icu4x::diplomat::replace_string_view_t = std::conditional_t< std::is_same_v< T, std::string_view >, capi::DiplomatStringView, T >
 
template<typename T >
using icu4x::diplomat::diplomat_c_span_convert_t = typename diplomat_c_span_convert< T >::type
 
template<typename T >
using icu4x::diplomat::replace_fn_t = diplomat_c_span_convert_t< replace_string_view_t< as_ffi_t< T > > >
 Replace the argument types from the std::function with the argument types for th function pointer.
 

Functions

bool icu4x::diplomat::_grow_impl (capi::DiplomatWrite *w, uintptr_t requested)
 
template<typename T >
icu4x::diplomat::fn_trait_helpers::replace (replace_fn_t< T > val)
 
template<typename T >
replace_fn_t< T > icu4x::diplomat::fn_trait_helpers::replace_ret (T val)
 
template<typename TOut , typename T >
TOut icu4x::diplomat::fn_trait_helpers::replace_optional_ret (std::optional< T > optional)
 
template<class T >
 icu4x::diplomat::fn_traits (T) -> fn_traits< T >
 
template<typename T , typename U = typename inner<T>::type>
const U icu4x::diplomat::get_inner_if_present (T v)
 

Variables

constexpr size_t icu4x::diplomat::dynamic_extent = std::numeric_limits<std::size_t>::max()
 
template<typename T >
constexpr bool icu4x::diplomat::is_unique_ptr_v = is_unique_ptr<T>::value
 
template<typename T >
constexpr bool icu4x::diplomat::is_optional_v = is_optional<T>::value
 
template<typename T >
constexpr bool icu4x::diplomat::has_next_v = has_next<T>::value
 

Macro Definition Documentation

◆ DIPLOMAT_LIFETIME_BOUND

#define DIPLOMAT_LIFETIME_BOUND

◆ MAKE_SLICE_CONVERTERS

#define MAKE_SLICE_CONVERTERS (   name,
  c_ty 
)
Value:
template<typename T> \
struct diplomat_c_span_convert<T, std::enable_if_t<std::is_same_v<T, span<const c_ty>>>> { \
using type = diplomat::capi::Diplomat##name##View; \
}; \
template<typename T> \
struct diplomat_c_span_convert<T, std::enable_if_t<std::is_same_v<T, span<c_ty>>>> { \
using type = diplomat::capi::Diplomat##name##ViewMut; \
}; \

◆ MAKE_SLICES

#define MAKE_SLICES (   name,
  c_ty 
)
Value:
typedef struct Diplomat##name##View { \
const c_ty* data; \
size_t len; \
} Diplomat##name##View; \
typedef struct Diplomat##name##ViewMut { \
c_ty* data; \
size_t len; \
} Diplomat##name##ViewMut; \
typedef struct Diplomat##name##Array { \
const c_ty* data; \
size_t len; \
} Diplomat##name##Array;

◆ MAKE_SLICES_AND_OPTIONS

#define MAKE_SLICES_AND_OPTIONS (   name,
  c_ty 
)
Value:
MAKE_SLICES(name, c_ty) \
typedef struct Option##name {union { c_ty ok; }; bool is_ok; } Option##name; \
typedef struct Option##name##View {union { Diplomat##name##View ok; }; bool is_ok; } Option##name##View; \
typedef struct Option##name##ViewMut {union { Diplomat##name##ViewMut ok; }; bool is_ok; } Option##name##ViewMut; \
typedef struct Option##name##Array {union { Diplomat##name##Array ok; }; bool is_ok; } Option##name##Array; \
#define MAKE_SLICES(name, c_ty)
Definition diplomat_runtime.hpp:57