chrono::ChStreamFile Class Reference

Description

This is a base class for typical output on system's file, on a disk, using the typical C++ 'fstream' handler.

#include <ChStream.h>

Inheritance diagram for chrono::ChStreamFile:

Public Member Functions

 ChStreamFile (const char *filename, std::ios::openmode mmode)
 Creates a system file, like the C++ fstream, and opens it, given filename on disk, and the opening mode (ex: std::ios::out or std::ios::in)
 
virtual ~ChStreamFile ()
 Destruction means that the file stream is also closed.
 
virtual void Flush ()
 Synchronizes the associated stream buffer with its controlled output sequence.
 
virtual void Write (const char *data, size_t n)
 Writes to file, up to n chars. More...
 
virtual void Read (char *data, size_t n)
 Reads from file, up to n chars. More...
 
virtual bool End_of_stream ()
 Returns true if end of stream reached.
 
std::fstream & GetFstream ()
 Reference to fstream encapsulated here.
 

Member Function Documentation

◆ Read()

void chrono::ChStreamFile::Read ( char *  data,
size_t  n 
)
virtual

Reads from file, up to n chars.

If does not succeed, throws exception.

◆ Write()

void chrono::ChStreamFile::Write ( const char *  data,
size_t  n 
)
virtual

Writes to file, up to n chars.

If does not succeed, throws exception.


The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono/core/ChStream.h
  • /builds/uwsbel/chrono/src/chrono/core/ChStream.cpp