◐ Shell
clean mode source ↗

std::wcsxfrm – cppreference.com

Aus cppreference.com

<metanoindex/>

<tbody> </tbody>

definiert in Header

<cwchar>

std::size_t strxfrm( const wchar_t* dest, const wchar_t* src, std::size_t count );

Verwandelt den nullterminierten breite String, auf den src in die Implementierung definiert Form, so dass den Vergleich zweier verwandelt Strings mit std::wcscmp das gleiche Ergebnis wie das Vergleichen der ursprünglichen Strings mit std::wcscoll in der aktuellen C locale .

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.

Die ersten count Zeichen des transformierten Kette sind Ziel geschrieben, einschließlich des abschließenden Null-Zeichen, und die Länge des vollständigen verwandelt String zurückgegeben, ohne das abschließende Nullzeichen .

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.

Wenn count ist 0, dann dest darf ein NULL-Zeiger sein .

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.

Notes

Die richtige Länge des Puffers, der den gesamten transformierten String empfangen kann 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.

Parameter

dest -

Zeiger auf das erste Element einer breiten nullterminierten String, um die transformierten Kette zu schreiben

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 -

Zeiger auf die null-terminierte breite Zeichenfolge zu verwandeln

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 -

maximale Anzahl von Zeichen ausgegeben

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.

Rückgabewert

Die Länge des transformierten breite string, ohne das abschließende Null-Zeichen .

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.

Beispiel

#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

Siehe auch

verwandeln einen String, so dass strcmp das gleiche Ergebnis wie strcoll erzeugen würde

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.


(Funktion) [edit]

[virtuell]

wandelt einen String, so dass collation durch Vergleich ersetzt werden können

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.


(virtuellen geschützten Member-Funktion of std::collate) [edit]

vergleicht zwei Wide-Strings in Übereinstimmung mit dem aktuellen Gebietsschema

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.


(Funktion) [edit]

C documentation for wcsxfrm