22 #ifndef __PLUMED_tools_OFile_h
23 #define __PLUMED_tools_OFile_h
102 size_t llwrite(
const char*,
size_t);
122 unsigned findField(
const std::string&name)
const;
140 void backupFile(
const std::string& bstring,
const std::string& fname );
183 int printf(
const char*fmt,...);
std::string linePrefix
Prefix for line (e.g. "PLUMED: ")
unsigned findField(const std::string &name) const
Find field index given name.
OFile & rewind()
Rewind a file.
std::string backstring
The string used for backing up files.
void backupAllFiles(const std::string &str)
This backs up all the files that would have been created with the name str.
Class identifying a single field for fielded output.
OFile & fmtField()
Reset the format for writing double precision fields to its default.
A class for holding the value of a function together with its derivatives.
FileBase & link(FILE *)
Link to an already open filed.
char * buffer_string
Internal buffer for printf.
OFile & printField()
Close a line.
OFile & addConstantField(const std::string &)
std::vector< Field > previous_fields
All the previously defined variable fields.
std::ostringstream oss
Temporary ostringstream for << output.
int buflen
Internal buffer length.
size_t llwrite(const char *, size_t)
Low-level write.
OFile & link(OFile &)
Allows linking this OFile to another one.
int printf(const char *fmt,...)
Formatted output with explicit format - a la printf.
std::string fieldFmt
Format for fields writing.
FileBase & open(const std::string &name, const std::string &mode)
Opens the file (without auto-backup)
void backupFile(const std::string &bstring, const std::string &fname)
Backup a file by giving it a different name.
std::vector< Field > fields
All the defined variable fields.
friend OFile & operator<<(OFile &, const T &)
Formatted output with << operator.
OFile & clearFields()
Resets the list of fields.
unsigned actual_buffer_length
This variables stores the actual buffer length.
Base class for dealing with files.
bool fieldChanged
True if fields has changed.
char * buffer
Internal buffer (generic use)
std::vector< Field > const_fields
All the defined constant fields.
void setBackupString(const std::string &)
Set the string name to be used for automatic backup.
OFile & setLinePrefix(const std::string &)
Set the prefix for output.
OFile & open(const std::string &name)
Opens the file using automatic append/backup.
OFile * linked
Pointer to a linked OFile.
std::ostream & operator<<(std::ostream &log, const ActionRegister &ar)
OFile & setupPrintValue(Value *val)
Used to setup printing of values.