std:: ostrstream
|
헤더 파일에 정의됨
<strstream>
|
||
|
class
ostrstream
:
public
std::
ostream
|
(C++98에서 사용 중단됨)
(C++26에서 제거됨) |
|
ostrstream
클래스는 배열 기반 스트림에 대한 출력 연산을 구현합니다. 이는 기본적으로 원시 배열 I/O 장치 구현(
std::strstreambuf
)을 상위 수준 인터페이스인
std::basic_ostream
으로 래핑합니다.
ostrstream
의 일반적인 구현은 단 하나의 비파생 데이터 멤버만을 보유합니다:
std::strstreambuf
타입의 객체입니다.
목차 |
참고 사항
str() 호출 후에는, freeze(false) 호출이 필요하며, 이를 통해 소멸자가 필요에 따라 버퍼를 할당 해제할 수 있습니다.
str() 호출 전에, 결과를 C-string으로 사용하는 경우 버퍼는 반드시 null-terminated되어야 하며, 일반적으로 std::ends 를 사용하여 처리합니다.
ostrstream
는 C++98부터 사용이 중단되었으며 C++26부터 제거되었습니다.
std::ostringstream
,
std::ospanstream
(C++23 이후)
, 그리고
boost::iostreams::array_sink
가 권장되는 대체제입니다.
멤버 함수
ostrstream
객체를 생성하며, 선택적으로 버퍼를 할당함
(public member function) |
|
|
[virtual]
|
ostrstream
객체를 소멸하며, 선택적으로 버퍼를 해제함
(virtual public member function) |
연결된
strstreambuf
에 대한 포인터를 얻음
(public member function) |
|
|
출력 버퍼에 접근함
(public member function) |
|
|
자동 재할당을 비활성화/활성화함
(public member function) |
|
|
기록된 문자 수를 얻음
(public member function) |
std:: basic_ostream 로부터 상속됨
멤버 함수
형식화된 출력 |
|
|
형식화된 데이터를 삽입함
(
std::basic_ostream<CharT,Traits>
의 public 멤버 함수)
|
|
비형식화된 출력 |
|
|
문자를 삽입함
(
std::basic_ostream<CharT,Traits>
의 public 멤버 함수)
|
|
|
문자 블록을 삽입함
(
std::basic_ostream<CharT,Traits>
의 public 멤버 함수)
|
|
위치 지정 |
|
|
출력 위치 표시자를 반환함
(
std::basic_ostream<CharT,Traits>
의 public 멤버 함수)
|
|
|
출력 위치 표시자를 설정함
(
std::basic_ostream<CharT,Traits>
의 public 멤버 함수)
|
|
기타 |
|
|
기본 저장 장치와 동기화함
(
std::basic_ostream<CharT,Traits>
의 public 멤버 함수)
|
|
멤버 클래스
|
출력 연산을 위한 스트림 준비 기본 로직을 구현함
(
std::basic_ostream<CharT,Traits>
의 public 멤버 클래스)
|
std:: basic_ios 로부터 상속됨
멤버 타입
| 멤버 타입 | 정의 |
char_type
|
CharT
|
traits_type
|
Traits
|
int_type
|
Traits::int_type
|
pos_type
|
Traits::pos_type
|
off_type
|
Traits::off_type
|
멤버 함수
상태 함수 |
|
|
오류가 발생하지 않았는지 확인 (즉, I/O 작업이 가능한 상태)
(
std::basic_ios<CharT,Traits>
의 public 멤버 함수)
|
|
|
파일 끝에 도달했는지 확인
(
std::basic_ios<CharT,Traits>
의 public 멤버 함수)
|
|
|
오류가 발생했는지 확인
(
std::basic_ios<CharT,Traits>
의 public 멤버 함수)
|
|
|
복구 불가능한 오류가 발생했는지 확인
(
std::basic_ios<CharT,Traits>
의 public 멤버 함수)
|
|
|
오류가 발생했는지 확인 (
fail()
의 동의어)
(
std::basic_ios<CharT,Traits>
의 public 멤버 함수)
|
|
오류가 발생하지 않았는지 확인 (
!
fail()
의 동의어)
(
std::basic_ios<CharT,Traits>
의 public 멤버 함수)
|
|
|
상태 플래그를 반환
(
std::basic_ios<CharT,Traits>
의 public 멤버 함수)
|
|
|
상태 플래그를 설정
(
std::basic_ios<CharT,Traits>
의 public 멤버 함수)
|
|
|
상태 플래그를 수정
(
std::basic_ios<CharT,Traits>
의 public 멤버 함수)
|
|
서식 지정 |
|
|
서식 정보를 복사
(
std::basic_ios<CharT,Traits>
의 public 멤버 함수)
|
|
|
채움 문자를 관리
(
std::basic_ios<CharT,Traits>
의 public 멤버 함수)
|
|
기타 |
|
|
예외 마스크를 관리
(
std::basic_ios<CharT,Traits>
의 public 멤버 함수)
|
|
|
로케일을 설정
(
std::basic_ios<CharT,Traits>
의 public 멤버 함수)
|
|
|
연결된 스트림 버퍼를 관리
(
std::basic_ios<CharT,Traits>
의 public 멤버 함수)
|
|
|
연결된 스트림을 관리
(
std::basic_ios<CharT,Traits>
의 public 멤버 함수)
|
|
|
문자를 축소
(
std::basic_ios<CharT,Traits>
의 public 멤버 함수)
|
|
|
문자를 확장
(
std::basic_ios<CharT,Traits>
의 public 멤버 함수)
|
|
std:: ios_base 에서 상속됨
멤버 함수
서식 지정 |
|
|
형식 플래그 관리
(
std::ios_base
의 public 멤버 함수)
|
|
|
특정 형식 플래그 설정
(
std::ios_base
의 public 멤버 함수)
|
|
|
특정 형식 플래그 지움
(
std::ios_base
의 public 멤버 함수)
|
|
|
부동 소수점 연산의 소수점 정밀도 관리
(
std::ios_base
의 public 멤버 함수)
|
|
|
필드 너비 관리
(
std::ios_base
의 public 멤버 함수)
|
|
로캘 |
|
|
로캘 설정
(
std::ios_base
의 public 멤버 함수)
|
|
|
현재 로캘 반환
(
std::ios_base
의 public 멤버 함수)
|
|
내부 확장 가능 배열 |
|
|
[static]
|
pword()
및
iword()
의 인덱스로 사용하기에 안전한 프로그램 전체에서 유일한 정수 반환
(
std::ios_base
의 public static 멤버 함수)
|
|
필요한 경우 개인 저장소 크기 조정 및 주어진 인덱스의
long
요소 접근
(
std::ios_base
의 public 멤버 함수)
|
|
|
필요한 경우 개인 저장소 크기 조정 및 주어진 인덱스의
void
*
요소 접근
(
std::ios_base
의 public 멤버 함수)
|
|
기타 |
|
|
이벤트 콜백 함수 등록
(
std::ios_base
의 public 멤버 함수)
|
|
|
[static]
|
C++과 C I/O 라이브러리의 상호 운용성 설정
(
std::ios_base
의 public static 멤버 함수)
|
멤버 클래스 |
|
|
스트림 예외
(
std::ios_base
의 public 멤버 클래스)
|
|
|
표준 스트림 객체 초기화
(
std::ios_base
의 public 멤버 클래스)
|
|
멤버 타입 및 상수 |
|||||||||||||||||||||||||||||||||||||||
| 유형 | 설명 | ||||||||||||||||||||||||||||||||||||||
|
스트림 열기 모드 타입
다음 상수들도 정의되어 있습니다:
(typedef) |
|||||||||||||||||||||||||||||||||||||||
|
서식 지정 플래그 타입
다음 상수들도 정의되어 있습니다:
(typedef) |
|||||||||||||||||||||||||||||||||||||||
|
스트림 상태 타입
다음 상수들도 정의됩니다:
(typedef) |
|||||||||||||||||||||||||||||||||||||||
|
탐색 방향 타입
다음 상수들도 정의되어 있습니다:
(typedef) |
|||||||||||||||||||||||||||||||||||||||
|
이벤트 타입 지정
(enum) |
|||||||||||||||||||||||||||||||||||||||
|
콜백 함수 타입
(typedef) |
|||||||||||||||||||||||||||||||||||||||