.\" ident @(#)ostrstream.3 .\" Standard Template Library .\" $$RW_INSERT_HEADER "slyrs.man" .TH ostrstream 3C++ "02 Apr 1998" "Rogue Wave Software" "-" .ce2 Standard C++ Library Copyright 1998, Rogue Wave Software, Inc. .SH NAME \f2ostrstream\fP \ - Writes to an array in memory. .SH SYNOPSIS .br #include .br class ostrstream .br : public basic_ostream .SH DESCRIPTION The class ostrstream writes to an array in memory. It uses a private strstreambuf_object to control the associated array object. It inherits from basic_ostream and therefore can use all the formatted and unformatted output functions. This is a deprecated feature and might not be available in future versions. .SH INTERFACE .br class ostrstream .br : public basic_ostream { .br .br public: .br .RE .RS 1 typedef char_traits traits; .RE .RS 0 .RE .RS 1 typedef char char_type; .br typedef typename traits::int_type int_type; .br typedef typename traits::pos_type pos_type; .br typedef typename traits::off_type off_type; .RE .RS 0 .RE .RS 1 ostrstream(); .br ostrstream(char *s, int n, .RE .RS 12 ios_base::openmode = ios_base::out); .RE .RS 4 .RE .RS 1 virtual ~ostrstream(); .RE .RS 0 .RE .RS 1 strstreambuf *rdbuf() const; .br void freeze(int freezefl = 1); .br char *str(); .br int pcount() const; .RE .RS 0 .br }; .SH TYPES .br char_type .RE .RS 3 The type \f2char_type\fP is a synonym of type \f2char\fP. .RE .br int_type .RE .RS 3 The type\f2 int_type\fP is a synonym of type \f2traits::in_type\fP. .RE .br off_type .RE .RS 3 The type \f2off_type\fP is a synonym of type \f2traits::off_type\fP. .RE .br pos_type .RE .RS 3 The type \f2pos_type\fP is a synonym of type \f2traits::pos_type\fP. .RE .br traits .RE .RS 3 The type \f2traits\fP is a synonym of type \f2char_traits\fP. .RE .SH CONSTRUCTORS .br ostrstream(); .RE .RS 3 Constructs an object of class \f2ostrstream\fP, initializing the base class \f2basic_ostream\fP with the associated \f2strstreambuf\fP object. The \f2strstreambuf\fP object is initialized by calling its default constructor \f2strstreambuf()\fP. .RE .br ostrstream(char* s, int n, ios_base::openmode .RE .RS 10 mode = ios_base::out); .RE .RS 3 Constructs an object of class \f2ostrstream\fP, initializing the base class \f2basic_ostream\fP with the associated \f2strstreambuf\fP object. The \f2strstreambuf\fP object is initialized by calling one of two constructors: .RS .5i .HP .5i - If \f2mode & app == 0\fP, it calls \f2strstreambuf(s,n,s)\fP .HP .5i - Otherwise it calls \f2strstreambuf(s,n,s + ::strlen(s))\fP.RE .RE .SH DESTRUCTORS .RE .RS 0 virtual ~ostrstream(); .RE .RS 3 Destroys an object of class \f2ostrstream\fP. .RE .SH MEMBER FUNCTIONS .br void .br freeze(bool freezefl = 1); .RE .RS 3 If the mode is dynamic, alters the freeze status of the dynamic array object as follows: .RS .5i .HP .5i - If \f2freezefl\fP is \f2false\fP, the function sets the freeze status to frozen. .HP .5i - Otherwise, it clears the freeze status..RE .RE .RE .br int .br pcount() const; .RS 3 Returns the size of the output sequence. .RE .br strstreambuf* .br rdbuf() const; .RE .RS 3 Returns a pointer to the private \f2strstreambuf\fP object associated with the stream. .RE .br char* .br str(); .RE .RS 3 Returns a pointer to the underlying array object, which may be null. .RE .SH EXAMPLE See strstream, istrstream and strstreambuf examples. .SH SEE ALSO char_traits(3C++), ios_base(3C++), basic_ios(3C++), strstreambuf(3C++), istrstream(3C++), strstream(3C++) Working Paper for Draft Proposed International Standard for Information Systems--Programming Language C++, Annex D Compatibility features Section D.6.3 .SH STANDARDS CONFORMANCE ANSI X3J16/ISO WG21 Joint C++ Committee