default_handler

The default handler for all operations. A class type that simply wraps ztd::text::replacement_handler_t unless configured otherwise. You can change it to throw by default (NOT recommended) by using ZTD_TEXT_DEFAULT_HANDLER_THROWS.

Using this type, implicitly or explicitly, signals to ztd.text that you would like it to gently admonish you if any part of a conversion could be potentially lossy (valid data is put in, but it cannot be handled by the desired encode/decode/transcode operation).

constexpr default_handler_t ztd::text::default_handler = {}

An instance of the default_handler_t type for ease of use.

class ztd::text::default_handler_t : private replacement_handler_t

The default error handler for the entire library. Can be configured to use different strategies at build time. Without configuration, it defaults to the ztd::text::replacement_handler_t.

Public Types

using error_handler = __error_handler_base_t

The underlying error handler type.

Private Functions

template<typename _Encoding, typename _InputRange, typename _OutputRange, typename _State, typename _InputProgress, typename _OutputProgress>
inline constexpr auto operator()(const _Encoding &__encoding, encode_result<_InputRange, _OutputRange, _State> __result, const _InputProgress&, const _OutputProgress&) const noexcept

The function call for inserting replacement code units at the point of failure, before returning flow back to the caller of the encode operation.

Parameters
  • __encoding[in] The Encoding that experienced the error.

  • __result[in] The current state of the encode operation.

template<typename _Encoding, typename _InputRange, typename _OutputRange, typename _State, typename _InputProgress, typename _OutputProgress>
inline constexpr auto operator()(const _Encoding &__encoding, decode_result<_InputRange, _OutputRange, _State> __result, const _InputProgress&, const _OutputProgress&) const noexcept

The function call for inserting replacement code points at the point of failure, before returning flow back to the caller of the decode operation.

Parameters
  • __encoding[in] The Encoding that experienced the error.

  • __result[in] The current state of the encode operation.