* Try to read a UTF-8 character, and then advance reader. */
| 410 | * Try to read a UTF-8 character, and then advance reader. |
| 411 | */ |
| 412 | [[nodiscard]] std::optional<char32_t> TryReadUtf8() |
| 413 | { |
| 414 | auto [len, value] = this->PeekUtf8(); |
| 415 | if (len == 0) return std::nullopt; |
| 416 | this->Skip(len); |
| 417 | return value; |
| 418 | } |
| 419 | /** |
| 420 | * Read UTF-8 character, and advance reader. |
| 421 | * @param def Default value to return, if no valid data. |
no test coverage detected