Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

lrt::FileOutputStream Class Reference

Class FileOutputStreams implements an output stream which writes data to a file. More...

#include <rtstreams.h>

Inheritance diagram for lrt::FileOutputStream:

Inheritance graph
[legend]
List of all members.

Public Methods

 FileOutputStream (const String &fileName, bool append=false)
 Creates a FileOutputStream which writes data to the file denoted by its name fileName. More...

 FileOutputStream (const File &file, bool append=false)
 Creates a FileOutputStream which writes data to the file denoted by its file descriptor file. More...

virtual bool write (int b)
 Writes a byte to the file.

virtual bool write (const Array< char > &b, int off, int len)
 Writes part of an array to the file.

virtual bool write (const Array< char > &b)
 Writes the whole array b to the output stream. More...

virtual void flush ()
 Flushes the system's output buffer (if it exists) for this file.

virtual void close ()
 Closes the system output stream.

virtual ~FileOutputStream ()

Detailed Description

Class FileOutputStreams implements an output stream which writes data to a file.

It supports opening files in either overwrite or append mode.


Constructor & Destructor Documentation

lrt::FileOutputStream::FileOutputStream (  const String &    fileName,
bool    append = false
) 
 

Creates a FileOutputStream which writes data to the file denoted by its name fileName.

Note that you should always separate paths with forward slashes '/'; libRT will convert them to the system dependent path separators.

Parameters:
fileName  The file's name to write to.
append  If specified, data is appended to the file, if it exists.

lrt::FileOutputStream::FileOutputStream (  const File &    file,
bool    append = false
) 
 

Creates a FileOutputStream which writes data to the file denoted by its file descriptor file.

Parameters:
file  The file to write to.
append  If specified, data is appended to the file, if it exists.


Member Function Documentation

bool lrt::FileOutputStream::write (  const Array< char > &    b )  [virtual]
 

Writes the whole array b to the output stream.

Since String is derived from Array<char> in libRT, you may also use this method to write Strings to the output stream.

Returns:
Whether writing the array succeeded.

Reimplemented from lrt::OutputStream.


The documentation for this class was generated from the following files:
This is the RoboTour API documentation version 0.1 • Copyright (C) by Florian Fischer