A simple output token stream that can be used to build token lists. Always UNCOMPRESSED. More...
Public Member Functions | |
OTstream (IOstreamOption streamOpt=IOstreamOption()) | |
OTstream (const OTstream &os) | |
OTstream (OTstream &&os) | |
~OTstream ()=default | |
const DynamicList< token > & | tokens () const |
DynamicList< token > & | tokens () |
virtual bool | write (const token &tok) |
virtual Ostream & | write (const char c) |
virtual Ostream & | write (const char *str) |
virtual Ostream & | write (const word &str) |
virtual Ostream & | write (const string &str) |
virtual Ostream & | writeQuoted (const std::string &str, const bool quoted=true) |
virtual Ostream & | write (const int32_t val) |
virtual Ostream & | write (const int64_t val) |
virtual Ostream & | write (const floatScalar val) |
virtual Ostream & | write (const doubleScalar val) |
virtual Ostream & | write (const char *data, std::streamsize count) |
virtual Ostream & | writeRaw (const char *data, std::streamsize count) |
virtual bool | beginRawWrite (std::streamsize count) |
virtual bool | endRawWrite () |
virtual void | indent () |
virtual ios_base::fmtflags | flags () const |
std::ios_base::fmtflags | flags (const ios_base::fmtflags) |
virtual void | flush () |
virtual void | endl () |
virtual char | fill () const |
virtual char | fill (const char) |
virtual int | width () const |
virtual int | width (const int) |
virtual int | precision () const |
virtual int | precision (const int) |
void | reset () |
virtual void | rewind () |
void | print (Ostream &os) const |
![]() | |
Ostream (const Ostream &)=default | |
virtual | ~Ostream ()=default |
Ostream (IOstreamOption streamOpt=IOstreamOption()) | |
Ostream (IOstreamOption::streamFormat fmt, IOstreamOption::versionNumber ver=IOstreamOption::currentVersion, IOstreamOption::compressionType cmp=IOstreamOption::UNCOMPRESSED) | |
virtual Ostream & | write (const keyType &kw) |
unsigned short | indentSize () const noexcept |
unsigned short | indentSize (unsigned short val) noexcept |
unsigned short | indentLevel () const noexcept |
unsigned short | indentLevel (unsigned short val) noexcept |
void | incrIndent () noexcept |
void | decrIndent () |
virtual Ostream & | writeKeyword (const keyType &kw) |
virtual Ostream & | beginBlock (const keyType &kw) |
virtual Ostream & | beginBlock () |
virtual Ostream & | endBlock () |
virtual Ostream & | endEntry () |
template<class T > | |
Ostream & | writeEntry (const keyType &key, const T &value) |
template<class T > | |
Ostream & | writeEntryIfDifferent (const word &key, const T &value1, const T &value2) |
Ostream & | operator() () const |
unsigned short & | indentLevel () noexcept |
unsigned short & | indentSize () noexcept |
![]() | |
IOstream (const IOstream &)=default | |
virtual | ~IOstream ()=default |
IOstream (IOstreamOption streamOpt=IOstreamOption()) | |
IOstream (IOstreamOption::streamFormat fmt, IOstreamOption::versionNumber ver, IOstreamOption::compressionType cmp=IOstreamOption::UNCOMPRESSED) | |
virtual const fileName & | name () const |
virtual fileName & | name () |
fileName | relativeName () const |
virtual bool | check (const char *operation) const |
bool | fatalCheck (const char *operation) const |
bool | opened () const noexcept |
bool | closed () const noexcept |
bool | good () const noexcept |
bool | eof () const noexcept |
bool | fail () const noexcept |
bool | bad () const noexcept |
operator bool () const noexcept | |
bool | operator! () const noexcept |
unsigned | labelByteSize () const noexcept |
unsigned | scalarByteSize () const noexcept |
void | setLabelByteSize (unsigned nbytes) noexcept |
void | setScalarByteSize (unsigned nbytes) noexcept |
template<class T = label> | |
std::enable_if< std::is_integral< T >::value, bool >::type | checkLabelSize () const noexcept |
template<class T = scalar> | |
std::enable_if< std::is_floating_point< T >::value, bool >::type | checkScalarSize () const noexcept |
label | lineNumber () const noexcept |
label & | lineNumber () noexcept |
label | lineNumber (const label num) noexcept |
void | setEof () noexcept |
void | setFail () noexcept |
void | setBad () |
ios_base::fmtflags | setf (const ios_base::fmtflags f) |
ios_base::fmtflags | setf (const ios_base::fmtflags f, const ios_base::fmtflags mask) |
void | unsetf (const ios_base::fmtflags f) |
void | print (Ostream &os, const int streamState) const |
InfoProxy< IOstream > | info () const |
![]() | |
constexpr | IOstreamOption (streamFormat fmt=streamFormat::ASCII, compressionType comp=compressionType::UNCOMPRESSED) noexcept |
constexpr | IOstreamOption (streamFormat fmt, compressionType comp, versionNumber ver) noexcept |
constexpr | IOstreamOption (streamFormat fmt, versionNumber ver, compressionType comp=compressionType::UNCOMPRESSED) noexcept |
IOstreamOption (const IOstreamOption &opt, streamFormat fmt) noexcept | |
streamFormat | format () const noexcept |
streamFormat | format (const streamFormat fmt) noexcept |
streamFormat | format (const word &formatName) |
compressionType | compression () const noexcept |
compressionType | compression (const compressionType comp) noexcept |
compressionType | compression (const word &compName) |
versionNumber | version () const noexcept |
versionNumber | version (const versionNumber ver) noexcept |
versionNumber | version (const token &tok) |
![]() | |
constexpr | DynamicList () noexcept |
DynamicList (const label len) | |
DynamicList (const label len, const T &val) | |
DynamicList (const label len, const Foam::zero) | |
DynamicList (const DynamicList< T, SizeMin > &lst) | |
DynamicList (const DynamicList< T, AnySizeMin > &lst) | |
DynamicList (const UList< T > &lst) | |
DynamicList (const FixedList< T, N > &lst) | |
DynamicList (std::initializer_list< T > lst) | |
DynamicList (const IndirectListBase< T, Addr > &lst) | |
DynamicList (DynamicList< T, SizeMin > &&lst) | |
DynamicList (DynamicList< T, AnySizeMin > &&lst) | |
DynamicList (List< T > &&lst) | |
DynamicList (SortableList< T > &&lst) | |
DynamicList (Istream &is) | |
label | capacity () const noexcept |
std::streamsize | capacity_bytes () const noexcept |
void | setCapacity (const label len) |
void | setCapacity_nocopy (const label len) |
void | setCapacity_unsafe (const label len) noexcept |
void | reserve (const label len) |
void | reserve_nocopy (const label len) |
void | resize (const label len) |
void | resize (const label len, const T &val) |
void | resize_nocopy (const label len) |
void | setSize (const label n) |
void | setSize (const label n, const T &val) |
void | clear () noexcept |
void | clearStorage () |
label | expandStorage () noexcept |
void | shrinkStorage () |
DynamicList< T, SizeMin > & | shrink () |
void | swap (DynamicList< T, AnySizeMin > &other) |
void | transfer (List< T > &list) |
void | transfer (DynamicList< T, AnySizeMin > &list) |
void | transfer (SortableList< T > &list) |
DynamicList< T, SizeMin > & | append (const T &val) |
DynamicList< T, SizeMin > & | append (T &&val) |
DynamicList< T, SizeMin > & | append (const UList< T > &lst) |
DynamicList< T, SizeMin > & | append (const FixedList< T, N > &lst) |
DynamicList< T, SizeMin > & | append (std::initializer_list< T > lst) |
DynamicList< T, SizeMin > & | append (const IndirectListBase< T, Addr > &lst) |
DynamicList< T, SizeMin > & | append (List< T > &&lst) |
DynamicList< T, SizeMin > & | append (DynamicList< T, SizeMin > &&lst) |
DynamicList< T, SizeMin > & | append (DynamicList< T, AnySizeMin > &&lst) |
DynamicList< T, SizeMin > & | append (SortableList< T > &&lst) |
Foam::DynamicList< T, SizeMin > & | append (const FixedList< T, N > &lst) |
Foam::DynamicList< T, SizeMin > & | append (const IndirectListBase< T, Addr > &lst) |
Foam::DynamicList< T, SizeMin > & | append (DynamicList< T, AnySizeMin > &&lst) |
label | appendUniq (const T &val) |
T | remove () |
T | remove (const label idx, const bool fast=false) |
label | remove (const labelRange &range) |
label | remove (std::initializer_list< label > start_size) |
label | subset (const labelRange &range) |
label | subset (std::initializer_list< label > start_size) |
T & | operator() (const label i) |
void | operator= (const T &val) |
void | operator= (const Foam::zero) |
void | operator= (const UList< T > &lst) |
void | operator= (const FixedList< T, N > &lst) |
void | operator= (const DynamicList< T, SizeMin > &lst) |
void | operator= (const DynamicList< T, AnySizeMin > &lst) |
void | operator= (std::initializer_list< T > lst) |
void | operator= (const IndirectListBase< T, Addr > &lst) |
void | operator= (List< T > &&lst) |
void | operator= (DynamicList< T, SizeMin > &&lst) |
void | operator= (DynamicList< T, AnySizeMin > &&lst) |
void | operator= (SortableList< T > &&lst) |
Istream & | readList (Istream &is) |
Additional Inherited Members | |
![]() | |
enum | streamAccess : char { CLOSED = 0, OPENED } |
![]() | |
enum | streamFormat : char { ASCII = 0, BINARY } |
enum | compressionType : char { UNCOMPRESSED = 0, COMPRESSED } |
![]() | |
static unsigned int | defaultPrecision () noexcept |
static unsigned int | defaultPrecision (unsigned int prec) noexcept |
![]() | |
static streamFormat | formatEnum (const word &formatName, const streamFormat deflt=streamFormat::ASCII) |
static streamFormat | formatEnum (const word &key, const dictionary &dict, const streamFormat deflt=streamFormat::ASCII) |
static compressionType | compressionEnum (const word &compName, const compressionType deflt=compressionType::UNCOMPRESSED) |
static compressionType | compressionEnum (const word &key, const dictionary &dict, const compressionType deflt=compressionType::UNCOMPRESSED) |
![]() | |
static constexpr label | min_size () noexcept |
![]() | |
static unsigned int | precision_ |
![]() | |
static const Enum< streamFormat > | formatNames |
static const versionNumber | currentVersion |
![]() | |
void | setOpened () noexcept |
void | setClosed () noexcept |
void | setState (std::ios_base::iostate state) noexcept |
void | setGood () noexcept |
![]() | |
unsigned short | indentSize_ = 4 |
unsigned short | indentLevel_ = 0 |
![]() | |
std::ios_base::iostate | ioState_ |
streamAccess | openClosed_ |
unsigned char | sizeofLabel_ |
unsigned char | sizeofScalar_ |
label | lineNumber_ |
![]() | |
static constexpr const unsigned short | entryIndentation_ = 16 |
![]() | |
static fileName | staticName_ |
A simple output token stream that can be used to build token lists. Always UNCOMPRESSED.
Definition at line 52 of file OTstream.H.
|
inlineexplicit |
Definition at line 62 of file OTstream.H.
References IOstream::setGood(), and IOstream::setOpened().
Definition at line 72 of file OTstream.H.
References IOstream::setGood(), and IOstream::setOpened().
Definition at line 82 of file OTstream.H.
References IOstream::setGood(), and IOstream::setOpened().
|
default |
|
inline |
Definition at line 99 of file OTstream.H.
|
inline |
Definition at line 105 of file OTstream.H.
Implements Ostream.
Definition at line 27 of file OTstream.C.
References DynamicList< token >::append(), and token::good().
|
virtual |
Implements Ostream.
Definition at line 39 of file OTstream.C.
References append(), Foam::constant::universal::c, and Foam::isspace().
|
virtual |
Implements Ostream.
Definition at line 51 of file OTstream.C.
References Foam::vtk::write().
|
virtual |
Implements Ostream.
Definition at line 70 of file OTstream.C.
References append().
|
virtual |
Implements Ostream.
Definition at line 78 of file OTstream.C.
References append().
|
virtual |
Implements Ostream.
Definition at line 87 of file OTstream.C.
References append().
|
virtual |
Implements Ostream.
Definition at line 105 of file OTstream.C.
References append().
|
virtual |
Implements Ostream.
Definition at line 113 of file OTstream.C.
References append().
|
virtual |
Implements Ostream.
Definition at line 121 of file OTstream.C.
References append().
|
virtual |
Implements Ostream.
Definition at line 129 of file OTstream.C.
References append().
|
virtual |
Implements Ostream.
Definition at line 137 of file OTstream.C.
References Foam::abort(), IOstreamOption::BINARY, Foam::FatalError, FatalErrorInFunction, format(), and NotImplemented.
|
virtual |
|
virtual |
Implements Ostream.
Definition at line 167 of file OTstream.C.
References Foam::abort(), IOstreamOption::BINARY, Foam::FatalError, FatalErrorInFunction, format(), and NotImplemented.
|
inlinevirtual |
Implements Ostream.
Definition at line 162 of file OTstream.H.
|
inlinevirtual |
Implements Ostream.
Definition at line 168 of file OTstream.H.
|
inlinevirtual |
Implements IOstream.
Definition at line 175 of file OTstream.H.
|
inlinevirtual |
Implements IOstream.
Definition at line 181 of file OTstream.H.
|
inlinevirtual |
Implements Ostream.
Definition at line 187 of file OTstream.H.
|
inlinevirtual |
Implements Ostream.
Definition at line 191 of file OTstream.H.
|
inlinevirtual |
Implements Ostream.
Definition at line 196 of file OTstream.H.
|
inlinevirtual |
Implements Ostream.
Definition at line 202 of file OTstream.H.
|
inlinevirtual |
Implements Ostream.
Definition at line 208 of file OTstream.H.
|
inlinevirtual |
Implements Ostream.
Definition at line 215 of file OTstream.H.
|
inlinevirtual |
Implements Ostream.
Definition at line 221 of file OTstream.H.
|
inlinevirtual |
Implements Ostream.
Definition at line 228 of file OTstream.H.
|
inline |
Definition at line 237 of file OTstream.H.
References OTstream::rewind().
|
inlinevirtual |
Definition at line 243 of file OTstream.H.
References DynamicList::clear(), IOstream::setGood(), and IOstream::setOpened().
Referenced by OTstream::reset().
|
virtual |
Reimplemented from IOstream.
Definition at line 182 of file OTstream.C.
References Foam::name(), os(), and IOstream::print().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.