stateless_count_resultļƒ

template<typename _Input>
class stateless_count_resultļƒ

The result of counting operations (such as ztd_text_count_as_encoded and ztd_text_count_as_encoded) that specifically do not include a reference to the state.

Subclassed by count_result< _Input, _State >, count_transcode_result< _Input, _FromState, _ToState >

Public Functions

template<typename _ArgInput>
inline constexpr stateless_count_result(_ArgInput &&__input, ::std::size_t __count, encoding_error __error_code = encoding_error::ok)ļƒ

Constructs a ztd::text::stateless_count_result, defaulting the error code to ztd::text::encoding_error::ok if not provided.

Parameters
  • __input ā€“ [in] The input range to store.

  • __count ā€“ [in] The number of code points or code units successfully counted.

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

template<typename _ArgInput>
inline constexpr stateless_count_result(_ArgInput &&__input, ::std::size_t __count, encoding_error __error_code, ::std::size_t __handled_errors)ļƒ

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

Parameters
  • __input ā€“ [in] The input range to store.

  • __count ā€“ [in] The number of code points or code units successfully counted.

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

  • __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).

::std::size_t countļƒ

The number of code units or code points counted successfully, so far.

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.