114 if (!str || len <= 0)
return *
this;
116 const char* last = (str + len);
120 os_ << std::string_view(str, len);
124 lineNumber_ += std::count(str, last,
'\n');
135 unsigned backslash = 0;
136 for (
auto iter = str; iter != last; ++iter)
138 const char c = *iter;
176 if (!str)
return *
this;
178 const char* last = (str + strlen(str));
255 beginRawWrite(count);
268 <<
"stream format not binary"
289 std::streamsize count
295 os_.
write(data, count);
303 for (
unsigned short i = 0; i < indentLevel_*indentSize_; ++i)
334 return os_.fill(fillch);
352 return os_.precision();
358 return os_.precision(
p);
label lineNumber_
The file line.
virtual void flush() override
Flush stream.
virtual Ostream & writeQuoted(const char *str, std::streamsize len, const bool quoted=true) override
Write character/string content, with/without surrounding quotes.
virtual void indent() override
Add indentation characters.
virtual char fill() const override
Get the current padding character.
virtual int precision() const override
Get precision of output field.
virtual Ostream & writeRaw(const char *data, std::streamsize count) override
Low-level raw binary output.
virtual bool beginRawWrite(std::streamsize count) override
Begin marker for low-level raw binary output.
void syncState()
Set stream state to match that of the std::ostream.
virtual bool endRawWrite() override
End marker for low-level raw binary output.
virtual void endl() override
Add newline and flush stream.
virtual bool write(const token &tok) override
Write token to stream or otherwise handle it.
virtual int width() const override
Get width of output field.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
unsigned short indentSize_
Number of spaces per indent level.
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
unsigned short indentLevel_
Current indent level.
A token holds an item read from Istream.
@ FLAG
stream flag (1-byte bitmask)
@ CHAR_DATA
String-variant: plain character content.
@ BEGIN_BLOCK
Begin block [isseparator].
@ END_BLOCK
End block [isseparator].
@ HASH
Hash - directive or start verbatim string.
@ BEGIN_LIST
Begin list [isseparator].
@ END_LIST
End list [isseparator].
const string & stringToken() const
Return const reference to the string contents.
tokenType type() const noexcept
Return the token type.
const word & wordToken() const
Return const reference to the word contents.
A class for handling words, derived from Foam::string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
const dimensionedScalar c
Speed of light in a vacuum.
errorManip< error > abort(error &err)
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
word format(conversionProperties.get< word >("format"))