Google

C++ Portable Types Library (PTypes) Version 1.7


Top: Streams: outfile

#include <pstreams.h>

outfile::outfile( [ const string& filename, bool append = false ] );
string outfile::get/set_filename();
bool outfile::get/set_append();
int outfile::get/set_umode();

This class derives all public methods and properties from iobase and outstm, and in addition defines the following:

outfile::outfile( [ const string& filename, bool append = false ] ) creates an output file stream, but does not open the file. When opening a file with open(), it is truncated to zero unless append property is set to true. Filename and append parameters are optional.

string outfile::get/set_filename() sets the filename. set_filename() closes the stream prior to assigning the new value.

bool outfile::get/set_append() -- if set to true, the file pointer is set beyond the last byte of the file when opening the stream with open().

int outfile::get/set_umode() sets UNIX file mode when creating a new file. By default a file is created with 0644 octal, which on UNIX means read/write access for the owner and read-only access for group members and all others. This property has no effect on Windows.

See also: iobase, outstm, Examples


PTypes home