다음을 통해 공유


basic_stringbuf 클래스

Describes a stream buffer that controls the transmission of elements of type Elem, whose character traits are determined by the class Tr, to and from a sequence of elements stored in an array object.

template <class Elem, class Tr = char_traits<Elem>, 
   class Alloc = allocator<Elem> 
>
   class basic_stringbuf : public basic_streambuf<Elem, Tr>

매개 변수

  • Alloc
    The allocator class.

  • Elem
    The type of the basic element of the string.

  • Tr
    The character traits specialized on the basic element of the string.

설명

The object is allocated, extended, and freed as necessary to accommodate changes in the sequence.

An object of class basic_stringbuf<Elem, Tr, Alloc> stores a copy of the ios_base::openmode argument from its constructor as its stringbuf mode mode:

  • If mode & ios_base::in is nonzero, the input buffer is accessible. 자세한 내용은 basic_streambuf 클래스을 참조하십시오.

  • If mode & ios_base::out is nonzero, the output buffer is accessible.

생성자

basic_stringbuf

'basic_stringbuf' 형식의 개체를 생성합니다.

형식 정의

allocator_type

The type is a synonym for the template parameter Alloc.

char_type

Associates a type name with the Elem template parameter.

int_type

Makes this type within basic_filebuf's scope equivalent to the type of the same name in the Tr scope.

off_type

Makes this type within basic_filebuf's scope equivalent to the type of the same name in the Tr scope.

pos_type

Makes this type within basic_filebuf's scope equivalent to the type of the same name in the Tr scope.

특성 형식

Associates a type name with the Tr template parameter.

멤버 함수

오버플로(overflow)

A protected, virtual function that can be called when a new character is inserted into a full buffer.

pbackfail

The protected virtual member function tries to put back an element into the input buffer, then makes it the current element (pointed to by the next pointer).

seekoff

The protected virtual member function tries to alter the current positions for the controlled streams.

seekpos

The protected virtual member function tries to alter the current positions for the controlled streams.

str

Sets or gets the text in a string buffer without changing the write position.

underflow

The protected virtual member function to extract the current element from the input stream.

요구 사항

Header: <sstream>

네임스페이스: std

참고 항목

참조

C++ 표준 라이브러리의 스레드 보안

iostream 프로그래밍

iostreams 규칙

기타 리소스

basic_stringbuf 멤버

<sstream> 멤버