std::wcsxfrm
Da cppreference.com.
![]() | Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate. La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
Elemento definito nell'header <cwchar> | ||
std::size_t strxfrm(constwchar_t* dest, constwchar_t* src, std::size_t count ); | ||
Trasforma la stringa null-terminated larga puntata da
src
nel nostro modulo di attuazione definiti in modo tale che confrontare due stringhe trasformate con std::wcscmp dà lo stesso risultato confrontando le stringhe originali con std::wcscoll, nella versione locale corrente 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.
You can help to correct and verify the translation. Click here for instructions.
I caratteri
count
prima della stringa trasformate vengono scritte destinazione, compreso il carattere nullo finale, e la lunghezza della stringa completa trasformata viene restituito, escluso il carattere nullo finale.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.
You can help to correct and verify the translation. Click here for instructions.
Se
count
è 0, allora dest
è permesso di essere un puntatore nullo.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.
You can help to correct and verify the translation. Click here for instructions.
Indice |
[modifica]Note
La lunghezza corretta del buffer che può ricevere l'intera stringa è trasformato 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.
You can help to correct and verify the translation. Click here for instructions.
[modifica]Parametri
dest | - | puntatore al primo elemento di un ampio stringa con terminazione null per scrivere la stringa trasformato 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 | - | puntatore alla stringa con terminazione null di caratteri estesi da trasformare 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 | - | numero massimo di caratteri da scrivere 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. |
[modifica]Valore di ritorno
La lunghezza della stringa trasformato largo, escluso il carattere di terminazione null-.
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.
You can help to correct and verify the translation. Click here for instructions.
[modifica]Esempio
#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';elsestd::wcout<< in2 <<" before "<< in1 <<'\n'; std::wcout<<"In lexicographical comparison: ";if(in1 < in2)std::wcout<< in1 <<" before "<< in2 <<'\n';elsestd::wcout<< in2 <<" before "<< in1 <<'\n'; }
Output:
In the Swedish locale: år before ängel In lexicographical comparison: ängel before år
[modifica]Vedi anche
trasformare una stringa in modo che strcmp produrrebbe lo stesso risultato 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. (funzione) | |
[virtuale] | trasforma una stringa in modo che confronto può essere sostituito da confronto 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. (virtuale protetto funzione of std::collate membro) |
confronta due stringhe larghe in accordo con i parametri locali 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. (funzione) | |
C documentation for wcsxfrm |