Rune.DecodeLastFromUtf16(ReadOnlySpan<Char>, Rune, Int32) Método
Definição
public:
static System::Buffers::OperationStatus DecodeLastFromUtf16(ReadOnlySpan<char> source, [Runtime::InteropServices::Out] System::Text::Rune % result, [Runtime::InteropServices::Out] int % charsConsumed);
public static System.Buffers.OperationStatus DecodeLastFromUtf16 (ReadOnlySpan<char> source, out System.Text.Rune result, out int charsConsumed);
static member DecodeLastFromUtf16 : ReadOnlySpan<char> * Rune * int -> System.Buffers.OperationStatus
Public Shared Function DecodeLastFromUtf16 (source As ReadOnlySpan(Of Char), ByRef result As Rune, ByRef charsConsumed As Integer) As OperationStatus
Parâmetros
- source
- ReadOnlySpan<Char>
Um intervalo de caracteres codificados em UTF-16 somente leitura.A read-only UTF-16 encoded character span.
- result
- Rune
Quando este método é retornado, o símbolo decodificado.When this method returns, the decoded rune.
- charsConsumed
- Int32
Quando este método é retornado, o número de bytes lidos para criar o símbolo.When this method returns, the number of bytes read to create the rune.
Retornos
Done se o buffer de origem começar com um valor escalar codificado UTF-16 válido.Done if the source buffer begins with a valid UTF-16 encoded scalar value. result, então, contém o Rune decodificado e charsConsumed contém o número de valores Char usados no buffer de entrada para codificar o Rune.result then contains the decoded Rune, and charsConsumed contains the number of Char values used in the input buffer to encode the Rune.
NeedMoreData se o buffer de origem estiver vazio ou contiver apenas um caractere UTF-16 alternativo superior.NeedMoreData if the source buffer is empty or contains only a standalone UTF-16 high surrogate character. result, então, contém ReplacementChar, e charsConsumed contém o comprimento do buffer de entrada.result then contains ReplacementChar, and charsConsumed contains the length of the input buffer.
InvalidData se o buffer de origem começar com um valor escalar codificado em UTF-16 malformado.InvalidData if the source buffer begins with an ill-formed UTF-16 encoded scalar value. result, então, contém ReplacementChar, e charsConsumed contém o número de valores de Char usados para codificar a sequência malformada.result then contains ReplacementChar, and charsConsumed contains the number of Char values used to encode the ill-formed sequence.
..
Comentários
Esse método é muito semelhante a DecodeFromUtf16(ReadOnlySpan<Char>, Rune, Int32) , exceto pelo fato de que ele permite que o chamador execute um loop para trás em vez de encaminhar.This method is very similar to DecodeFromUtf16(ReadOnlySpan<Char>, Rune, Int32), except it allows the caller to loop backward instead of forward. A Convenção de chamada típica é que, em cada iteração do loop, o chamador deve dividir os charsConsumed elementos finais do source buffer.The typical calling convention is that on each iteration of the loop, the caller should slice off the final charsConsumed elements of the source buffer.