標準ライブラリヘッダー <cwchar>
From cppreference.com
このヘッダーは元々C標準ライブラリに<wchar.h>として含まれていました。
このヘッダーは、NULL終端のワイド文字列およびマルチバイト文字列ライブラリの一部です。また、いくつかのC形式のI/O関数と、C形式の日付からの変換を提供します。
目次 |
[編集] マクロ
| 処理系定義のヌルポインタ定数 (マクロ定数) | |
| WEOF |
エラーを示すために使用されるstd::wint_t型の非文字値(マクロ定数) |
| WCHAR_MIN |
wchar_tの最小有効値 (マクロ定数) |
| WCHAR_MAX |
wchar_tの最大有効値 (マクロ定数) |
[編集] 型
| マルチバイト文字列を走査するために必要な変換状態情報 (クラス) | |
| sizeof 演算子が返す符号無し整数型 (typedef) | |
wint_t
|
任意の有効なワイド文字と、少なくとももう1つの値を保持できる整数型 |
| カレンダー時間型 (クラス) |
[編集] 関数
文字列操作 | |
| あるワイド文字列を別のワイド文字列にコピーする (関数) | |
| ある文字列から別の文字列へ、指定された数のワイド文字をコピーする (関数) | |
| あるワイド文字列のコピーを別のワイド文字列に追加する (関数) | |
| あるワイド文字列から別のワイド文字列へ、指定された数のワイド文字を追加する (関数) | |
wcscmpがwcscollと同じ結果を生成するようにワイド文字列を変換する(関数) | |
文字列検査 | |
| ワイド文字列の長さを返す (関数) | |
| 2つのワイド文字列を比較する (関数) | |
| 2つのワイド文字列から指定された文字数を比較する (関数) | |
| 現在のロケールに従って2つのワイド文字列を比較する (関数) | |
| ワイド文字列内でワイド文字が最初に現れる場所を見つける (関数) | |
| ワイド文字列内でワイド文字が最後に現れる場所を見つける (関数) | |
| 以下から成る最大の初期セグメントの長さを返す 別のワイド文字列に含まれるワイド文字のみからなる (関数) | |
| 以下から成る最大の初期セグメントの長さを返す 別のワイド文字列に含まれないワイド文字のみからなる (関数) | |
| あるワイド文字列に含まれるいずれかのワイド文字が、別のワイド文字列内で最初に現れる場所を見つける (関数) | |
| あるワイド文字列内で、別のワイド文字列が最初に現れる場所を見つける (関数) | |
| ワイド文字列内の次のトークンを見つける (関数) | |
ワイド文字配列の操作 | |
| オーバーラップしていない2つの配列間で、指定された数のワイド文字をコピーする (関数) | |
| オーバーラップしている可能性のある2つの配列間で、指定された数のワイド文字をコピーする (関数) | |
| 2つの配列から指定された数のワイド文字を比較する (関数) | |
| ワイド文字配列内でワイド文字が最初に現れる場所を見つける (関数) | |
| 与えられたワイド文字をワイド文字配列のすべての位置にコピーする (関数) | |
マルチバイト/ワイド文字変換 | |
| std::mbstate_t オブジェクトが初期シフト状態を表しているか確認する (関数) | |
| 可能であれば、1バイトのナロー文字をワイド文字にワイド化する (関数) | |
| 可能であれば、ワイド文字を1バイトのナロー文字にナロー化する (関数) | |
| 与えられた状態で、次のマルチバイト文字のバイト数を返す (関数) | |
| 与えられた状態で、次のマルチバイト文字をワイド文字に変換する (関数) | |
| 与えられた状態で、ワイド文字をそのマルチバイト表現に変換する (関数) | |
| 与えられた状態で、ナローマルチバイト文字列をワイド文字列に変換する (関数) | |
| 与えられた状態で、ワイド文字列をナローマルチバイト文字列に変換する (関数) | |
入出力 | |
| ファイルストリームから1ワイド文字を取得する (関数) | |
| ファイルストリームからワイド文字列を取得する (関数) | |
| ファイルストリームに1ワイド文字を書き込む (関数) | |
| ファイルストリームにワイド文字列を書き込む (関数) | |
| stdinからワイド文字を読み込む (関数) | |
| stdoutにワイド文字を書き込む (関数) | |
| ファイルストリームに1ワイド文字を戻す (関数) | |
| ファイルストリームをワイド文字I/Oとナロー文字I/Oの間で切り替える (関数) | |
| stdin、ファイルストリーム、またはバッファから書式付きワイド文字入力を読み込む (関数) | |
| (C++11)(C++11)(C++11) |
stdin、ファイルストリームから書式付きワイド文字入力を読み込む または可変長引数リストを使用してバッファから (関数) |
| stdout、ファイルストリーム、またはバッファに書式付きワイド文字出力を書き込む (関数) | |
| stdout、ファイルストリームに書式付きワイド文字出力を書き込む または可変長引数リストを使用してバッファから (関数) | |
文字列変換 | |
| std::tmオブジェクトをカスタムワイド文字列のテキスト表現に変換する (関数) | |
| ワイド文字列を整数値に変換する (関数) | |
| ワイド文字列を符号なし整数値に変換する (関数) | |
| ワイド文字列を浮動小数点数値に変換する (関数) | |
[編集] 備考
- NULL は以下のヘッダーでも定義されています。
- std::size_t は以下のヘッダーでも定義されています。
-
std::wint_tは以下のヘッダーでも定義されています - std::tmは以下のヘッダーでも定義されています
[編集] 概要
namespace std { using size_t = /* see description */; // freestanding using mbstate_t = /* see description */; // freestanding using wint_t = /* see description */; // freestanding struct tm; int fwprintf(FILE* stream, const wchar_t* format, ...); int fwscanf(FILE* stream, const wchar_t* format, ...); int swprintf(wchar_t* s, size_t n, const wchar_t* format, ...); int swscanf(const wchar_t* s, const wchar_t* format, ...); int vfwprintf(FILE* stream, const wchar_t* format, va_list arg); int vfwscanf(FILE* stream, const wchar_t* format, va_list arg); int vswprintf(wchar_t* s, size_t n, const wchar_t* format, va_list arg); int vswscanf(const wchar_t* s, const wchar_t* format, va_list arg); int vwprintf(const wchar_t* format, va_list arg); int vwscanf(const wchar_t* format, va_list arg); int wprintf(const wchar_t* format, ...); int wscanf(const wchar_t* format, ...); wint_t fgetwc(FILE* stream); wchar_t* fgetws(wchar_t* s, int n, FILE* stream); wint_t fputwc(wchar_t c, FILE* stream); int fputws(const wchar_t* s, FILE* stream); int fwide(FILE* stream, int mode); wint_t getwc(FILE* stream); wint_t getwchar(); wint_t putwc(wchar_t c, FILE* stream); wint_t putwchar(wchar_t c); wint_t ungetwc(wint_t c, FILE* stream); double wcstod(const wchar_t* nptr, wchar_t** endptr); float wcstof(const wchar_t* nptr, wchar_t** endptr); long double wcstold(const wchar_t* nptr, wchar_t** endptr); long int wcstol(const wchar_t* nptr, wchar_t** endptr, int base); long long int wcstoll(const wchar_t* nptr, wchar_t** endptr, int base); unsigned long int wcstoul(const wchar_t* nptr, wchar_t** endptr, int base); unsigned long long int wcstoull(const wchar_t* nptr, wchar_t** endptr, int base); wchar_t* wcscpy(wchar_t* s1, const wchar_t* s2); // freestanding wchar_t* wcsncpy(wchar_t* s1, const wchar_t* s2, size_t n); // freestanding wchar_t* wmemcpy(wchar_t* s1, const wchar_t* s2, size_t n); // freestanding wchar_t* wmemmove(wchar_t* s1, const wchar_t* s2, size_t n); // freestanding wchar_t* wcscat(wchar_t* s1, const wchar_t* s2); // freestanding wchar_t* wcsncat(wchar_t* s1, const wchar_t* s2, size_t n); // freestanding int wcscmp(const wchar_t* s1, const wchar_t* s2); // freestanding int wcscoll(const wchar_t* s1, const wchar_t* s2); int wcsncmp(const wchar_t* s1, const wchar_t* s2, size_t n); // freestanding size_t wcsxfrm(wchar_t* s1, const wchar_t* s2, size_t n); int wmemcmp(const wchar_t* s1, const wchar_t* s2, size_t n); // freestanding const wchar_t* wcschr(const wchar_t* s, wchar_t c); // freestanding wchar_t* wcschr(wchar_t* s, wchar_t c); // freestanding size_t wcscspn(const wchar_t* s1, const wchar_t* s2); // freestanding const wchar_t* wcspbrk(const wchar_t* s1, const wchar_t* s2); // freestanding wchar_t* wcspbrk(wchar_t* s1, const wchar_t* s2); // freestanding const wchar_t* wcsrchr(const wchar_t* s, wchar_t c); // freestanding wchar_t* wcsrchr(wchar_t* s, wchar_t c); // freestanding size_t wcsspn(const wchar_t* s1, const wchar_t* s2); // freestanding const wchar_t* wcsstr(const wchar_t* s1, const wchar_t* s2); // freestanding wchar_t* wcsstr(wchar_t* s1, const wchar_t* s2); // freestanding wchar_t* wcstok(wchar_t* s1, const wchar_t* s2, wchar_t** ptr); // freestanding const wchar_t* wmemchr(const wchar_t* s, wchar_t c, size_t n); // freestanding wchar_t* wmemchr(wchar_t* s, wchar_t c, size_t n); // freestanding size_t wcslen(const wchar_t* s); // freestanding wchar_t* wmemset(wchar_t* s, wchar_t c, size_t n); // freestanding size_t wcsftime(wchar_t* s, size_t maxsize, const wchar_t* format, const tm* timeptr); wint_t btowc(int c); int wctob(wint_t c); // multibyte / wide string and character conversion functions int mbsinit(const mbstate_t* ps); size_t mbrlen(const char* s, size_t n, mbstate_t* ps); size_t mbrtowc(wchar_t* pwc, const char* s, size_t n, mbstate_t* ps); size_t wcrtomb(char* s, wchar_t wc, mbstate_t* ps); size_t mbsrtowcs(wchar_t* dst, const char** src, size_t len, mbstate_t* ps); size_t wcsrtombs(char* dst, const wchar_t** src, size_t len, mbstate_t* ps); } #define NULL /* see description */ // freestanding #define WCHAR_MAX /* see description */ // freestanding #define WCHAR_MIN /* see description */ // freestanding #define WEOF /* see description */ // freestanding
[編集] 欠陥報告
以下の動作変更を伴う欠陥報告が、以前に公開されたC++標準に遡って適用されました。
| DR | 適用対象 | 公開された動作 | 正しい動作 |
|---|---|---|---|
| LWG 345 | C++98 | std::tmは<cwchar>で提供されていませんでした |
提供された |