Previous fileTop of DocumentContentsIndex pageNext file
Apache C++ Standard Library Reference Guide

basic_ostringstream

Library:  Input/output


basic_ostringstream basic_ostream basic_ios ios_base

Local Index

Members

Non-Members

Summary

Class that supports writing objects of specializations of class template basic_string

Synopsis

#include <sstream> 

namespace std {
  template<class charT, class traits = char_traits<charT>,
           class Allocator = allocator<void> >
  class basic_ostringstream;
}

Description

The class template basic_ostringstream writes to an array in memory. It supports writing objects of class basic_string. It uses a basic_stringbuf object to control the associated storage. It inherits from basic_ostream, and therefore can use all the formatted and unformatted output functions.

Interface

Member Types

allocator_type
char_type
int_type
ios_type
off_type
pos_type
traits_type

Nonmember Types

ostringstream
wostringstream

Constructors

explicit basic_ostringstream(ios_base::openmode which =
                             ios_base::out); 
explicit basic_ostringstream(const basic_string<char_type,
                            traits_type, allocator_type>& str,
                             ios_base::openmode which =
                             ios_base::out);

Destructors

virtual ~basic_ostringstream();

Member Functions

basic_stringbuf<char_type, traits_type, allocator_type>* 
rdbuf() const; 
basic_string<char_type, traits_type, allocator_type>
str() const;
void 
str(const basic_string<char_type, traits_type, allocator_type>& str);

Example

See basic_stringstream, basic_istringstream and basic_stringbuf examples.

See Also

char_traits, ios_base, basic_ios, basic_stringbuf, basic_string, basic_istringstream, basic_stringstream

Standards Conformance

ISO/IEC 14882:1998 -- International Standard for Information Systems --Programming Language C++, Section 27.7.3



Previous fileTop of DocumentContentsIndex pageNext file