Espaços nominais
Variantes
Acções

std::wcsxfrm

Da cppreference.com
< cpp‎ | string‎ | wide

 
 
Biblioteca cordas
Strings terminadas
Original:
Null-terminated strings
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Cadeias de bytes
Multibyte cordas
Cordas de largura
Classes
Original:
Classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_string
char_traits
 
Strings terminadas largura
Funções
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Manipulação personagem
Original:
Character manipulation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Conversões para formatos numéricos
Original:
Conversions to numeric formats
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Manipulação de cadeia
Original:
String manipulation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Manipulação matriz
Original:
Array manipulation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
wmemcpy
wmemmove
wmemcmp
wmemchr
wmemset
 
Defined in header <cwchar>
std::size_t strxfrm( const wchar_t* dest, const wchar_t* src, std::size_t count );
Transforma a string terminada em null gama apontado por src na forma definida pela implementação de tal forma que comparar duas cadeias transformadas com std::wcscmp dá o mesmo resultado que comparando as cordas originais com std::wcscoll, na localidade C atual.
Original:
Transforms the null-terminated wide string pointed to by src into the implementation-defined form such that comparing two transformed strings with std::wcscmp gives the same result as comparing the original strings with std::wcscoll, in the current C locale.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Os personagens count primeiro da cadeia transformado são escritas para o destino, incluindo o caractere nulo de terminação, eo comprimento da corda cheia transformado é devolvido, excluindo o caractere nulo de terminação.
Original:
The first count characters of the transformed string are written to destination, including the terminating null character, and the length of the full transformed string is returned, excluding the terminating null character.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Se count é 0, então dest é permitido ser um ponteiro nulo.
Original:
If count is 0, then dest is allowed to be a null pointer.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Índice

[editar] Notas

O comprimento correto do buffer que pode receber toda a cadeia transformada é 1+std::wcsxfrm(NULL, src, 0)
Original:
The correct length of the buffer that can receive the entire transformed string is 1+std::wcsxfrm(NULL, src, 0)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Parâmetros

dest -
ponteiro para o primeiro elemento de uma string terminada em null larga para escrever a seqüência transformada
Original:
pointer to the first element of a wide null-terminated string to write the transformed string to
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
src -
ponteiro para a cadeia de caracteres terminada em nulo ampla para transformar
Original:
pointer to the null-terminated wide character string to transform
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
count -
número máximo de caracteres para a saída
Original:
maximum number of characters to output
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Valor de retorno

O comprimento da corda transformada de largura, não incluindo o caractere nulo de terminação-.
Original:
The length of the transformed wide string, not including the terminating null-character.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Exemplo

#include <iostream>
#include <cwchar>
 
int main()
{
    std::setlocale(LC_ALL, "sv_SE.utf8");
 
    std::wstring in1 = L"\u00e5r";
    std::wstring out1(1+std::wcsxfrm(nullptr, in1.c_str(), 0), L' ');
    std::wstring in2 = L"\u00e4ngel";
    std::wstring out2(1+std::wcsxfrm(nullptr, in2.c_str(), 0), L' ');
 
    std::wcsxfrm(&out1[0], in1.c_str(), out1.size());
    std::wcsxfrm(&out2[0], in2.c_str(), out2.size());
 
    std::wcout << "In the Swedish locale: ";
    if(out1 < out2)
         std::wcout << in1 << " before " << in2 << '\n';
    else
         std::wcout << in2 << " before " << in1 << '\n';
 
    std::wcout << "In lexicographical comparison: ";
    if(in1 < in2)
         std::wcout << in1 << " before " << in2 << '\n';
    else
         std::wcout << in2 << " before " << in1 << '\n';
 
}

Output:

In the Swedish locale: år before ängel
In lexicographical comparison: ängel before år

[editar] Veja também

transformar uma string para que strcmp produziria o mesmo resultado que strcoll
Original:
transform a string so that strcmp would produce the same result as strcoll
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(função) [edit]
[virtual]
transforma uma cadeia de caracteres de modo a que agrupamento pode ser substituído por comparação
Original:
transforms a string so that collation can be replaced by comparison
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(virtual protegido of std::collate função de membro) [edit]
compara duas seqüências de largura, de acordo com a localidade
Original:
compares two wide strings in accordance to the current locale
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(função) [edit]
C documentation for wcsxfrm