Go to the documentation of this file.
29 const word& streamName,
41 os_.precision(precision_);
45 setState(os_.rdstate());
57 case token::tokenType::FLAG :
63 case token::tokenType::VARIABLE :
85 setState(os_.rdstate());
94 setState(os_.rdstate());
102 setState(os_.rdstate());
119 setState(os_.rdstate());
127 unsigned backslash = 0;
128 for (
auto iter = str.cbegin(); iter != str.cend(); ++iter)
130 const char c = *iter;
161 setState(os_.rdstate());
170 setState(os_.rdstate());
178 setState(os_.rdstate());
185 setState(os_.rdstate());
192 setState(os_.rdstate());
199 setState(os_.rdstate());
206 setState(os_.rdstate());
213 setState(os_.rdstate());
221 setState(os_.rdstate());
228 setState(os_.rdstate());
234 const char* binaryData,
235 std::streamsize
count
246 os_.write(binaryData,
count);
254 write(
static_cast<char>(255));
255 write(
static_cast<char>(255));
256 write(
static_cast<char>(255));
257 write(
static_cast<char>(0));
263 os_.seekp(pos, std::ios_base::cur);
268 for (
unsigned short i = 0; i < indentLevel_*indentSize_; ++i)
282 os_.seekp(0, std::ios_base::end);
320 return os_.fill(fillch);
338 return os_.precision();
344 return os_.precision(p);
iOstream & writeQuoted(const word &str, const bool quoted=true) override
Write std::string surrounded by quotes.
virtual ios_base::fmtflags flags() const
Return flags of output stream.
void flush() override
Flush stream.
tokenType type() const
Return the token type.
#define fatalExit
Fatal exit.
Token class based on OpenFOAM stream, with some modifications/simplifications to be tailored to our n...
void indent() override
Add indentation characters.
int width() const override
Get width of output field.
void endOfBinaryStreaming() override
Reach end of file add a new line and flush stream.
char fill() const override
Get the current padding character.
iOstream & flush(iOstream &os)
Flush stream.
iOstream & endl(iOstream &os)
Add newline and flush stream.
int precision() const override
Get precision of output field.
void endl() override
Add newline and flush stream.
void startOfBinaryStreaming() override
Add a new line and flush stream.
#define fatalErrorInFunction
Report a fatal error and function name and exit the application.
iOstream & writeBinaryBlockFlag() override
Write the flag to indicate the start of a binary block.
@ BEGIN_STRING
Divide [isseparator].
@ END_LIST
Begin list [isseparator].
void seek(size_t pos) override
auto count(const Vector< T, Allocator > &vec, const T &val)
Ostream(std::ostream &os, const word &streamName, writeFormat wf=ASCII)
Construct from components.
@ BEGIN_LIST
End entry [isseparator].
unsigned long long int uint64
@ END_STRING
Begin string with double quote.
bool write(const token &tok) override
Write token to stream or otherwise handle it.
Interface class for any output stream.
int32 countChar(const word &s, const char c)
Count numer of chars c in a word.
const word & wordToken() const
Return const reference to the word contents.