An IOstream is an abstract base class for all input/output systems; be they streams, files, token lists etc. More...
Public Types | |
enum | streamAccess : char { CLOSED = 0, OPENED } |
![]() | |
enum | streamFormat : char { ASCII = 0, BINARY } |
enum | compressionType : char { UNCOMPRESSED = 0, COMPRESSED } |
Public Member Functions | |
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 |
virtual ios_base::fmtflags | flags () const =0 |
void | setEof () noexcept |
void | setFail () noexcept |
void | setBad () |
virtual ios_base::fmtflags | flags (const ios_base::fmtflags f)=0 |
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) |
virtual void | print (Ostream &os) const |
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) |
Static Public Member Functions | |
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 Public Attributes | |
static unsigned int | precision_ |
![]() | |
static const Enum< streamFormat > | formatNames |
static const versionNumber | currentVersion |
Protected Member Functions | |
void | setOpened () noexcept |
void | setClosed () noexcept |
void | setState (std::ios_base::iostate state) noexcept |
void | setGood () noexcept |
Protected Attributes | |
std::ios_base::iostate | ioState_ |
streamAccess | openClosed_ |
unsigned char | sizeofLabel_ |
unsigned char | sizeofScalar_ |
label | lineNumber_ |
Static Protected Attributes | |
static fileName | staticName_ |
An IOstream is an abstract base class for all input/output systems; be they streams, files, token lists etc.
The basic operations are construct, close, read token, read primitive and read binary block. In addition version control and line number counting is incorporated. Usually one would use the read primitive member functions, but if one were reading a stream on unknown data sequence one can read token by token, and then analyse.
Definition at line 75 of file IOstream.H.
enum streamAccess : char |
Enumerator | |
---|---|
CLOSED | The stream is not open. |
OPENED | The stream is open. |
Definition at line 84 of file IOstream.H.
|
virtualdefault |
|
inlineexplicit |
Definition at line 164 of file IOstream.H.
References IOstream::setBad().
|
inline |
Definition at line 178 of file IOstream.H.
|
inlineprotectednoexcept |
Definition at line 125 of file IOstream.H.
References IOstream::openClosed_, and IOstream::OPENED.
Referenced by ITstream::ITstream(), OTstream::OTstream(), OTstream::rewind(), and UOPstream::UOPstream().
|
inlineprotectednoexcept |
Definition at line 131 of file IOstream.H.
References IOstream::CLOSED, and IOstream::openClosed_.
|
inlineprotectednoexcept |
Definition at line 137 of file IOstream.H.
References IOstream::ioState_.
Referenced by ISstream::get().
|
inlineprotectednoexcept |
Definition at line 143 of file IOstream.H.
References IOstream::ioState_.
Referenced by ITstream::ITstream(), OTstream::OTstream(), IListStream::rewind(), OTstream::rewind(), UOListStream::rewind(), UIListStream::rewind(), OCountStream::rewind(), OListStream::rewind(), and UOPstream::UOPstream().
|
virtual |
Reimplemented in ITstream, primitiveEntry, ISstream, and OSstream.
Definition at line 33 of file IOstream.C.
References IOstream::staticName_.
Referenced by globalIndexAndTransform::addToTransformIndex(), mappedPatchBase::calcMapping(), hexRef8::checkMesh(), Foam::copyFilteredDict(), includeEntry::execute(), ifeqEntry::execute(), Foam::operator>>(), decomposedBlockData::readHeader(), IOobject::readHeader(), and fvExpressionField::setField().
|
virtual |
Reimplemented in ITstream, primitiveEntry, ISstream, and OSstream.
Foam::fileName relativeName | ( | ) | const |
Definition at line 45 of file IOstream.C.
References argList::envRelativePath(), and Foam::name().
Referenced by functionEntry::execute(), decomposedBlockData::readBlock(), decomposedBlockData::readBlocks(), IOobject::readHeader(), primitiveEntry::relativeName(), entry::reportReadWarning(), and IOerror::SafeFatalIOError().
|
virtual |
Definition at line 51 of file IOstream.C.
Referenced by CollisionRecordList< vector, vector >::CollisionRecordList(), eddy::eddy(), faBoundaryMesh::faBoundaryMesh(), findCellParticle::findCellParticle(), ignitionSite::ignitionSite(), injectedParticle::injectedParticle(), Foam::input(), kinematicParcelInjectionData::kinematicParcelInjectionData(), molecule::molecule(), objectMap::objectMap(), Foam::operator<<(), Foam::operator>>(), Foam::RBD::operator>>(), Foam::functionObjects::operator>>(), orientedType::orientedType(), Foam::output(), particle< Type >::particle(), polyBoundaryMesh::polyBoundaryMesh(), pyramid::pyramid(), reactingMultiphaseParcelInjectionData::reactingMultiphaseParcelInjectionData(), reactingParcelInjectionData::reactingParcelInjectionData(), SHA1Digest::read(), dimensionSet::read(), dimensioned< Type >::read(), IOPosition::readData(), lumpedPointIOMovement::readData(), PackedList< 2 >::setPair(), solidParticle::solidParticle(), streamLineParticle::streamLineParticle(), surfZoneIOList::surfZoneIOList(), thermoParcelInjectionData::thermoParcelInjectionData(), trackedParticle::trackedParticle(), VectorSpace< Vector< vector >, vector, 3 >::VectorSpace(), wallBoundedParticle::wallBoundedParticle(), wallBoundedStreamLineParticle::wallBoundedStreamLineParticle(), SHA1Digest::write(), dimensionSet::write(), Foam::writeChars(), faBoundaryMesh::writeData(), polyBoundaryMesh::writeData(), injectedParticle::writePosition(), and particle< Type >::writePosition().
bool fatalCheck | ( | const char * | operation | ) | const |
Definition at line 57 of file IOstream.C.
References Foam::exit(), Foam::FatalIOError, and FatalIOErrorInFunction.
Referenced by dictionaryEntry::dictionaryEntry(), functionEntry::execute(), entry::New(), Foam::operator>>(), Foam::blockMeshTools::read(), primitiveEntry::read(), decomposedBlockData::readBlockEntry(), decomposedBlockData::readBlocks(), PtrList< transferModel >::readIstream(), LList< Foam::chemPointISAT< CompType, ThermoType > * >::readList(), List< vectorField >::readList(), PackedList< 2 >::readList(), FixedList< Type, 3 >::readList(), UList< Foam::wordRe >::readList(), and Matrix< RectangularMatrix< Type >, Type >::readMatrix().
|
inlinenoexcept |
Definition at line 217 of file IOstream.H.
References IOstream::openClosed_, and IOstream::OPENED.
Referenced by meshRefinement::findRegions(), and sampledSets::writeSampleFile().
|
inlinenoexcept |
Definition at line 223 of file IOstream.H.
References IOstream::CLOSED, and IOstream::openClosed_.
|
inlinenoexcept |
Definition at line 229 of file IOstream.H.
References IOstream::ioState_.
Referenced by backwardDdtScheme< Type >::backwardDdtScheme(), topoSetSource::checkIs(), dynamicCode::copyAndFilter(), dynamicCode::copyOrCreateFiles(), writeFile::createFile(), dynamicCode::createMakeFiles(), dynamicCode::createMakeOptions(), AC3DsurfaceFormatCore::cueTo(), directionalPressureGradientExplicitSource::directionalPressureGradientExplicitSource(), ensightSurfaceReader::geometry(), ISstream::get(), edgeMeshFormatsCore::getLineNoComment(), surfaceFormatsCore::getLineNoComment(), meanVelocityForce::meanVelocityForce(), csvTableReader< Type >::operator()(), rawIOField< Type >::rawIOField(), extendedEdgeMeshFormat::read(), VTKedgeFormat::read(), extendedFeatureEdgeMeshFormat::read(), OBJsurfaceFormat< Face >::read(), NASedgeFormat::read(), OFFsurfaceFormat< Face >::read(), OBJedgeFormat::read(), edgeMeshFormat::read(), ABAQUSsurfaceFormat< Face >::read(), AC3DsurfaceFormat< Face >::read(), tabulated6DoFAcceleration::read(), GTSsurfaceFormat< Face >::read(), STARCDsurfaceFormat< Face >::read(), NASsurfaceFormat< Face >::read(), tabulated6DoFMotion::read(), STARCDedgeFormat::read(), VTKsurfaceFormat< Face >::read(), ABAQUSCore::readHelper::read(), dictionary::read(), masterUncollatedFileOperation::readAndSend(), decomposedBlockData::readBlocks(), STARCDMeshReader::readBoundary(), ensightSurfaceReader::readCase(), STARCDMeshReader::readCells(), AC3DsurfaceFormatCore::readCmd(), UniformDimensionedField< vector >::readData(), GlobalIOList< kinematicParcelInjectionData >::readData(), GlobalIOField< vector >::readData(), ensightSurfaceReader::readField(), STARCDCore::readHeader(), IOobject::readHeader(), masterUncollatedFileOperation::readHeader(), STARCDsurfaceFormatCore::readInpCellTable(), ensightSurfaceReader::readLine(), STARCDMeshReader::readPoints(), STARCDCore::readPoints(), noiseFFT::setData(), Reaction::setLRhs(), ensightSurfaceReader::skip(), TableFile< Type >::TableFile(), graph::write(), featureEdgeMesh::writeData(), rawIOField< Type >::writeData(), lumpedPointIOMovement::writeData(), baseIOdictionary::writeData(), porosityModelList::writeData(), extendedFeatureEdgeMesh::writeData(), virtualMassModel::writeData(), polyTopoChanger::writeData(), dragModel::writeData(), coordinateSystems::writeData(), decomposedBlockData::writeData(), MRFZoneList::writeData(), faBoundaryMesh::writeData(), profiling::writeData(), polyBoundaryMesh::writeData(), refinementHistory::writeData(), dynamicCode::writeDigest(), dictionary::writeEntries(), IOobject::writeHeader(), Foam::writeJobDict(), and fileOperation::writeObject().
|
inlinenoexcept |
Definition at line 235 of file IOstream.H.
References IOstream::ioState_.
Referenced by backwardDdtScheme< Type >::backwardDdtScheme(), topoSetSource::checkIs(), ifeqEntry::evaluate(), ifeqEntry::execute(), gaussGrad< Type >::gaussGrad(), laplacianScheme< Type >::laplacianScheme(), lnGradScheme< Type >::New(), gradScheme< Type >::New(), edgeInterpolationScheme< Type >::New(), convectionScheme< Type >::New(), surfaceInterpolationScheme< scalar >::New(), faDdtScheme< scalar >::New(), divScheme< Type >::New(), d2dt2Scheme< Type >::New(), faD2dt2Scheme< Type >::New(), snGradScheme< Type >::New(), limitedSurfaceInterpolationScheme< Type >::New(), ddtScheme< Type >::New(), laplacianScheme< Type >::New(), laplacianScheme< Type, GType >::New(), entry::New(), ensightReadFile::read(), dictionary::read(), PtrList< transferModel >::readIstream(), noiseFFT::setData(), and solution::upgradeSolverDict().
|
inlinenoexcept |
Definition at line 241 of file IOstream.H.
References IOstream::ioState_.
Referenced by IOstream::operator bool(), and IOstream::operator!().
|
inlinenoexcept |
Definition at line 247 of file IOstream.H.
References IOstream::ioState_.
Referenced by Foam::getToken(), Foam::parseStream(), GTSsurfaceFormat< Face >::read(), ISstream::read(), primitiveEntry::read(), dictionary::read(), featureEdgeMesh::readData(), fvExprDriverWriter::readData(), baseIOdictionary::readData(), extendedFeatureEdgeMesh::readData(), exprResultGlobals::readData(), refinementHistory::readData(), error::write(), and IOerror::write().
|
inlineexplicitnoexcept |
Definition at line 253 of file IOstream.H.
References IOstream::fail().
|
inlinenoexcept |
Definition at line 259 of file IOstream.H.
References IOstream::fail().
|
inlinenoexcept |
Definition at line 268 of file IOstream.H.
References IOstream::sizeofLabel_.
Referenced by decomposedBlockData::readBlock().
|
inlinenoexcept |
Definition at line 274 of file IOstream.H.
References IOstream::sizeofScalar_.
Referenced by decomposedBlockData::readBlock().
|
inlinenoexcept |
Definition at line 280 of file IOstream.H.
References IOstream::sizeofLabel_.
Referenced by IOobject::readHeader().
|
inlinenoexcept |
Definition at line 286 of file IOstream.H.
References IOstream::sizeofScalar_.
Referenced by IOobject::readHeader().
Definition at line 296 of file IOstream.H.
References IOstream::sizeofLabel_, and Foam::T().
Referenced by findCellParticle::findCellParticle(), injectedParticle::injectedParticle(), molecule::molecule(), Foam::operator>>(), particle< Type >::particle(), Foam::readRawLabel(), solidParticle::solidParticle(), trackedParticle::trackedParticle(), and wallBoundedParticle::wallBoundedParticle().
|
inlinenoexcept |
Definition at line 305 of file IOstream.H.
References IOstream::sizeofScalar_, and Foam::T().
Referenced by findCellParticle::findCellParticle(), injectedParticle::injectedParticle(), molecule::molecule(), Foam::operator>>(), particle< Type >::particle(), solidParticle::solidParticle(), trackedParticle::trackedParticle(), and wallBoundedParticle::wallBoundedParticle().
|
inlinenoexcept |
Definition at line 314 of file IOstream.H.
References IOstream::lineNumber_.
Referenced by entry::checkITstream(), dictionary::checkITstream(), codeStream::evaluate(), ifeqEntry::execute(), functionEntry::execute(), NASedgeFormat::read(), NASsurfaceFormat< Face >::read(), IOobject::readHeader(), functionEntry::readLine(), entry::reportReadWarning(), and IOerror::SafeFatalIOError().
|
inlinenoexcept |
Definition at line 320 of file IOstream.H.
References IOstream::lineNumber_.
|
inlinenoexcept |
Definition at line 327 of file IOstream.H.
References IOstream::lineNumber_.
|
pure virtual |
Implemented in ITstream, OTstream, dummyISstream, UOPstream, UIPstream, ISstream, and OSstream.
Referenced by IOstream::setf(), and IOstream::unsetf().
|
inlinestaticnoexcept |
Definition at line 338 of file IOstream.H.
References IOstream::precision_.
Referenced by Foam::entryToString(), objectiveManager::objectiveManager(), probes::prepare(), writeFile::read(), dataCloud::read(), vtkCloud::read(), vtkWrite::read(), Time::readDict(), AMIWeights::reportPatch(), faceSetOption::setArea(), cellSetOption::setVol(), sensitivityBezier::write(), sensitivityVolBSplines::write(), sensitivityVolBSplinesFI::write(), sensitivityBezierFI::write(), SQP::write(), PDRblock::writeBlockMeshDict(), faMeshDecomposition::writeDecomposition(), and objectiveManager::writeObjectives().
|
inlinestaticnoexcept |
Definition at line 345 of file IOstream.H.
References IOstream::precision_.
|
inlinenoexcept |
Definition at line 353 of file IOstream.H.
References IOstream::ioState_.
|
inlinenoexcept |
Definition at line 359 of file IOstream.H.
References IOstream::ioState_.
|
inline |
Definition at line 365 of file IOstream.H.
References IOstream::ioState_.
Referenced by IOstream::IOstream(), and Foam::operator>>().
|
pure virtual |
|
inline |
Definition at line 374 of file IOstream.H.
References f(), and IOstream::flags().
Referenced by Foam::dec(), Foam::fixed(), Foam::hex(), Foam::oct(), Foam::scientific(), Foam::setf(), ensightSetWriter< Type >::write(), ensightWriter::writeCollated(), and ensightWriter::writeUncollated().
|
inline |
Definition at line 381 of file IOstream.H.
References f(), and IOstream::flags().
|
inline |
Definition at line 390 of file IOstream.H.
References f(), and IOstream::flags().
|
virtual |
Reimplemented in OListStream, ITstream, OCountStream, OStringStream, UOPstream, UIListStream, UOListStream, OTstream, OSstream, ISstream, UIPstream, IListStream, IStringStream, prefixOSstream, OFstream, and IFstream.
Definition at line 73 of file IOstream.C.
References Foam::endl(), format(), os(), and Foam::foamVersion::version.
Referenced by ISstream::print(), OSstream::print(), OTstream::print(), ITstream::print(), and HashTable::Iterator< true >::print().
void print | ( | Ostream & | os, |
const int | streamState | ||
) | const |
Definition at line 112 of file IOstream.C.
References Foam::endl(), and os().
Definition at line 409 of file IOstream.H.
Referenced by MultiInteraction< CloudType >::info(), dimensionSet::read(), and IOobject::writeHeader().
|
static |
Definition at line 94 of file IOstream.H.
Referenced by IOstream::defaultPrecision(), and functionObjectList::execute().
|
staticprotected |
Definition at line 102 of file IOstream.H.
Referenced by IOstream::name().
|
protected |
Definition at line 105 of file IOstream.H.
Referenced by IOstream::bad(), IOstream::eof(), IOstream::fail(), IOstream::good(), IOstream::setBad(), IOstream::setEof(), IOstream::setFail(), IOstream::setGood(), and IOstream::setState().
|
protected |
Definition at line 108 of file IOstream.H.
Referenced by IOstream::closed(), IOstream::opened(), IOstream::setClosed(), and IOstream::setOpened().
|
protected |
Definition at line 111 of file IOstream.H.
Referenced by IOstream::checkLabelSize(), IOstream::labelByteSize(), and IOstream::setLabelByteSize().
|
protected |
Definition at line 114 of file IOstream.H.
Referenced by IOstream::checkScalarSize(), IOstream::scalarByteSize(), and IOstream::setScalarByteSize().
|
protected |
Definition at line 117 of file IOstream.H.
Referenced by ISstream::get(), and IOstream::lineNumber().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.