Rogue Wave banner
Previous fileTop of documentContentsIndexNext file

basic_ofstream


basic_ofstreaminherits frombasic_ostreaminherits frombasic_iosinherits fromios_base

Summary

Supports writing into named files or other devices associated with a file descriptor.

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

Synopsis

#include <fstream> 
template<class charT, class traits = char_traits<charT> >
class basic_ofstream
: public basic_ostream<charT, traits>

Description

The template class basic_ofstream<charT,traits> supports writing into named files or other devices associated with a file descriptor. It uses a basic_filebuf object to control the associated sequences. It inherits from basic_ostream and can therefore use all the formatted and unformatted output functions.

Interface

Types

char_type
off_type
ofstream
int_type
ios_type
pos_type
traits_type
wofstream

Constructors

basic_ofstream();
basic_ofstream(const char* s,
               ios_base::openmode mode= ios_base::in,
               long protection= 0666); 
explicit basic_ofstream(int fd); 
basic_ofstream(int fd, char_type* buf,int len); 

Destructors

virtual ~basic_ofstream();

Member Functions

void 
close();
bool 
is_open();
void 
open(const char* s,ios_base::openmode =
          ios_base::out, long protection = 0666); 
basic_filebuf<charT,traits>* 
rdbuf() const; 

Example

See basic_fstream, basic_ifstream and basic_filebuf examples.

See Also

char_traits(3C++),ios_base(3C++), basic_ios(3C++), basic_filebuf(3C++), basic_ifstream(3C++), basic_fstream(3C++)

Working Paper for Draft Proposed International Standard for Information Systems--Programming Language C++, Section 27.8.1.8

Standards Conformance

ANSI X3J16/ISO WG21 Joint C++ Committee



Previous fileTop of documentContentsIndexNext file
©Copyright 1998, Rogue Wave Software, Inc.
Send mail to report errors or comment on the documentation.
OEM Release, June 1998