69 #ifndef functionObjects_writeFile_H 70 #define functionObjects_writeFile_H 80 namespace functionObjects
276 const string& property,
virtual OFstream & file()
Return access to the file (if only 1)
virtual ~writeFile()=default
Destructor.
A class for handling file names.
virtual bool canWriteToFile() const
Flag to allow writing to the file.
virtual void writeHeader(Ostream &os, const string &str) const
Write a commented header to stream.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
virtual void writeBreak(Ostream &os) const
Write a break marker to the stream.
virtual void resetFile(const word &name)
Reset internal file pointer to new file with new name.
void writeValue(Ostream &os, const Type &val) const
Write a given value to stream with the space delimiter.
writeFile(const objectRegistry &obr, const fileName &prefix, const word &name="undefined", const bool writeToFile=true)
Construct from objectRegistry, prefix, fileName.
Output to file stream as an OSstream, normally using std::ofstream for the actual output...
static label addChars
Additional characters for writing.
bool writtenHeader_
Flag to identify whether the header has been written.
virtual autoPtr< OFstream > newFile(const fileName &fName) const
Return autoPtr to a new file using file name.
class FOAM_DEPRECATED_FOR(2017-05, "Foam::Enum") NamedEnum
autoPtr< OFstream > filePtr_
File pointer.
fileName filePath(const fileName &fName) const
Return the full path for the supplied file name.
virtual bool canResetFile() const
Flag to allow resetting the file.
virtual void writeCommented(Ostream &os, const string &str) const
Write a commented string to stream.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
virtual bool canWriteHeader() const
Flag to allow writing the header.
void initStream(Ostream &os) const
Initialise the output stream for writing.
virtual autoPtr< OFstream > createFile(const word &name, scalar timeValue) const
Deprecated(2022-09) Return autoPtr to a new file for a given time.
A class for handling words, derived from Foam::string.
void operator=(const writeFile &)=delete
No copy assignment.
virtual bool writeToFile() const
Flag to allow writing to file.
fileName baseTimeDir() const
Return the base directory for the current time value.
virtual autoPtr< OFstream > newFileAtTime(const word &name, scalar timeValue) const
Return autoPtr to a new file for a given time.
virtual label charWidth() const
Return width of character stream output.
label writePrecision_
Write precision.
void writeHeaderValue(Ostream &os, const string &property, const Type &value) const
Write a (commented) header property and value pair.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Istream and Ostream manipulators taking arguments.
OBJstream os(runTime.globalPath()/outputName)
virtual autoPtr< OFstream > newFileAtStartTime(const word &name) const
Return autoPtr to a new file using the simulation start time.
virtual bool read(const dictionary &dict)
Read.
virtual void writeCurrentTime(Ostream &os) const
Write the current time to stream.
bool writeToFile_
Flag to enable/disable writing to file.
fileName baseFileDir() const
Return the base directory for output.
Omanip< int > valueWidth(const label offset=0) const
Return the value width when writing to stream with optional offset.
scalar startTime_
Start time value.
bool useUserTime_
Flag to use the specified user time, e.g. CA deg instead of seconds. Default = true.
const objectRegistry & fileObr_
Reference to the region objectRegistry.
bool updateHeader_
Flag to update the header, e.g. on mesh changes. Default is true.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Registry of regIOobjects.
Base class for writing single files from the function objects.
word fileName_
Name of file.
const fileName prefix_
Prefix.
An Ostream manipulator taking arguments.
virtual void writeTabbed(Ostream &os, const string &str) const
Write a tabbed string to stream.