名前空間
変種
操作

std::wcsxfrm

提供: cppreference.com
< cpp‎ | string‎ | wide

 
 
ストリングスライブラリ
NULLで終わる文字列
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.
バイト文字列
文字列をマルチバイト
ワイド文字列
クラス
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
 
nullで終了するワイド文字列
機能します
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
文字操作
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.
数値形式への変換
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.
文字列操作
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.
配列操作
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 );
srcを持つ2つの変換された文字列を比較すると、現在のCロケールで、std::wcscmpで元の文字列を比較するのと同じ結果を与えるような実装で定義された形式にstd::wcscollが指すNULLで終わるワイド文字列を変換します.
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.
変換された文字列の最初のcount文字が終端のNULL文字を含む、先に書き込まれており、完全な変換された文字列の長さは、終端のNULL文字を除く、返された.
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.
count0であれば、destはNULLポインタであることが許可されている.
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.

目次

[編集] ノート

全体の変換された文字列を受け取ることができるバッファの正しい長さが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.

[編集] パラメータ

dest -
に変換された文字列を書き込むための広い、NULLで終わる文字列の最初の要素へのポインタ
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 -
変換する、NULLで終了するワイド文字列へのポインタ
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 -
出力する最大文字数
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.

[編集] 値を返します

終端の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.

[編集]

#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

[編集] も参照してください

strcmp関数は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.

(関数) [edit]
その照合は比較に置き換えることができるように文字列を変換します
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.

(仮想protectedメンバ関数of std::collate) [edit]
現在のロケールに基づいて、2つのワイド文字列を比較します
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.

(関数) [edit]
C documentation for wcsxfrm