45 #ifndef Foam_IOstream_H 46 #define Foam_IOstream_H 68 #define Foam_IOstream_extras 174 sizeofLabel_(static_cast<unsigned char>(sizeof(label))),
211 virtual bool check(
const char* operation)
const;
238 return ioState_ & std::ios_base::eofbit;
244 return ioState_ & (std::ios_base::badbit | std::ios_base::failbit);
250 return ioState_ & std::ios_base::badbit;
254 explicit operator bool() const
noexcept 295 template<
class T = label>
296 typename std::enable_if<std::is_integral<T>::value,
bool>
::type 304 template<
class T = scalar>
305 typename std::enable_if<std::is_floating_point<T>::value,
bool>
::type 336 virtual ios_base::fmtflags
flags()
const = 0;
372 virtual ios_base::fmtflags
flags(
const ios_base::fmtflags
f) = 0;
375 ios_base::fmtflags
setf(
const ios_base::fmtflags
f)
381 ios_base::fmtflags
setf 383 const ios_base::fmtflags
f,
384 const ios_base::fmtflags mask
420 Ostream& operator<<(Ostream& os, const InfoProxy<IOstream>& ip);
477 template<
class OS>
inline void outputLoop(OS&) {}
480 template<
class IS,
class Type,
class... Args>
488 template<
class OS,
class Type,
class... Args>
label lineNumber_
The file line.
bool opened() const noexcept
True if stream has been opened.
fileName relativeName() const
Return the name of the stream relative to the current case.
bool operator!() const noexcept
Return true if the stream has failed.
void setFail() noexcept
Set stream state as 'failed'.
A class for handling file names.
bool bad() const noexcept
True if stream is corrupted.
virtual const fileName & name() const
The name of the stream.
std::enable_if< std::is_floating_point< T >::value, bool >::type checkScalarSize() const noexcept
Check if the scalar byte-size associated with the stream is the same as the given type...
void setClosed() noexcept
Set stream closed.
compressionType
Compression treatment (UNCOMPRESSED | COMPRESSED)
ios_base::fmtflags setf(const ios_base::fmtflags f)
Set flags of stream.
IOstream & hex(IOstream &io)
virtual bool check(const char *operation) const
Check IOstream status for given operation.
void setState(std::ios_base::iostate state) noexcept
Set stream state.
virtual ios_base::fmtflags flags() const =0
Return flags of stream.
streamAccess openClosed_
The stream open/closed state.
streamAccess
Enumeration for stream open/closed state.
static fileName staticName_
Name for any generic stream - normally treat as readonly.
void unsetf(const ios_base::fmtflags f)
Unset flags of stream.
static unsigned int defaultPrecision() noexcept
Return the default precision.
A simple container for options an IOstream can normally have.
IOstream & fixed(IOstream &io)
unsigned scalarByteSize() const noexcept
The sizeof (scalar) in bytes associated with the stream.
IOstream & oct(IOstream &io)
constexpr IOstreamOption(streamFormat fmt=streamFormat::ASCII, compressionType comp=compressionType::UNCOMPRESSED) noexcept
Default construct (ASCII, UNCOMPRESSED, currentVersion) or construct with format, compression...
A character and a pointer to a character string.
void setBad()
Set stream state to be 'bad'.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
IOstream(const IOstream &)=default
Copy construct.
void setLabelByteSize(unsigned nbytes) noexcept
Set the sizeof (label) in bytes associated with the stream.
void inputLoop(IS &)
Termination for input looping (no-op)
unsigned char sizeofLabel_
The sizeof (label), possibly read from the header.
bool fail() const noexcept
True if next operation will fail.
unsigned char sizeofScalar_
The sizeof (scalar), possibly read from the header.
Representation of a major/minor version number.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
virtual void print(Ostream &os) const
Print stream description to Ostream.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
label lineNumber() const noexcept
Const access to the current stream line number.
virtual ~IOstream()=default
Destructor.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
An IOstream is an abstract base class for all input/output systems; be they streams, files, token lists etc.
static unsigned int precision_
Default precision.
bool fatalCheck(const char *operation) const
Check IOstream status for given operation.
A helper class for outputting values to Ostream.
void setScalarByteSize(unsigned nbytes) noexcept
Set the sizeof (scalar) in bytes associated with the stream.
bool closed() const noexcept
True if stream is closed.
bool good() const noexcept
True if next operation might succeed.
streamFormat
Data format (ascii | binary)
void setOpened() noexcept
Set stream opened.
IOstream & dec(IOstream &io)
std::enable_if< std::is_integral< T >::value, bool >::type checkLabelSize() const noexcept
Check if the label byte-size associated with the stream is the same as the given type.
void setEof() noexcept
Set stream state as reached 'eof'.
void setGood() noexcept
Set stream state to be good.
Foam::argList args(argc, argv)
void outputLoop(OS &)
Termination for output looping (no-op)
unsigned labelByteSize() const noexcept
The sizeof (label) in bytes associated with the stream.
bool eof() const noexcept
True if end of input seen.
IOstream &(* IOstreamManip)(IOstream &)
An IOstream manipulator.
InfoProxy< IOstream > info() const
Return info proxy.
IOstream & scientific(IOstream &io)
std::ios_base::iostate ioState_
Mirror of internal stream io state.