60 const bool ok = !bad();
65 <<
"error in IOstream " << relativeName()
66 <<
" for operation " << operation
76 const bool ok = this->checkNativeSizes();
81 <<
"Error in stream: " << relativeName()
82 <<
" for operation " << operation <<
nl
83 <<
"Expecting (label=" << (8*
sizeof(label))
84 <<
";scalar=" << (8*
sizeof(scalar))
85 <<
") found (label=" << (8*this->labelByteSize())
86 <<
";scalar=" << (8*this->scalarByteSize()) <<
')' <<
nl
96 os <<
"IOstream: " <<
"Version " << version() <<
", format "
97 <<
format() <<
", line " << lineNumber();
135 if (streamState == std::ios_base::goodbit)
137 os <<
"goodbit set : the last operation on stream succeeded" <<
endl;
139 else if (streamState & std::ios_base::badbit)
141 os <<
"badbit set : characters possibly lost" <<
endl;
143 else if (streamState & std::ios_base::failbit)
145 os <<
"failbit set : some type of formatting error" <<
endl;
147 else if (streamState & std::ios_base::eofbit)
149 os <<
"eofbit set : at end of stream" <<
endl;
157Foam::Ostream& Foam::operator<<
versionNumber version() const noexcept
Get the stream version.
bool fail() const noexcept
True if next operation will fail.
label lineNumber() const noexcept
Const access to the current stream line number.
bool fatalCheck(const char *operation) const
Check IOstream status for given operation.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
unsigned scalarByteSize() const noexcept
The sizeof (scalar) in bytes associated with the stream.
bool good() const noexcept
True if next operation might succeed.
bool bad() const noexcept
True if stream is corrupted.
bool opened() const noexcept
True if stream has been opened.
virtual void print(Ostream &os) const
Print stream description to Ostream.
virtual const fileName & name() const
The name of the stream.
bool eof() const noexcept
True if end of input seen.
bool checkNativeSizes() const noexcept
Test if the label/scalar byte-size associated with the stream are the native label/scalar sizes.
bool fatalCheckNativeSizes(const char *operation) const
Assert that the label/scalar byte-size associated with the stream are the native label/scalar sizes.
static fileName staticName_
Name for any generic stream - normally treat as readonly.
bool closed() const noexcept
True if stream is closed.
unsigned labelByteSize() const noexcept
The sizeof (label) in bytes associated with the stream.
fileName relativeName() const
Return the name of the stream relative to the current case.
A helper class for outputting values to Ostream.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
static fileName envRelativePath(const fileName &input, const bool caseTag=false)
Return the input relative to the globalPath by stripping off a leading value of the envGlobalPath.
A class for handling file names.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
OBJstream os(runTime.globalPath()/outputName)
Ostream & endl(Ostream &os)
Add newline and flush stream.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a).
word format(conversionProperties.get< word >("format"))