std::ctype<CharT>:: scan_not, std::ctype<CharT>:: do_scan_not
From cppreference.net
C++
Text processing library
| Localization library | |||||||||||||||||||||||||
| Regular expressions library (C++11) | |||||||||||||||||||||||||
| Formatting library (C++20) | |||||||||||||||||||||||||
| Null-terminated sequence utilities | |||||||||||||||||||||||||
| Byte strings | |||||||||||||||||||||||||
| Multibyte strings | |||||||||||||||||||||||||
| Wide strings | |||||||||||||||||||||||||
| Primitive numeric conversions | |||||||||||||||||||||||||
|
|||||||||||||||||||||||||
| Text encoding identifications | |||||||||||||||||||||||||
|
|||||||||||||||||||||||||
Localization library
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::ctype
| Member functions | ||||
|
ctype::scan_not
ctype::do_scan_not
|
||||
| Member functions of ctype<char> | ||||
|
헤더 파일에 정의됨
<locale>
|
||
|
public
:
const CharT * scan_not ( mask m, const CharT * beg, const CharT * end ) const ; |
(1) | |
|
protected
:
virtual const CharT * do_scan_not ( mask m, const CharT * beg, const CharT * end ) const ; |
(2) | |
1)
Public 멤버 함수로서, 가장 파생된 클래스의 protected virtual 멤버 함수
do_scan_not
를 호출합니다.
2)
문자 배열
[
beg
,
end
)
에서 분류 마스크
m
를 만족하지 않는 첫 번째 문자를 찾습니다. 즉,
is
(
m, c
)
가
false
를 반환하는 첫 번째 문자
c
를 찾습니다.
목차 |
매개변수
| m | - | 검색할 마스크 |
| beg | - | 검색할 문자 배열의 첫 번째 문자를 가리키는 포인터 |
| end | - | 검색할 문자 배열의 끝 다음을 가리키는 포인터 |
반환값
마스크를 만족하지 않는 첫 번째 문자에 대한 포인터를
[
beg
,
end
)
범위 내에서 반환합니다. 해당 문자가 없는 경우
end
를 반환합니다.
예제
이 코드 실행
#include <clocale> #include <iostream> #include <iterator> #include <locale> int main() { std::setlocale(LC_ALL, "en_US.utf8"); std::wcout.imbue(std::locale("en_US.utf8")); auto& f = std::use_facet<std::ctype<wchar_t>>(std::wcout.getloc()); // 선행 공백 건너뛰기 wchar_t s1[] = L" \t\t\n Кошка"; const wchar_t* p1 = f.scan_not(std::ctype_base::space, std::begin(s1), std::end(s1)); std::wcout << '\'' << p1 << "'\n"; // 선행 숫자 건너뛰기 wchar_t s2[] = L"123456789ネプネプ"; const wchar_t* p2 = f.scan_not(std::ctype_base::digit, std::begin(s2), std::end(s2)); std::wcout << '\'' << p2 << "'\n"; }
출력:
'Кошка' 'ネプネプ'
참고 항목
|
주어진 분류에 실패하는 시퀀스 내 첫 번째 문자를 찾으며, 분류 테이블을 사용합니다
(
std::ctype
<char>
의 public member function)
|
|
|
[virtual]
|
주어진 분류를 따르는 시퀀스 내 첫 번째 문자를 찾습니다
(virtual protected member function) |