<sstream>

할당된 배열 개체에 저장된 시퀀스에 대한 iostreams 작업을 지원하는 여러 클래스 템플릿을 정의합니다. 이러한 시퀀스는 클래스 템플릿 basic_string 개체와 쉽게 변환됩니다.

구문

namespace std {
template <class CharType, class Traits = char_traits<CharType>, class Allocator = allocator<CharType>>
class basic_stringbuf;
typedef basic_stringbuf<char>
stringbuf;
typedef basic_stringbuf<wchar_t> wstringbuf;

template <class CharType, class Traits = char_traits<CharType>, class Allocator = allocator<CharType>>
class basic_istringstream;
typedef basic_istringstream<char>
istringstream;
typedef basic_istringstream<wchar_t> wistringstream;

template <class CharType, class Traits = char_traits<CharType>, class Allocator = allocator<CharType>>
class basic_ostringstream;
typedef basic_ostringstream<char>
ostringstream;
typedef basic_ostringstream<wchar_t> wostringstream;

template <class CharType, class Traits = char_traits<CharType>, class Allocator = allocator<CharType>>
class basic_stringstream;
typedef basic_stringstream<char>
stringstream;
typedef basic_stringstream<wchar_t> wstringstream;
// TEMPLATE FUNCTIONS
template <class CharType, class Traits, class Allocator>
void swap(
    basic_stringbuf<CharType, Traits, Allocator>& left,
    basic_stringbuf<CharType, Traits, Allocator>& right);

template <class CharType, class Traits, class Allocator>
void swap(
    basic_istringstream<CharType, Traits, Allocator>& left,
    basic_istringstream<CharType, Traits, Allocator>& right);

template <class CharType, class Traits, class Allocator>
void swap(
    basic_ostringstream<CharType, Traits, Allocator>& left,
    basic_ostringstream<CharType, Traits, Allocator>& right);

template <class CharType, class Traits, class Allocator>
void swap (
    basic_stringstream<CharType, Traits, Allocator>& left,
    basic_stringstream<CharType, Traits, Allocator>& right);

}  // namespace std

매개 변수

left
sstream 개체에 대한 참조입니다.

right
sstream 개체에 대한 참조입니다.

설명

형식 char * 의 개체는 스트리밍을 위해 strstream><기능을 사용할 수 있습니다. 그러나 <strstream>은 더 이상 사용되지 않으며 sstream>을 <사용하는 것이 좋습니다.

Typedef

형식 이름 설명
istringstream char 템플릿 매개 변수에 대해 특수화된 basic_istringstream 형식을 만듭니다.
ostringstream char 템플릿 매개 변수에 대해 특수화된 basic_ostringstream 형식을 만듭니다.
stringbuf char 템플릿 매개 변수에 대해 특수화된 basic_stringbuf 형식을 만듭니다.
stringstream char 템플릿 매개 변수에 대해 특수화된 basic_stringstream 형식을 만듭니다.
wistringstream wchar_t 템플릿 매개 변수에 대해 특수화된 basic_istringstream 형식을 만듭니다.
wostringstream wchar_t 템플릿 매개 변수에 대해 특수화된 basic_ostringstream 형식을 만듭니다.
wstringbuf wchar_t 템플릿 매개 변수에 대해 특수화된 basic_stringbuf 형식을 만듭니다.
wstringstream wchar_t 템플릿 매개 변수에 대해 특수화된 basic_stringstream 형식을 만듭니다.

조작자

이름 설명
swap sstream 개체 간에 값을 교환합니다.

클래스

클래스 설명
basic_stringbuf 배열 개체에 저장된 요소의 시퀀스에서 문자 특성이 Tr 클래스에 의해 결정되는 Elem 형식 요소의 전송을 제어하는 스트림 버퍼에 대해 설명합니다.
basic_istringstream 클래스 <basic_stringbuf Elem, Tr>Alloc의 스트림 버퍼에서 요소 및 인코딩된 개체의 추출을 제어하는 개체를 클래스에 의해 문자 특성이 결정되고 해당 요소가 클래스 AllocTr할당자에 의해 할당되는 형식 Elem요소와 함께 설명합니다.
basic_ostringstream 요소 및 인코딩된 개체를 클래스 <basic_stringbuf Elem, Tr>Alloc의 스트림 버퍼에 삽입하는 것을 제어하고, 형식Elem의 요소, 클래스에 의해 문자 특성이 결정되고 해당 요소가 클래스 TrAlloc할당자에 의해 할당되는 개체를 설명합니다.
basic_stringstream 클래스 basic_stringbuf Elem, Tr>Alloc의 스트림 버퍼를 사용하여 요소 및 인코딩된 개체의< 삽입 및 추출을 제어하는 개체와 클래스에 의해 문자 특성이 결정되고 해당 요소가 클래스 TrAlloc할당자에 의해 할당되는 형식 Elem요소를 포함하는 개체에 대해 설명합니다.

요구 사항

  • 헤더:<sstream>

  • 네임스페이스: std

참고 항목

헤더 파일 참조
C++ 표준 라이브러리의 스레드 보안
iostream 프로그래밍
iostreams 규칙