. \"ident "@(#)cls4:man/stream/ostream.3 1.1" . \"Copyright (c) 1984 AT&T . \"All Rights Reserved . \"THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T . \"The copyright notice above does not evidence any . \"actual or intended publication of such source code. .TH OSTREAM 3C++ "C++ Stream Library" " " .SH NAME ostream \- formatted and unformatted output .SH SYNOPSIS .ft B .ta1i 2i .nf #include typedef long streamoff, streampos; class ios { public: enum seek_dir { beg, cur, end }; enum open_mode { in, out, ate, app, trunc, nocreate, noreplace } ; enum { skipws=01, left=02, right=04, internal=010, dec=020, oct=040, hex=0100, showbase=0200, showpoint=0400, uppercase=01000, showpos=02000, scientific=04000, fixed=010000, unitbuf=020000, stdio=040000 }; // \f2and lots of other stuff, see ios(3C++) ... \fP } ; class ostream : public ios { public: ostream(streambuf*); ostream& flush(); int opfx(); ostream& put(char); ostream& seekp(streampos); ostream& seekp(streamoff, seek_dir); streampos tellp(); ostream& write(const char* ptr, int n); ostream& write(const unsigned char* ptr, int n); ostream& operator<<(const char*); ostream& operator<<(char); ostream& operator<<(short); ostream& operator<<(int); ostream& operator<<(long); ostream& operator<<(float); ostream& operator<<(double); ostream& operator<<(unsigned char); ostream& operator<<(unsigned short); ostream& operator<<(unsigned int); ostream& operator<<(unsigned long); ostream& operator<<(void*); ostream& operator<<(streambuf*); ostream& operator<<(ostream& (*)(ostream&)); ostream& operator<<(ios& (*)(ios&)); }; class ostream_withassign : public ostream { ostream_withassign(); ostream_withassign& operator=(ostream&); ostream_withassign& operator=(streambuf*); }; extern ostream_withassign cout; extern ostream_withassign cerr; extern ostream_withassign clog; ostream& endl(ostream&) ; ostream& ends(ostream&) ; ostream& flush(ostream&) ; ios& dec(ios&) ; ios& hex(ios&) ; ios& oct(ios&) ; .fi .ft R .SH DESCRIPTION \f(CWostream\f1s support insertion (storing) into a \f(CWstreambuf\f1. These are commonly referred to as output operations. The \f(CWostream\fP member functions and related functions are described below. .PP In the following descriptions, assume: .br \(em \f3outs\f1 is an \f(CWostream\f1. .br \(em \f3outswa\f1 is an \f(CWostream_withassign\f1. .br \(em \f3outsp\f1 is an \f(CWostream*\f1. .br \(em \f3c\f1 is a \f(CWchar\f1. .br \(em \f3ptr\f1 is a \f(CWchar*\f1 or \f(CWunsigned char*\f1. .br \(em \f3sb\f1 is a \f(CWstreambuf*\f1 .br \(em \f3i\f1 and \f3n\f1 are \f(CWint\f1s. .br \(em \f3pos\f1 is a \f(CWstreampos\f1. .br \(em \f3off\f1 is a \f(CWstreamoff\f1. .br \(em \f3dir\f1 is a \f(CWseek_dir\f1. .br \(em \f3manip\f1 is a function with type \f(CWostream& (*)(ostream&)\f1. .SS "Constructors and assignment:" .RS .TP \f3ostream(sb)\f1 Initializes \f3ios\f1 state variables and associates buffer \f3sb\f1 with the \f(CWostream\fP. .TP \f3ostream_withassign()\f1 Does no initialization. This allows a file static variable of this type (\f3cout\f1, for example) to be used before it is constructed, provided it is assigned to first. .TP \f3outswa=sb\f1 Associates \f3sb\f1 with \f3swa\f1 and initializes the entire state of \f3outswa\f1. .TP \f3inswa=ins\f1 Associates \f3ins->rdbuf()\f1 with \f3swa\f1 and initializes the entire state of \f3outswa\f1. .RE .SS "Output prefix function:" .RS .TP \f3i=outs.opfx()\f1 If \f3outs\f1's error state is nonzero, returns immediately. If \f3outs.tie()\f1 is non-null, it is flushed. Returns non-zero except when \f3outs\f1's error state is nonzero. .RE .SS "Output suffix function:" .RS .TP \f3osfx()\f1 Performs ``suffix'' actions before returning from inserters. If \f(CWios::unitbuf\fP is set, \f3osfx()\fP flushes the \f(CWostream\fP. If \f(CWios::stdio\fP is set, \f3osfx()\fP flushes \f(CWstdout\fP and \f(CWstderr\fP. .P \f3osfx()\f1 is called by all predefined inserters, and should be called by user-defined inserters as well, after any direct manipulation of the \f(CWstreambuf\fP. It is not called by the binary output functions. .RE .SS "Formatted output functions (inserters):" .RS .TP \f3outs<sync\f1. .TP \f3outs<