Go to the documentation of this file.
68 #define Foam_IOstream_extras
142 void setState(std::ios_base::iostate state) noexcept
150 ioState_ = std::ios_base::iostate(0);
172 ioState_(std::ios_base::iostate(0)),
174 sizeofLabel_(static_cast<unsigned char>(sizeof(label))),
199 virtual const fileName&
name()
const;
202 virtual fileName&
name();
215 virtual bool check(
const char* operation)
const;
222 bool opened() const noexcept
228 bool closed() const noexcept
234 bool good() const noexcept
240 bool eof() const noexcept
242 return ioState_ & std::ios_base::eofbit;
246 bool fail() const noexcept
248 return ioState_ & (std::ios_base::badbit | std::ios_base::failbit);
252 bool bad() const noexcept
254 return ioState_ & std::ios_base::badbit;
258 explicit operator bool() const noexcept
299 template<
class T = label>
300 typename std::enable_if<std::is_integral<T>::value,
bool>
::type
308 template<
class T = scalar>
309 typename std::enable_if<std::is_floating_point<T>::value,
bool>
::type
340 virtual ios_base::fmtflags
flags()
const = 0;
376 virtual ios_base::fmtflags
flags(
const ios_base::fmtflags
f) = 0;
379 ios_base::fmtflags
setf(
const ios_base::fmtflags
f)
385 ios_base::fmtflags
setf
387 const ios_base::fmtflags
f,
388 const ios_base::fmtflags mask
395 void unsetf(
const ios_base::fmtflags
f)
404 virtual void print(Ostream&
os)
const;
407 void print(Ostream&
os,
const int streamState)
const;
424 Ostream&
operator<<(Ostream&
os,
const InfoProxy<IOstream>& ip);
@ UNCOMPRESSED
compression = false
unsigned char sizeofLabel_
unsigned char sizeofScalar_
IOstream(const IOstream &)=default
A helper class for outputting values to Ostream.
A class for handling file names.
void setLabelByteSize(unsigned nbytes) noexcept
constexpr IOstreamOption(streamFormat fmt=streamFormat::ASCII, compressionType comp=compressionType::UNCOMPRESSED) noexcept
IOstream &(* IOstreamManip)(IOstream &)
virtual void print(Ostream &os) const
bool fatalCheck(const char *operation) const
An IOstream is an abstract base class for all input/output systems; be they streams,...
void setScalarByteSize(unsigned nbytes) noexcept
label lineNumber() const noexcept
IOstream & oct(IOstream &io)
virtual ~IOstream()=default
static unsigned int precision_
void setOpened() noexcept
bool closed() const noexcept
bool good() const noexcept
unsigned labelByteSize() const noexcept
Ostream & operator<<(Ostream &, const boundaryPatch &p)
std::enable_if< std::is_integral< T >::value, bool >::type checkLabelSize() const noexcept
virtual const fileName & name() const
IOstream(IOstreamOption streamOpt=IOstreamOption())
IOstream & dec(IOstream &io)
std::ios_base::iostate ioState_
bool eof() const noexcept
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
The IOstreamOption is a simple container for options an IOstream can normally have.
bool opened() const noexcept
InfoProxy< IOstream > info() const
bool operator!() const noexcept
std::enable_if< std::is_floating_point< T >::value, bool >::type checkScalarSize() const noexcept
void setClosed() noexcept
IOstream & fixed(IOstream &io)
virtual bool check(const char *operation) const
OBJstream os(runTime.globalPath()/outputName)
fileName relativeName() const
bool bad() const noexcept
IOstream & scientific(IOstream &io)
static fileName staticName_
@ OPENED
The stream is open.
IOstream & hex(IOstream &io)
ios_base::fmtflags setf(const ios_base::fmtflags f)
virtual ios_base::fmtflags flags() const =0
void setState(std::ios_base::iostate state) noexcept
static unsigned int defaultPrecision() noexcept
void unsetf(const ios_base::fmtflags f)
static unsigned int defaultPrecision(unsigned int prec) noexcept
label lineNumber(const label num) noexcept
fileName::Type type(const fileName &name, const bool followLink=true)
@ CLOSED
The stream is not open.
unsigned scalarByteSize() const noexcept
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
label & lineNumber() noexcept
A character and a pointer to a character string.
bool fail() const noexcept