名前空間
変種
操作

std::towctrans

提供: 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 <cwctype>
std::wint_t towctrans( std::wint_t wc, std::wctrans_t desc );
マップワイド文字wcdescによって識別現在のCのロケールのLC_CTYPEカテゴリのマッピングを使用して.
Original:
Maps the wide character wc using the current C locale's LC_CTYPE mapping category identified by desc.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

目次

[編集] パラメータ

ch -
マップへのワイド文字
Original:
the wide character to map
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
desc -
std::wctrans呼び出しで得られLC_CTYPEマッピング
Original:
the LC_CTYPE mapping, obtained from a call to std::wctrans
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] 値を返します

現在のCのロケールのLC_CTYPEファセットにchによって識別マッピングを使用してdescのマッピングされた値.
Original:
The mapped value of ch using the mapping identified by desc in LC_CTYPE facet of 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.

[編集]

次の例では、ひらがな文字へのマッピングはカタカナを示しています
Original:
The following example demonstrates katakana to hiragana character mapping
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

#include <clocale>
#include <cwctype>
#include <iostream>
#include <algorithm>
 
std::wstring tohira(std::wstring str)
{
    std::transform(str.begin(), str.end(), str.begin(), [](wchar_t c) {
         return std::towctrans(c, std::wctrans("tojhira"));
    });
    return str;
}
 
int main()
{
    std::setlocale(LC_ALL, "ja_JP.UTF-8");
    std::wstring kana = L"ヒラガナ";
    std::wcout << "katakana characters " << kana
               << " are " << tohira(kana) << " in hiragana\n";
}

Output:

katakana characters ヒラガナ are ひらがな in hiragana

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

現在のCロケールで文字マッピングカテゴリを検索します
Original:
looks up a character mapping category 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.

(機能) [edit]
C documentation for towctrans