Friedrich-Alexander-Universität Erlangen-Nürnberg  /   Technische Fakultät  /   Department Informatik

Write text into file. More...

#include <test-stream/file_out.h>

+ Inheritance diagram for FileOut:
+ Collaboration diagram for FileOut:

Public Member Functions

 FileOut (const char *path)
 Constructor. More...
 
virtual ~FileOut ()
 Destructor. More...
 
const char * getPath ()
 Get path of the output file. More...
 
virtual void flush () override
 Write the string to the open file. More...
 
- Public Member Functions inherited from OutputStream
- Public Member Functions inherited from Stringbuffer

Static Public Member Functions

static int count ()
 Number of output files which are currently opened (with this class) More...
 

Additional Inherited Members

- Public Attributes inherited from OutputStream
- Protected Member Functions inherited from Stringbuffer
- Protected Attributes inherited from Stringbuffer

Detailed Description

Write text into file.

This class allows a comfortable output to a file only by using the elementary system calls open() / write() / close() and (optional) fsync(). The class is derived from OutputStream.

Constructor & Destructor Documentation

◆ FileOut()

FileOut::FileOut ( const char *  path)
explicit

Constructor.

Opens the file for writing using the system call open().

Parameters
pathPath to the output file
Todo:
Implement constructor

◆ ~FileOut()

FileOut::~FileOut ( )
virtual

Destructor.

Close the output file (using the system call close())

Todo:
Implement destructor

Member Function Documentation

◆ getPath()

const char * FileOut::getPath ( )

Get path of the output file.

Returns
Path to output file (as defined in constructor)
Todo:
Implement Method

◆ count()

int FileOut::count ( )
static

Number of output files which are currently opened (with this class)

Returns
Number of active files
Todo:
Implement Method

◆ flush()

void FileOut::flush ( )
overridevirtual

Write the string to the open file.

The implementation should only use the system calls write() and fsync().

Todo:
Implement virtual Method

Implements OutputStream.


The documentation for this class was generated from the following files: