stateless_encode_result¶
-
template<typename _Input, typename _Output>
class ztd::text::stateless_encode_result¶ The result of all encode operations from encoding objects and higher-level calls (such as ztd_text_encode).
Subclassed by encode_result< _Input, _Output, _State >
Public Functions
-
template<typename _ArgInput, typename _ArgOutput>
inline constexpr stateless_encode_result(_ArgInput &&__input, _ArgOutput &&__output, encoding_error __error_code = encoding_error::ok) noexcept(noexcept(stateless_encode_result(::std::forward<_ArgInput>(__input), ::std::forward<_ArgOutput>(__output), __error_code, __error_code != encoding_error::ok)))¶ Constructs a ztd::text::encode_result, defaulting the error code to ztd::text::encoding_error::ok if not provided.
- Parameters
__input – [in] The input range to store.
__output – [in] The output range to store.
__error_code – [in] The error code for the decoding opertion, if any.
-
template<typename _ArgInput, typename _ArgOutput>
inline constexpr stateless_encode_result(_ArgInput &&__input, _ArgOutput &&__output, encoding_error __error_code, ::std::size_t __handled_errors) noexcept(::std::is_nothrow_constructible_v<_Input, _ArgInput> && ::std::is_nothrow_constructible_v<_Output, _ArgOutput>)¶ Constructs a ztd::text::encode_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.
__error_code – [in] The error code for the encode operation, if any.
__handled_errors – [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.
-
inline constexpr bool errors_were_handled() const noexcept¶
Whether or not any errors were handled.
- Returns
Simply checks whether
handled_errors
is greater than 0.
Public Members
-
_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 handled_errors¶
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.
-
template<typename _ArgInput, typename _ArgOutput>