transcode_result

template<typename _Input, typename _Output, typename _FromState, typename _ToState, typename _Pivot>
class transcode_result : public ztd::text::pivotless_transcode_result<_Input, _Output, _FromState, _ToState>

The result of low-level transcoding operations (such as ztd::text::transcode_into with the pivot provided as an argument).

Public Functions

template<typename _ArgInput, typename _ArgOutput, typename _ArgFromState, typename _ArgToState, typename _ArgPivot, ::std::enable_if_t<__txt_detail::__result_type_copy_constraint<::ztd::text::transcode_result, _Input, _ArgInput, _Output, _ArgOutput, _FromState, _ArgFromState, _ToState, _ArgToState, _Pivot, _ArgPivot>()>* = nullptr>
inline constexpr transcode_result(const transcode_result<_ArgInput, _ArgOutput, _ArgFromState, _ArgToState, _ArgPivot> &__other) noexcept(__txt_detail::__result_type_copy_noexcept<::ztd::text::transcode_result, _Input, _ArgInput, _Output, _ArgOutput, _FromState, _ArgFromState, _ToState, _ArgToState, _Pivot, _ArgPivot>())

Constructs a ztd::text::pivotless_transcode_result from a previous pivotless_transcode_result.

Parameters:

__other – [in] A different but related result type.

template<typename _ArgInput, typename _ArgOutput, typename _ArgFromState, typename _ArgToState, typename _ArgPivot, ::std::enable_if_t<__txt_detail::__result_type_move_constraint<::ztd::text::transcode_result, _Input, _ArgInput, _Output, _ArgOutput, _FromState, _ArgFromState, _ToState, _ArgToState, _Pivot, _ArgPivot>()>* = nullptr>
inline constexpr transcode_result(transcode_result<_ArgInput, _ArgOutput, _ArgFromState, _ArgToState, _ArgPivot> &&__other) noexcept(__txt_detail::__result_type_move_noexcept<::ztd::text::transcode_result, _Input, _ArgInput, _Output, _ArgOutput, _FromState, _ArgFromState, _ToState, _ArgToState, _Pivot, _ArgPivot>())

Constructs a ztd::text::pivotless_transcode_result from a previous pivotless_transcode_result.

Parameters:

__other – [in] A different but related result type.

template<typename _ArgInput, typename _ArgOutput, typename _ArgFromState, typename _ArgToState, typename _ArgPivot>
inline constexpr transcode_result(_ArgInput &&__input, _ArgOutput &&__output, _ArgFromState &&__from_state, _ArgToState &&__to_state, encoding_error __error_code, ::std::size_t __error_count, _ArgPivot &&__pivot, encoding_error __pivot_error_code, ::std::size_t __pivot_error_count)

Constructs a ztd::text::pivotless_transcode_result with the provided parameters and information, including whether or not an error was handled.

Parameters:
  • __input – [in] The input range to store.

  • __output – [in] The output range to store.

  • __from_state – [in] The state related to the β€œFrom Encoding” that performed the decode half of the operation.

  • __to_state – [in] The state related to the β€œTo Encoding” that performed the encode half of the operation.

  • __error_code – [in] The error code for the transcode operation, taken as the first of either the encode or decode operation that failed.

  • __error_count – [in] Whether or not an error was handled. Some error handlers are corrective (see ztd::text::replacement_handler_t), and so the error code is not enough to determine if the handler was invoked. This allows the value to be provided directly when constructing this result type.

  • __pivot – [in] The pivot for this transcode operation.

  • __pivot_error_code – [in] The error code for the decode step of the transcode oepration, if it failed.

  • __pivot_error_count – [in] Whether or not an error was handled during the decode step of the transcode operation. Some error handlers are corrective (see ztd::text::replacement_handler_t), and so the error code is not enough to determine if the handler was invoked. This allows the value to be provided directly when constructing this result type.

inline constexpr bool errors_were_handled() const noexcept

Whether or not any errors were handled.

Returns:

Simply checks whether error_count is greater than 0.

Public Members

_Pivot pivot

The range used to hold the intermediate pivot transcoding units.

encoding_error pivot_error_code

The kind of error that occured, if any, for the intermediate pivot.

::std::size_t pivot_error_count

Whether or not the error handler for the pivot point was invoked, regardless of if the pivot_error_code is set or not set to ztd::text::encoding_error::ok.

::ztd::reference_wrapper<_FromState> from_state

A reference to the state of the associated Encoding used for decoding input code units to intermediate code points.

::ztd::reference_wrapper<_ToState> to_state

A reference to the state of the associated Encoding used for encoding intermediate code points to code units.

_Input input

The reconstructed input_view object, with its .begin() incremented by the number of code units successfully read (can be identical to .begin() on original range on failure).

_Output output

The reconstructed output_view object, with its .begin() incremented by the number of code units successfully written (can be identical to .begin() on original range on failure).

encoding_error error_code

The kind of error that occured, if any.

::std::size_t error_count

Whether or not the error handler was invoked, regardless of if the error_code is set or not set to ztd::text::encoding_error::ok.