-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
746 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# cctype | ||
* cctype[meta header] | ||
|
||
`<cctype>`ヘッダでは、文字の種別判定関数と変換関数を定義する。これは、C言語の標準ライブラリ`<ctype.h>`と同じである。 | ||
|
||
全ての関数で、文字は`int`型で表される。 | ||
また、全ての関数はロケールの影響を受ける。 | ||
|
||
## 判定関数 | ||
|
||
| 名前 | 説明 | 対応バージョン | | ||
|------|------|----------------| | ||
| [`isalnum`](cctype/isalnum.md) | 文字が英数字であるかを判定する | | | ||
| [`isalpha`](cctype/isalpha.md) | 文字が英文字であるかを判定する | | | ||
| [`isblank`](cctype/isblank.md) | 文字が空白文字であるかを判定する | C++11 | | ||
| [`iscntrl`](cctype/iscntrl.md) | 文字が制御文字であるかを判定する | | | ||
| [`isdigit`](cctype/isdigit.md) | 文字が数字であるかを判定する | | | ||
| [`isgraph`](cctype/isgraph.md) | 文字が図表文字であるかを判定する | | | ||
| [`islower`](cctype/islower.md) | 文字が小文字であるかを判定する | | | ||
| [`isprint`](cctype/isprint.md) | 文字が表示文字であるかを判定する | | | ||
| [`ispunct`](cctype/ispunct.md) | 文字が区切り文字であるかを判定する | | | ||
| [`isspace`](cctype/isspace.md) | 文字が空白文字であるかを判定する | | | ||
| [`isupper`](cctype/isupper.md) | 文字が大文字であるかを判定する | | | ||
| [`isxdigit`](cctype/isxdigit.md) | 文字が16進数字であるかを判定する | | | ||
|
||
|
||
## 変換関数 | ||
|
||
| 名前 | 説明 | 対応バージョン | | ||
|------|------|----------------| | ||
| [`tolower`](cctype/tolower.md) | 文字を小文字に変換する | | | ||
| [`toupper`](cctype/toupper.md) | 文字を大文字に変換する | | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# isalnum | ||
* cctype[meta header] | ||
* std[meta namespace] | ||
* function[meta id-type] | ||
|
||
```cpp | ||
namespace std { | ||
int isalnum(int ch); | ||
} | ||
``` | ||
## 概要 | ||
`ch` が英数字かどうかを判定する(判定はロケールの影響を受ける)。 | ||
## 戻り値 | ||
`ch` が英数字と判定されれば非ゼロを、そうでなければゼロを返す。 | ||
## 例 | ||
```cpp example | ||
#include <cctype> | ||
#include <iostream> | ||
int main() { | ||
std::cout << "isalnum('A') = " << std::isalnum('A') << std::endl | ||
<< "isalnum('a') = " << std::isalnum('a') << std::endl | ||
<< "isalnum('Z') = " << std::isalnum('Z') << std::endl | ||
<< "isalnum('z') = " << std::isalnum('z') << std::endl | ||
<< "isalnum('3') = " << std::isalnum('3') << std::endl | ||
<< "isalnum('.') = " << std::isalnum('.') << std::endl | ||
<< "isalnum(' ') = " << std::isalnum(' ') << std::endl | ||
<< "isalnum('\\n') = " << std::isalnum('\n') << std::endl | ||
<< "isalnum('0x0f') = " << std::isalnum(15) << std::endl; | ||
} | ||
``` | ||
* std::isalnum[color ff0000] | ||
|
||
|
||
## 出力例 | ||
``` | ||
isalnum('A') = 8 | ||
isalnum('a') = 8 | ||
isalnum('Z') = 8 | ||
isalnum('z') = 8 | ||
isalnum('3') = 8 | ||
isalnum('.') = 0 | ||
isalnum(' ') = 0 | ||
isalnum('\n') = 0 | ||
isalnum('0x0f') = 0 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# isalpha | ||
* cctype[meta header] | ||
* std[meta namespace] | ||
* function[meta id-type] | ||
|
||
```cpp | ||
namespace std { | ||
int isalpha(int ch); | ||
} | ||
``` | ||
## 概要 | ||
`ch` が英文字かどうかを判定する(判定はロケールの影響を受ける)。 | ||
## 戻り値 | ||
`ch` が英文字と判定されれば非ゼロを、そうでなければゼロを返す。 | ||
## 例 | ||
```cpp example | ||
#include <cctype> | ||
#include <iostream> | ||
int main() { | ||
std::cout << "isalpha('A') = " << std::isalpha('A') << std::endl | ||
<< "isalpha('a') = " << std::isalpha('a') << std::endl | ||
<< "isalpha('Z') = " << std::isalpha('Z') << std::endl | ||
<< "isalpha('z') = " << std::isalpha('z') << std::endl | ||
<< "isalpha('3') = " << std::isalpha('3') << std::endl | ||
<< "isalpha('.') = " << std::isalpha('.') << std::endl | ||
<< "isalpha(' ') = " << std::isalpha(' ') << std::endl | ||
<< "isalpha('\\n') = " << std::isalpha('\n') << std::endl | ||
<< "isalpha('0x0f') = " << std::isalpha(15) << std::endl; | ||
} | ||
``` | ||
* std::isalpha[color ff0000] | ||
|
||
|
||
## 出力例 | ||
``` | ||
isalpha('A') = 1024 | ||
isalpha('a') = 1024 | ||
isalpha('Z') = 1024 | ||
isalpha('z') = 1024 | ||
isalpha('3') = 0 | ||
isalpha('.') = 0 | ||
isalpha(' ') = 0 | ||
isalpha('\n') = 0 | ||
isalpha('0x0f') = 0 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# isblank | ||
* cctype[meta header] | ||
* std[meta namespace] | ||
* function[meta id-type] | ||
* cpp11[meta cpp] | ||
|
||
```cpp | ||
namespace std { | ||
int isblank(int ch); | ||
} | ||
``` | ||
## 概要 | ||
`ch` が空白文字かどうかを判定する(判定はロケールの影響を受ける)。 | ||
## 戻り値 | ||
`ch` が空白文字と判定されれば非ゼロを、そうでなければゼロを返す。 | ||
## 例 | ||
```cpp example | ||
#include <cctype> | ||
#include <iostream> | ||
int main() { | ||
std::cout << "isblank('A') = " << std::isblank('A') << std::endl | ||
<< "isblank('a') = " << std::isblank('a') << std::endl | ||
<< "isblank('Z') = " << std::isblank('Z') << std::endl | ||
<< "isblank('z') = " << std::isblank('z') << std::endl | ||
<< "isblank('3') = " << std::isblank('3') << std::endl | ||
<< "isblank('.') = " << std::isblank('.') << std::endl | ||
<< "isblank(' ') = " << std::isblank(' ') << std::endl | ||
<< "isblank('\\n') = " << std::isblank('\n') << std::endl | ||
<< "isblank('0x0f') = " << std::isblank(15) << std::endl; | ||
} | ||
``` | ||
* std::isblank[color ff0000] | ||
|
||
|
||
## 出力例 | ||
``` | ||
isblank('A') = 0 | ||
isblank('a') = 0 | ||
isblank('Z') = 0 | ||
isblank('z') = 0 | ||
isblank('3') = 0 | ||
isblank('.') = 0 | ||
isblank(' ') = 1 | ||
isblank('\n') = 0 | ||
isblank('0x0f') = 0 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# iscntrl | ||
* cctype[meta header] | ||
* std[meta namespace] | ||
* function[meta id-type] | ||
|
||
```cpp | ||
namespace std { | ||
int iscntrl(int ch); | ||
} | ||
``` | ||
## 概要 | ||
`ch` が制御文字かどうかを判定する(判定はロケールの影響を受ける)。 | ||
## 戻り値 | ||
`ch` が制御文字と判定されれば非ゼロを、そうでなければゼロを返す。 | ||
## 例 | ||
```cpp example | ||
#include <cctype> | ||
#include <iostream> | ||
int main() { | ||
std::cout << "iscntrl('A') = " << std::iscntrl('A') << std::endl | ||
<< "iscntrl('a') = " << std::iscntrl('a') << std::endl | ||
<< "iscntrl('Z') = " << std::iscntrl('Z') << std::endl | ||
<< "iscntrl('z') = " << std::iscntrl('z') << std::endl | ||
<< "iscntrl('3') = " << std::iscntrl('3') << std::endl | ||
<< "iscntrl('.') = " << std::iscntrl('.') << std::endl | ||
<< "iscntrl(' ') = " << std::iscntrl(' ') << std::endl | ||
<< "iscntrl('\\n') = " << std::iscntrl('\n') << std::endl | ||
<< "iscntrl('0x0f') = " << std::iscntrl(15) << std::endl; | ||
} | ||
``` | ||
* std::iscntrl[color ff0000] | ||
|
||
|
||
## 出力例 | ||
``` | ||
iscntrl('A') = 0 | ||
iscntrl('a') = 0 | ||
iscntrl('Z') = 0 | ||
iscntrl('z') = 0 | ||
iscntrl('3') = 0 | ||
iscntrl('.') = 0 | ||
iscntrl(' ') = 0 | ||
iscntrl('\n') = 2 | ||
iscntrl('0x0f') = 2 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# isdigit | ||
* cctype[meta header] | ||
* std[meta namespace] | ||
* function[meta id-type] | ||
|
||
```cpp | ||
namespace std { | ||
int isdigit(int ch); | ||
} | ||
``` | ||
## 概要 | ||
`ch` が数字かどうかを判定する(判定はロケールの影響を受ける)。 | ||
## 戻り値 | ||
`ch` が数字と判定されれば非ゼロを、そうでなければゼロを返す。 | ||
## 例 | ||
```cpp example | ||
#include <cctype> | ||
#include <iostream> | ||
int main() { | ||
std::cout << "isdigit('A') = " << std::isdigit('A') << std::endl | ||
<< "isdigit('a') = " << std::isdigit('a') << std::endl | ||
<< "isdigit('Z') = " << std::isdigit('Z') << std::endl | ||
<< "isdigit('z') = " << std::isdigit('z') << std::endl | ||
<< "isdigit('3') = " << std::isdigit('3') << std::endl | ||
<< "isdigit('.') = " << std::isdigit('.') << std::endl | ||
<< "isdigit(' ') = " << std::isdigit(' ') << std::endl | ||
<< "isdigit('\\n') = " << std::isdigit('\n') << std::endl | ||
<< "isdigit('0x0f') = " << std::isdigit(15) << std::endl; | ||
} | ||
``` | ||
* std::isdigit[color ff0000] | ||
|
||
|
||
## 出力例 | ||
``` | ||
isdigit('A') = 0 | ||
isdigit('a') = 0 | ||
isdigit('Z') = 0 | ||
isdigit('z') = 0 | ||
isdigit('3') = 1 | ||
isdigit('.') = 0 | ||
isdigit(' ') = 0 | ||
isdigit('\n') = 0 | ||
isdigit('0x0f') = 0 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# isgraph | ||
* cctype[meta header] | ||
* std[meta namespace] | ||
* function[meta id-type] | ||
|
||
```cpp | ||
namespace std { | ||
int isgraph(int ch); | ||
} | ||
``` | ||
## 概要 | ||
`ch` が図表文字(空白を除く表示文字)かどうかを判定する(判定はロケールの影響を受ける)。 | ||
## 戻り値 | ||
`ch` が図表文字と判定されれば非ゼロを、そうでなければゼロを返す。 | ||
## 例 | ||
```cpp example | ||
#include <cctype> | ||
#include <iostream> | ||
int main() { | ||
std::cout << "isgraph('A') = " << std::isgraph('A') << std::endl | ||
<< "isgraph('a') = " << std::isgraph('a') << std::endl | ||
<< "isgraph('Z') = " << std::isgraph('Z') << std::endl | ||
<< "isgraph('z') = " << std::isgraph('z') << std::endl | ||
<< "isgraph('3') = " << std::isgraph('3') << std::endl | ||
<< "isgraph('.') = " << std::isgraph('.') << std::endl | ||
<< "isgraph(' ') = " << std::isgraph(' ') << std::endl | ||
<< "isgraph('\\n') = " << std::isgraph('\n') << std::endl | ||
<< "isgraph('0x0f') = " << std::isgraph(15) << std::endl; | ||
} | ||
``` | ||
* std::isgraph[color ff0000] | ||
|
||
|
||
## 出力例 | ||
``` | ||
isgraph('A') = 32768 | ||
isgraph('a') = 32768 | ||
isgraph('Z') = 32768 | ||
isgraph('z') = 32768 | ||
isgraph('3') = 32768 | ||
isgraph('.') = 32768 | ||
isgraph(' ') = 0 | ||
isgraph('\n') = 0 | ||
isgraph('0x0f') = 0 | ||
``` |
Oops, something went wrong.