std::wcsxfrm
De cppreference.com
![]() |
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
Déclaré dans l'en-tête <cwchar>
|
||
std::size_t strxfrm( const wchar_t* dest, const wchar_t* src, std::size_t count ); |
||
Transforme la chaîne se terminant par null large pointé par
src
dans la forme définie par l'implémentation de telle sorte que la comparaison de deux chaînes transformées avec std::wcscmp donne le même résultat que la comparaison des chaînes d'origine avec std::wcscoll, dans la locale courante 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.
Les caractères
count
première de la chaîne transformée de destination sont écrites, y compris le caractère nul final, et la longueur de la chaîne complète transformée est renvoyée, à l'exclusion du caractère nul final .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.
Si
count
est 0, puis dest
est autorisé à être un pointeur nul .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.
Sommaire |
[modifier] Notes
La bonne longueur de la mémoire tampon qui peut recevoir la chaîne entière est transformée 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.
[modifier] Paramètres
dest | - | pointeur vers le premier élément d'une largeur nulle à terminaison de chaîne pour écrire la chaîne transformée de
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 | - | pointeur vers la chaîne à zéro terminal de caractères larges à transformer
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 | - | Le nombre de caractères de sortie
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. |
[modifier] Retourne la valeur
La longueur de la chaîne transformée de large, non compris le caractère de fin 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.
[modifier] Exemple
#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'; }
Résultat :
In the Swedish locale: år before ängel In lexicographical comparison: ängel before år
[modifier] Voir aussi
transformer une chaîne de sorte que strcmp produirait le même résultat 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. (fonction) | |
[ virtuel ]Original: virtual The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
transforme une chaîne de classement de sorte que peut être remplacé par des comparaisons 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. (fonction membre virtuelle protégée de std::collate )
|
compare deux chaînes de large, conformément à la localisation en cours 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. (fonction) | |
C documentation for wcsxfrm
|