Click on the banner to return to the class reference home page.

ostrstream


ostrstreambasic_ostreambasic_iosios_base

Data Type and Member Function Indexes
(exclusive of constructors and destructors)

Synopsis

#include <strstream> 
class ostrstream
: public basic_ostream<char>

Description

The class ostrstream provides functionality to write to an array in memory. It uses a private strstreambuf object to control the associated array object. It inherits from basic_ostream<char> and therefore can use all the formatted and unformatted output functions.

Interface

class ostrstream 
: public basic_ostream<char> {

 public:

  typedef char_traits<char>             traits;

  typedef char                         char_type;
  typedef typename traits::int_type    int_type;
  typedef typename traits::pos_type    pos_type;
  typedef typename traits::off_type    off_type;

  ostrstream();
  ostrstream(char *s, int n,
             ios_base::openmode = ios_base::out);
    
  virtual ~ostrstream();

  strstreambuf *rdbuf() const;

  void freeze(int freezefl = 1);

  char *str();

  int pcount() const;

};

Types

char_type
int_type
off_type
pos_type
traits

Constructors

ostrstream();
ostrstream(char* s,int n, ios_base::openmode
           mode = ios_base::out);

Destructor

virtual ~ostrstream();

Member Functions

void 
freeze(bool freezefl = 1);
int 
pcount() const;
strstreambuf* 
rdbuf() const;
char* 
str();

Examples

See strstream, istrstream and strstreambuf examples.

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

Standards Conformance

ANSI X3J16/ISO WG21 Joint C++ Committee


©Copyright 1996, Rogue Wave Software, Inc.