39 #ifndef Foam_OSstream_H 40 #define Foam_OSstream_H 86 const string& streamName,
94 const string& streamName,
106 const string& streamName,
122 virtual const fileName&
name()
const override {
return name_; }
133 virtual const std::ostream&
stdStream()
const {
return os_; }
136 virtual std::ostream&
stdStream() {
return os_; }
142 virtual std::ios_base::fmtflags
flags()
const override 148 virtual std::ios_base::fmtflags
flags 150 std::ios_base::fmtflags
f 170 virtual bool write(
const token& tok)
override;
180 const bool quoted=
true 193 virtual Ostream&
write(
const std::string& str)
override;
211 std::streamsize
count 218 std::streamsize
count 230 virtual void indent()
override;
236 virtual void flush()
override;
239 virtual void endl()
override;
242 virtual char fill()
const override;
246 virtual char fill(
const char fillch)
override;
249 virtual int width()
const override;
253 virtual int width(
const int w)
override;
Generic output stream using a standard (STL) stream.
A class for handling file names.
compressionType
Compression treatment (UNCOMPRESSED | COMPRESSED)
void setState(std::ios_base::iostate state) noexcept
Set stream state.
virtual Ostream & writeQuoted(const char *str, std::streamsize len, const bool quoted=true) override
Write character/string content, with/without surrounding quotes.
void syncState()
Set stream state to match that of the std::ostream.
A token holds an item read from Istream.
virtual void endl() override
Add newline and flush stream.
virtual std::ios_base::fmtflags flags() const override
Get current stream flags.
A simple container for options an IOstream can normally have.
virtual Ostream & writeRaw(const char *data, std::streamsize count) override
Low-level raw binary output.
virtual const fileName & name() const override
Get the name of the output serial stream. (eg, the name of the Fstream file name) ...
virtual Ostream & writeQuoted(const char *str, std::streamsize len, const bool quoted=true)=0
Write character/string content, with/without surrounding quotes.
constexpr IOstreamOption(streamFormat fmt=streamFormat::ASCII, compressionType comp=compressionType::UNCOMPRESSED) noexcept
Default construct (ASCII, UNCOMPRESSED, currentVersion) or construct with format, compression...
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
virtual int precision() const override
Get precision of output field.
A class for handling words, derived from Foam::string.
virtual bool beginRawWrite(std::streamsize count) override
Begin marker for low-level raw binary output.
virtual bool endRawWrite() override
End marker for low-level raw binary output.
Representation of a major/minor version number.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
virtual bool write(const token &tok) override
Write token to stream or otherwise handle it.
OBJstream os(runTime.globalPath()/outputName)
virtual const std::ostream & stdStream() const
Const access to underlying std::ostream.
virtual void indent() override
Add indentation characters.
const dimensionedScalar c
Speed of light in a vacuum.
streamFormat
Data format (ascii | binary)
virtual void print(Ostream &os) const override
Print stream description to Ostream.
virtual void flush() override
Flush stream.
void operator=(const OSstream &)=delete
No copy assignment.
virtual int width() const override
Get width of output field.
virtual char fill() const override
Get the current padding character.
OSstream(const OSstream &)=default
Copy construct.