Base class for dealing with files.
More...
#include <FileBase.h>
|
static std::string | appendSuffix (const std::string &path, const std::string &suffix) |
| Append suffix.
|
|
|
Action * | action |
| pointer to corresponding action. NULL if not linked
|
|
bool | cloned |
| Control closing on destructor.
|
|
Communicator * | comm |
| communicator. NULL if not set
|
|
bool | eof |
| Set to true when end of file is encountered.
|
|
bool | err |
| Set to true when error is encountered.
|
|
FILE * | fp |
| file pointer
|
|
void * | gzfp |
| zip file pointer.
|
|
bool | heavyFlush |
| Set to true if you want flush to be heavy (close/reopen)
|
|
std::string | mode |
| mode of the opened file
|
|
std::string | path |
| path of the opened file
|
|
PlumedMain * | plumed |
| pointer to main plumed object. NULL if not linked
|
|
Base class for dealing with files.
This class just provides things which are common among OFile and IFile
◆ FileBase() [1/2]
PLMD::FileBase::FileBase |
( |
const FileBase & | | ) |
|
|
privatedelete |
Copy constructor is disabled.
◆ FileBase() [2/2]
PLMD::FileBase::FileBase |
( |
| ) |
|
|
protected |
Private constructor.
In this manner one cannot instantiate a FileBase object
◆ ~FileBase()
PLMD::FileBase::~FileBase |
( |
| ) |
|
|
virtual |
Virtual destructor (allows inheritance)
◆ appendSuffix()
std::string PLMD::FileBase::appendSuffix |
( |
const std::string & | path, |
|
|
const std::string & | suffix ) |
|
static |
Append suffix.
It appends the desired suffix to the string. Notice that it conserves some suffix (e.g. gz/xtc/trr).
◆ close()
void PLMD::FileBase::close |
( |
| ) |
|
Closes the file Should be used only for explicitely opened files.
◆ enforceSuffix()
FileBase & PLMD::FileBase::enforceSuffix |
( |
const std::string & | suffix | ) |
|
Enforce suffix.
Overrides the one set in PlumedMain&
◆ FileExist()
bool PLMD::FileBase::FileExist |
( |
const std::string & | path | ) |
|
Check if the file exists.
◆ flush()
Flushes the file to disk.
Reimplemented in PLMD::OFile.
◆ getFILE()
FILE * PLMD::FileBase::getFILE |
( |
| ) |
const |
|
inline |
Get the underlying file pointer.
It might be null even if the file is open, e.g. when the file was open as a gzipped file.
◆ getMode()
std::string PLMD::FileBase::getMode |
( |
| ) |
const |
|
inline |
◆ getPath()
std::string PLMD::FileBase::getPath |
( |
| ) |
const |
|
inline |
◆ getSuffix()
std::string PLMD::FileBase::getSuffix |
( |
| ) |
const |
◆ isOpen()
bool PLMD::FileBase::isOpen |
( |
| ) |
|
◆ link() [1/4]
◆ link() [2/4]
◆ link() [3/4]
FileBase & PLMD::FileBase::link |
( |
FILE * | fp | ) |
|
Link to an already open filed.
◆ link() [4/4]
◆ open()
virtual FileBase & PLMD::FileBase::open |
( |
const std::string & | name | ) |
|
|
pure virtual |
◆ operator bool()
PLMD::FileBase::operator bool |
( |
| ) |
const |
◆ operator=()
Assignment operator is disabled.
◆ setHeavyFlush()
void PLMD::FileBase::setHeavyFlush |
( |
| ) |
|
|
inline |
◆ action
Action* PLMD::FileBase::action |
|
protected |
pointer to corresponding action. NULL if not linked
◆ cloned
bool PLMD::FileBase::cloned |
|
protected |
Control closing on destructor.
If true, file will not be closed in destructor
◆ comm
communicator. NULL if not set
◆ enforcedSuffix
std::string PLMD::FileBase::enforcedSuffix |
|
private |
◆ enforcedSuffix_
bool PLMD::FileBase::enforcedSuffix_ |
|
private |
If true, use enforcedSuffix, else get it from PlumedMain.
◆ eof
Set to true when end of file is encountered.
◆ err
Set to true when error is encountered.
◆ fp
◆ gzfp
void* PLMD::FileBase::gzfp |
|
protected |
◆ heavyFlush
bool PLMD::FileBase::heavyFlush |
|
protected |
Set to true if you want flush to be heavy (close/reopen)
◆ mode
std::string PLMD::FileBase::mode |
|
protected |
◆ path
std::string PLMD::FileBase::path |
|
protected |
◆ plumed
pointer to main plumed object. NULL if not linked
The documentation for this class was generated from the following files: