std:: basic_spanbuf
|
헤더 파일에 정의됨
<spanstream>
|
||
|
template
<
class
CharT,
|
(C++23부터) | |
std::basic_spanbuf
는
std::basic_streambuf
의 연관 문자 시퀀스가 메모리 상에 존재하는 임의의 문자 시퀀스로,
std::
span
<
CharT
>
인스턴스로부터 초기화되거나 해당 인스턴스로 제공될 수 있는 스트림 버퍼입니다.
std::basic_spanbuf
는 고정된 버퍼에서 I/O를 수행하므로, 기본 버퍼가 소진되었을 때 새로운 버퍼를 얻으려고 시도하지 않습니다.
일반적인 문자 타입에 대한 여러 typedef가 제공됩니다:
|
헤더 파일에 정의됨
<spanstream>
|
|
| 타입 | 정의 |
std::spanbuf
|
std :: basic_spanbuf < char > |
std::wspanbuf
|
std :: basic_spanbuf < wchar_t > |
목차 |
멤버 타입
| 멤버 타입 | 정의 |
char_type
|
CharT
|
traits_type
|
Traits
; 프로그램이 잘못된 경우 만약
Traits::char_type
이
CharT
가 아닐 때.
|
int_type
|
Traits::int_type
|
pos_type
|
Traits::pos_type
|
off_type
|
Traits::off_type
|
데이터 멤버
| 멤버 이름 | 정의 |
mod
(private)
|
열기 모드를 기록하는
std::ios_base::openmode
.
( 설명 전용 멤버 객체* ) |
buf
(private)
|
기본 버퍼를 참조하는
std::
span
<
CharT
>
.
( 설명 전용 멤버 객체* ) |
멤버 함수
Public 멤버 함수 |
|
basic_spanbuf
객체를 생성합니다
(public 멤버 함수) |
|
|
(destructor)
[virtual]
|
basic_spanbuf
객체를 소멸합니다
(virtual public 멤버 함수) |
basic_spanbuf
객체를 할당합니다
(public 멤버 함수) |
|
두 개의
basic_spanbuf
객체를 교환합니다
(public 멤버 함수) |
|
|
모드에 따라 내부 버퍼를 획득하거나 초기화합니다
(public 멤버 함수) |
|
Protected 멤버 함수 |
|
|
[virtual]
|
제어되는 문자 시퀀스를 배열로 교체하려고 시도합니다
(virtual protected 멤버 함수) |
|
[virtual]
|
상대 주소 지정을 사용하여 입력 시퀀스, 출력 시퀀스 또는 둘 모두에서 다음 포인터의 위치를 재조정합니다
(virtual protected 멤버 함수) |
|
[virtual]
|
절대 주소 지정을 사용하여 입력 시퀀스, 출력 시퀀스 또는 둘 모두에서 다음 포인터의 위치를 재조정합니다
(virtual protected 멤버 함수) |
비멤버 함수
|
(C++23)
|
std::swap
알고리즘을 특수화함
(함수 템플릿) |
std:: basic_streambuf 에서 상속됨
멤버 타입
| 멤버 타입 | 정의 |
char_type
|
CharT
|
traits_type
|
Traits
;
Traits::char_type
이
CharT
가 아닌 경우 프로그램은 ill-formed입니다.
|
int_type
|
Traits::int_type
|
pos_type
|
Traits::pos_type
|
off_type
|
Traits::off_type
|
멤버 함수
|
[virtual]
|
basic_streambuf
객체를 파괴함
(
std::basic_streambuf<CharT,Traits>
의
virtual public member function)
|
로케일 |
|
|
연결된 로케일을 변경하고
imbue
(
)
를 호출함
(
std::basic_streambuf<CharT,Traits>
의
public member function)
|
|
|
연결된 로케일의 사본을 얻음
(
std::basic_streambuf<CharT,Traits>
의
public member function)
|
|
위치 지정 |
|
|
setbuf
(
)
를 호출함
(
std::basic_streambuf<CharT,Traits>
의
public member function)
|
|
|
seekoff
(
)
를 호출함
(
std::basic_streambuf<CharT,Traits>
의
public member function)
|
|
|
seekpos
(
)
를 호출함
(
std::basic_streambuf<CharT,Traits>
의
public member function)
|
|
|
sync
(
)
를 호출함
(
std::basic_streambuf<CharT,Traits>
의
public member function)
|
|
읽기 영역 |
|
|
읽기 영역에서 즉시 사용 가능한 문자 수를 얻음
(
std::basic_streambuf<CharT,Traits>
의
public member function)
|
|
|
입력 시퀀스를 진행시킨 후, 다시 진행하지 않고 한 문자를 읽음
(
std::basic_streambuf<CharT,Traits>
의
public member function)
|
|
|
(C++17에서 제거됨)
|
입력 시퀀스에서 한 문자를 읽고 시퀀스를 진행시킴
(
std::basic_streambuf<CharT,Traits>
의
public member function)
|
|
입력 시퀀스에서 시퀀스를 진행시키지 않고 한 문자를 읽음
(
std::basic_streambuf<CharT,Traits>
의
public member function)
|
|
|
xsgetn
(
)
를 호출함
(
std::basic_streambuf<CharT,Traits>
의
public member function)
|
|
쓰기 영역 |
|
|
쓰기 영역에 한 문자를 쓰고 다음 포인터를 진행시킴
(
std::basic_streambuf<CharT,Traits>
의
public member function)
|
|
|
xsputn
(
)
를 호출함
(
std::basic_streambuf<CharT,Traits>
의
public member function)
|
|
되돌리기 |
|
|
입력 시퀀스에 한 문자를 되돌림
(
std::basic_streambuf<CharT,Traits>
의
public member function)
|
|
|
입력 시퀀스의 다음 포인터를 하나 뒤로 이동시킴
(
std::basic_streambuf<CharT,Traits>
의
public member function)
|
|
보호된 멤버 함수
basic_streambuf
객체를 생성합니다
(protected 멤버 함수) |
|
|
(C++11)
|
basic_streambuf
객체를 대체함
(보호된 멤버 함수) |
|
(C++11)
|
두 개의
basic_streambuf
객체를 교환
(보호된 멤버 함수) |
로케일 |
|
|
[virtual]
|
연결된 로캘 변경에 반응함
(
std::basic_streambuf<CharT,Traits>
의
가상 protected 멤버 함수)
|
포지셔닝 |
|
|
[virtual]
|
사용자 정의 배열로 버퍼를 교체합니다(허용되는 경우)
(
std::basic_streambuf<CharT,Traits>
의
virtual protected 멤버 함수)
|
|
[virtual]
|
입력 시퀀스, 출력 시퀀스 또는 둘 모두에서 다음 포인터를 상대 주소 지정을 사용하여 재위치합니다
(
std::basic_streambuf<CharT,Traits>
의
virtual protected member function)
|
|
[virtual]
|
입력 시퀀스, 출력 시퀀스 또는 둘 모두에서 다음 포인터를 절대 주소 지정을 사용하여 재위치합니다
(
std::basic_streambuf<CharT,Traits>
의
virtual protected 멤버 함수)
|
|
[virtual]
|
연관된 문자 시퀀스와 버퍼를 동기화합니다
(
std::basic_streambuf<CharT,Traits>
의
virtual protected 멤버 함수)
|
영역 가져오기 |
|
|
[virtual]
|
연결된 입력 시퀀스에서 사용 가능한 문자 수를 확인합니다(알려진 경우)
(
std::basic_streambuf<CharT,Traits>
의
virtual protected 멤버 함수)
|
|
[virtual]
|
연관된 입력 시퀀스에서 문자를 읽어 get 영역으로 가져옴
(
std::basic_streambuf<CharT,Traits>
의
virtual protected 멤버 함수)
|
|
[virtual]
|
연관된 입력 시퀀스로부터 문자를 읽어 get 영역으로 가져오고 다음 포인터를 전진시킴
(
std::basic_streambuf<CharT,Traits>
의
virtual protected 멤버 함수)
|
|
[virtual]
|
입력 시퀀스에서 여러 문자를 읽어옴
(
std::basic_streambuf<CharT,Traits>
의
virtual protected 멤버 함수)
|
|
get 영역의 시작, 현재 문자 및 끝에 대한 포인터를 반환합니다
(protected 멤버 함수) |
|
|
입력 시퀀스의 다음 포인터를 전진시킴
(protected member function) |
|
|
입력 시퀀스의 시작, 다음, 끝 포인터 위치를 재설정합니다
(protected member function) |
|
Put 영역 |
|
|
[virtual]
|
출력 시퀀스에 여러 문자를 기록합니다
(
std::basic_streambuf<CharT,Traits>
의
가상 protected 멤버 함수)
|
|
[virtual]
|
put 영역에서 연관된 출력 시퀀스로 문자를 기록합니다
(
std::basic_streambuf<CharT,Traits>
의
virtual protected 멤버 함수)
|
|
출력 영역의 시작, 현재 문자 및 끝에 대한 포인터를 반환합니다
(보호된 멤버 함수) |
|
|
출력 시퀀스의 다음 포인터를 전진시킴
(protected 멤버 함수) |
|
|
출력 시퀀스의 시작, 다음, 끝 포인터 위치를 재설정합니다
(보호된 멤버 함수) |
|
Putback |
|
|
[virtual]
|
입력 시퀀스에 문자를 다시 넣으며, 입력 시퀀스를 수정할 수 있음
(
std::basic_streambuf<CharT,Traits>
의
virtual protected 멤버 함수)
|
참고 사항
std::basic_spanbuf
는 기본 버퍼를 소유하지 않습니다.
프로그래머는
std::basic_spanbuf
객체가 사용될 때 기본 버퍼가 수명 주기 내에 있도록 보장할 책임이 있습니다. 서로 다른
std::basic_spanbuf
객체를 통해 둘 이상의 스레드가 동일한 기본 버퍼를 조작하는 경우 추가적인 동기화가 필요할 수 있습니다.
| 기능 테스트 매크로 | 값 | 표준 | 기능 |
|---|---|---|---|
__cpp_lib_spanstream
|
202106L
|
(C++23) |
std::spanbuf
,
std::spanstream
|
참고 항목
|
원시 문자열 장치 구현
(클래스 템플릿) |
|
|
(C++98에서 사용 중단됨)
(C++26에서 제거됨)
|
원시 문자 배열 장치 구현
(클래스) |