Creates and manages an input/output file stream with specified format. More...
Public Member Functions | |
fileStream (const fileSystem &path, bool outStream=false, bool binary=false, bool append=false) | |
From file path and input type and format. More... | |
fileStream (const fileStream &)=delete | |
No copy. More... | |
fileStream & | operator= (const fileStream &)=delete |
No assignment. More... | |
virtual | ~fileStream () |
Destructor. More... | |
std::ifstream & | inStream () |
Access input file stream. More... | |
std::ofstream & | outStream () |
Access output file stream. More... | |
Protected Member Functions | |
void | openInFile (const fileSystem &path) |
open input file More... | |
void | openOutFile (const fileSystem &path) |
open output file More... | |
void | close () |
close streams More... | |
Protected Attributes | |
uniquePtr< std::ifstream > | inStream_ |
in file stream More... | |
uniquePtr< std::ofstream > | outStream_ |
out file stream More... | |
bool | binary_ = false |
bool | append_ = false |
Creates and manages an input/output file stream with specified format.
It is based on OpenFOAM stream, with some modifications/simplifications to be tailored to our needs.
Definition at line 43 of file fileStream.hpp.
fileStream | ( | const fileSystem & | path, |
bool | outStream = false , |
||
bool | binary = false , |
||
bool | append = false |
||
) |
From file path and input type and format.
Definition at line 120 of file fileStream.cpp.
|
delete |
No copy.
|
inlinevirtual |
Destructor.
Definition at line 80 of file fileStream.hpp.
References fileStream::close().
|
protected |
open input file
Definition at line 27 of file fileStream.cpp.
References fileSystem::exist(), fatalErrorInFunction, fatalExit, and fileSystem::wordPath().
|
protected |
open output file
Definition at line 58 of file fileStream.cpp.
References fileSystem::createDirs(), fileSystem::dirPath(), fatalErrorInFunction, fatalExit, and fileSystem::wordPath().
|
protected |
close streams
Definition at line 106 of file fileStream.cpp.
References fileStream::inStream_, and fileStream::outStream_.
Referenced by fileStream::~fileStream().
|
delete |
No assignment.
std::ifstream & inStream | ( | ) |
Access input file stream.
Definition at line 143 of file fileStream.cpp.
std::ofstream & outStream | ( | ) |
Access output file stream.
Definition at line 148 of file fileStream.cpp.
|
protected |
|
protected |
|
protected |
Definition at line 53 of file fileStream.hpp.
|
protected |
Definition at line 55 of file fileStream.hpp.