oeofstream

class oeofstream : public oeostream

This class represents oeofstream.

Implements an output stream capable of writing to a specified file or to any generic data source with an associated file descriptor.

The following methods are publicly inherited from oeostream:

operator<

flush

putbyte

close

open

write

The following methods are publicly inherited from oestream:

operator bool

rewind

tell

eof

seek

length

size

Constructors

oeofstream()
oeofstream(int ofd)
oeofstream(const char *filename)
oeofstream(const std::string &filename)

Creates a new oeofstream. If a valid file descriptor (‘fd’) is passed to the constructor, the stream will use the associated data target for output. Otherwise, the constructors expect the name of file to be written to. If the named file does not exist, it will be created. If no parameter is passed to the constructor, the stream can later be opened using the open command defined in oeostream or the oeofstream::openfd command defined in this class.

append

bool append(const char *filename)
bool append(const std::string &filename)

Opens the specified file to which data will be appended. Returns whether or not the file was successfully opened (or created as necessary).

fd

int fd() const

Returns the system dependent file descriptor associated with the stream’s data target.

openfd

bool openfd(int ofd, bool closefd)

Sets the data target of the stream to the specified file descriptor ‘fd’. If ‘closefd’ is false, the underlying data target is not closed before changing to the new data source.