Espacios de nombres
Variantes
Acciones

std::wcsxfrm

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

 
 
Strings biblioteca
Terminadas en nulo
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.
Cadenas de bytes
Multibyte cuerdas
Cadenas anchas
Clases
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
 
Terminadas en nulo de ancho
Funciones
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
De manipulación de caracteres
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.
Las conversiones a 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.
Cadena de manipulación
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.
Matriz de manipulación
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 la cadena terminada en nulo de ancho a la que apunta src en el formulario definido por la implantación de tal manera que comparar dos cadenas transformadas con std::wcscmp da el mismo resultado que la comparación de las cadenas originales con std::wcscoll, en la actual configuración regional C .
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.
Los caracteres count primero de la cadena transformada se escriben en destino, incluyendo el carácter nulo de terminación, y la longitud de la cadena completa transformada se devuelve, excluido el carácter nulo de terminación .
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.
Si count es 0, entonces dest se le permite ser un puntero 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.

Contenido

[editar] Notas

La longitud correcta del búfer que puede recibir toda la cadena transformada es 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 -
puntero al primer elemento de una amplia cadena terminada en nulo para escribir la cadena transformada a
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 -
puntero a la cadena de caracteres terminada en nulo gama de 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 de salida
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

La longitud de la cadena transformada de ancho, sin incluir la terminación nula caracteres .
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] Ejemplo

#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] Ver también

transformar una cadena para que strcmp produciría el mismo 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.

(función) [edit]
[virtual]
transforma una cadena para que intercalación puede ser sustituido por comparación
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.

(virtuales protegidos of std::collate miembro de función) [edit]
compara dos cadenas anchas, de acuerdo a la localización actual
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.

(función) [edit]
C documentation for wcsxfrm