Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Rogue Wave C++ Standard Library Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

basic_fstream

Module:  Standard C++ Library   Library:  Input/output


basic_ostream basic_fstreambasic_iostream basic_iosios_base basic_istream

Local Index

Members

Non-Members

Summary

Class that supports reading and writing of named files or devices associated with a file descriptor

Synopsis

#include <fstream> 

namespace std {
  template<class charT, class traits = char_traits<charT> > 
  class basic_fstream; 
}

Description

The class template basic_fstream supports reading and writing to 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_iostream and can therefore use all the formatted and unformatted input and output functions.

Interface

Member Types

char_type
int_type
off_type
pos_type
traits_type

Nonmember Types

fstream
wfstream

Constructors

basic_fstream();
basic_fstream(const char* s,
              ios_base::openmode mode = 
                ios_base::in | iosw_base::out);
basic_fstream(const char* s, ios_base::openmode mode, 
              long protection);

NOTE -- The protection argument is not part of the C++ Standard, but is included here as a convenience extension. See Appendix B for a complete list of Rogue Wave extensions.
basic_fstream(int fd, char_type *buf, streamsize n); 

NOTE -- This function is not part of the C++ Standard, but is included here as an extension in order to manipulate pipes, sockets, or other UNIX devices that can be accessed through file descriptors. See Appendix B for a complete list of Rogue Wave extensions.
basic_fstream(FILE *fp, char_type* buf, streamsize n); 

NOTE -- This function is not part of the C++ Standard, but is provided here as a convenience extension. See Appendix B for a complete list of Rogue Wave extensions.

Destructors

virtual ~basic_fstream();

Member Functions

void
close();
int 
fd() const;

NOTE -- This function is not part of the C++ Standard, but is provided here as a convenience extension. See Appendix B for a complete list of Rogue Wave extensions.
bool 
is_open() const;
void 
open(const char* s,
     ios_base::openmode = ios_base::in | ios_base::out);
void 
open(const char* s, 
     ios_base::openmode, long protection);

NOTE -- The protection argument does not appear in the C++ Standard C++, but is included here as a convenience extension. See Appendix B for a complete list of Rogue Wave extensions.
void 
open(int fd, char_type *buf = 0, 
      streamsize n = /* default size */);

NOTE -- This function is not part of the C++ Standard, but is provided here as a convenience extension. See Appendix B for a complete list of Rogue Wave extensions.
void 
open(FILE *fp, char_type *buf = 0, 
     streamsize n = /* default size */);

NOTE -- This function is not part of the C++ Standard, but is provided here as a convenience extension. See Appendix B for a complete list of Rogue Wave extensions.
basic_filebuf<charT_type,traits_type>* 
rdbuf() const; 

Example

See Also

char_traits, ios_base, basic_ios, basic_filebuf, basic_ifstream, basic_ofstream

Standards Conformance

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



Previous fileTop of DocumentContentsIndex pageNext file

Copyright (c) 1994-2006 Rogue Wave Software, a Quovadx Division.
Licensed under the Apache License, Version 2.0.
Contact Rogue Wave about documentation or support issues. You can also seek help from other developers through the Apache stdcxx community (see below).

For more information on the Rogue Wave Standard C++ Library under open source, see Section 1.2 of the user's guide.