Namespaces
Variants

std:: basic_stringbuf

From cppreference.net
< cpp ‎ | io
헤더 파일에 정의됨 <sstream>
template <

class CharT,
class Traits = std:: char_traits < CharT > ,
class Allocator = std:: allocator < CharT >
> class basic_stringbuf

: public std:: basic_streambuf < CharT, Traits >

std::basic_stringbuf 는 연결된 문자 시퀀스가 메모리 상에 존재하는 임의의 문자 시퀀스이며, std::basic_string 인스턴스로부터 초기화되거나 해당 인스턴스로 제공될 수 있는 std::basic_streambuf 입니다.

std::basic_stringbuf 의 일반적인 구현은 std::basic_string 타입의 객체 또는 이에 상응하는 크기 조정 가능한 시퀀스 컨테이너를 데이터 멤버로 직접 보유하며, 이를 제어 문자 시퀀스( std::basic_streambuf 의 여섯 개 포인터가 가리키는 배열)와 연관 문자 시퀀스(모든 입력 연산의 문자 소스 및 출력의 대상) 모두로 사용합니다.

또한, 일반적인 구현은 연결된 스트림의 입출력 모드(입력 전용, 출력 전용, 입출력, 파일 끝 등)를 나타내기 위해 std::ios_base::openmode 타입의 데이터 멤버를 보유합니다.

만약 초과 할당 전략이 overflow() 에 의해 사용되는 경우, 마지막으로 초기화된 문자를 추적하기 위해 추가적인 고수위 포인터가 저장될 수 있습니다.

(since C++11)

일반적인 문자 타입에 대한 여러 typedef가 제공됩니다:

헤더 파일에 정의됨 <sstream>
타입 정의
std::stringbuf std :: basic_stringbuf < char >
std::wstringbuf std :: basic_stringbuf < wchar_t >

목차

멤버 타입

멤버 타입 정의
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
allocator_type Allocator

설명 전용 멤버

buf 기본 버퍼로 사용되는 std:: basic_string < CharT, Traits, Allocator >
( 설명 전용 멤버 객체* )
mode 연관된 스트림의 std::ios_base::openmode
( 설명 전용 멤버 객체* )
입력 및 출력 시퀀스를 초기화함
( 설명 전용 멤버 함수* )

공개 멤버 함수

basic_stringbuf 객체를 생성합니다
(public member function)
(C++11)
basic_stringbuf 객체를 할당합니다
(public member function)
(C++11)
두 개의 basic_stringbuf 객체를 교환합니다
(public member function)
(destructor)
[virtual] (implicitly declared)
basic_stringbuf 객체와 그것이 보유한 문자열을 소멸시킵니다
(virtual public member function)
연결된 문자열의 복사본을 교체하거나 획득합니다
(public member function)
내부 시퀀스 컨테이너와 연결된 할당자의 복사본을 획득합니다
(public member function)
(C++20)
기본 문자 시퀀스에 대한 뷰를 획득합니다
(public member function)

보호된 멤버 함수

[virtual]
입력 시퀀스에서 사용 가능한 다음 문자를 반환합니다
(가상 protected 멤버 함수)
[virtual]
입력 시퀀스에 문자를 다시 넣습니다
(가상 protected 멤버 함수)
[virtual]
출력 시퀀스에 문자를 추가합니다
(가상 protected 멤버 함수)
[virtual]
제어되는 문자 시퀀스를 배열로 교체하려 시도합니다
(가상 protected 멤버 함수)
[virtual]
상대 주소 지정을 사용하여 입력 시퀀스, 출력 시퀀스 또는 둘 모두에서 다음 포인터의 위치를 재조정합니다
(가상 protected 멤버 함수)
[virtual]
절대 주소 지정을 사용하여 입력 시퀀스, 출력 시퀀스 또는 둘 모두에서 다음 포인터의 위치를 재조정합니다
(가상 protected 멤버 함수)

비멤버 함수

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> 의 virtual protected 멤버 함수)
포지셔닝
[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]
연관된 문자 시퀀스와 버퍼를 동기화합니다
( std::basic_streambuf<CharT,Traits> 의 virtual protected 멤버 함수)
영역 가져오기
[virtual]
연결된 입력 시퀀스에서 사용 가능한 문자 수를 확인합니다(알려진 경우)
( std::basic_streambuf<CharT,Traits> 의 virtual protected member function)
[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 member function)
입력 시퀀스의 시작, 다음, 끝 포인터를 재배치합니다
(protected member function)
Put 영역
[virtual]
출력 시퀀스에 여러 문자를 기록합니다
( std::basic_streambuf<CharT,Traits> 의 가상 protected 멤버 함수)
[virtual]
put 영역에서 연관된 출력 시퀀스로 문자를 기록합니다
( std::basic_streambuf<CharT,Traits> 의 virtual protected 멤버 함수)
출력 영역의 시작, 현재 문자 및 끝에 대한 포인터를 반환합니다
(보호된 멤버 함수)
출력 시퀀스의 다음 포인터를 전진시킴
(보호된 멤버 함수)
출력 시퀀스의 시작, 다음, 끝 포인터 위치를 재설정합니다
(보호된 멤버 함수)
Putback
[virtual]
입력 시퀀스에 문자를 다시 넣으며, 입력 시퀀스를 수정할 수 있음
( std::basic_streambuf<CharT,Traits> 의 virtual protected 멤버 함수)