stateless_decode_resultļ
-
template<typename _Input, typename _Output>
class stateless_decode_resultļ The result of all decode operations from encoding objects and higher-level calls (such as ztd_text_decode).
Subclassed by decode_result< _Input, _Output, _State >
Public Functions
-
template<typename _ArgInput, typename _ArgOutput, ::std::enable_if_t<__txt_detail::__result_type_copy_constraint<::ztd::text::stateless_decode_result, _Input, _ArgInput, _Output, _ArgOutput>()>* = nullptr>
inline constexpr stateless_decode_result(const stateless_decode_result<_ArgInput, _ArgOutput> &__other) noexcept(__txt_detail::__result_type_copy_noexcept<::ztd::text::stateless_decode_result, _Input, _ArgInput, _Output, _ArgOutput>)ļ Constructs a ztd::text::decode_result with the provided parameters and information, including whether or not an error was handled.
- Parameters
__other ā [in] A different but related result type.
-
template<typename _ArgInput, typename _ArgOutput, ::std::enable_if_t<__txt_detail::__result_type_move_constraint<::ztd::text::stateless_decode_result, _Input, _ArgInput, _Output, _ArgOutput>()>* = nullptr>
inline constexpr stateless_decode_result(stateless_decode_result<_ArgInput, _ArgOutput> &&__other) noexcept(__txt_detail::__result_type_move_noexcept<::ztd::text::stateless_decode_result, _Input, _ArgInput, _Output, _ArgOutput>)ļ Constructs a ztd::text::decode_result with the provided parameters and information, including whether or not an error was handled.
- Parameters
__other ā [in] A different but related result type.
-
template<typename _ArgInput, typename _ArgOutput, typename _ArgState>
inline constexpr stateless_decode_result(_ArgInput &&__input, _ArgOutput &&__output, encoding_error __error_code = encoding_error::ok) noexcept(noexcept(stateless_decode_result(::std::forward<_ArgInput>(__input), ::std::forward<_ArgOutput>(__output), __error_code, __error_code != encoding_error::ok)))ļ Constructs a ztd::text::decode_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_decode_result(_ArgInput &&__input, _ArgOutput &&__output, encoding_error __error_code, ::std::size_t __error_count) noexcept(::std::is_nothrow_constructible_v<_Input, _ArgInput> && ::std::is_nothrow_constructible_v<_Output, _ArgOutput>)ļ Constructs a ztd::text::decode_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 decode operation, taken as the first of either the 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.
-
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
-
_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ļ
The number of times an error occurred in the processed input text.
-
template<typename _ArgInput, typename _ArgOutput, ::std::enable_if_t<__txt_detail::__result_type_copy_constraint<::ztd::text::stateless_decode_result, _Input, _ArgInput, _Output, _ArgOutput>()>* = nullptr>