80 bool hasPutback()
const noexcept {
return putBackAvail_; }
174 virtual
Istream&
read(
char* data, std::streamsize count) = 0;
189 virtual
void rewind() = 0;
247void readContiguous(
Istream& is,
char* data, std::streamsize byteCount)
255 reinterpret_cast<label*
>(data),
256 byteCount/
sizeof(label)
260 else if constexpr (is_contiguous_scalar<T>::value)
266 reinterpret_cast<scalar*
>(data),
267 byteCount/
sizeof(scalar)
273 is.
read(data, byteCount);
303 Istream& is,
char* data, std::streamsize byteCount
A simple container for options an IOstream can normally have.
constexpr IOstreamOption(streamFormat fmt=streamFormat::ASCII, compressionType comp=compressionType::UNCOMPRESSED) noexcept
Default construct (ASCII, UNCOMPRESSED, currentVersion) or construct with format, compression.
streamFormat
Data format (ascii | binary | coherent).
compressionType
Compression treatment (UNCOMPRESSED | COMPRESSED).
@ UNCOMPRESSED
compression = false
IOstream(const IOstream &)=default
Copy construct.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
bool getBack(token &tok)
Retrieve the put-back token if there is one.
virtual bool endRawRead()=0
End of low-level raw binary read.
char readEndList(const char *funcName)
End read of list data, ends with ')' or '}'.
virtual void rewind()=0
Rewind the stream so that it may be read again.
Istream(IOstreamOption::streamFormat fmt, IOstreamOption::compressionType cmp=IOstreamOption::UNCOMPRESSED)
Construct with format (uncompressed).
bool readEnd(const char *funcName)
End read of data chunk, ends with ')'.
Istream(IOstreamOption streamOpt=IOstreamOption())
Default construct (ASCII, uncompressed), construct with specified stream option.
virtual ~Istream()=default
Destructor.
const token & peekBack() const noexcept
Examine putback token without removing it.
bool hasPutback() const noexcept
True if putback token is in use.
Istream(const Istream &)=default
Copy construct.
virtual bool beginRawRead()=0
Start of low-level raw binary read.
virtual Istream & readRaw(char *data, std::streamsize count)=0
Low-level raw binary read (without possible block delimiters). Reading into a null pointer shall idea...
char readBeginList(const char *funcName)
Begin read of list data, starts with '(' or '{'.
void putBackClear()
Drop the putback token.
bool readBegin(const char *funcName)
Begin read of data chunk, starts with '('.
void putBack(const token &tok)
Put back a token (copy). Only a single put back is permitted.
virtual Istream & read(token &)=0
Return next token from stream.
Accumulates point constraints through successive applications of the applyConstraint function.
A token holds an item read from Istream.
A class for handling words, derived from Foam::string.
Implementation details for various OpenFOAM classes.
void readContiguous< pointConstraint >(Istream &is, char *data, std::streamsize byteCount)
Read binary block of pointConstraint data (possibly with conversion).
void readContiguous(Istream &is, char *data, std::streamsize byteCount)
Read binary block of contiguous data, possibly with conversion.
void readRawLabel(Istream &is, label *data, size_t nElem=1)
Read raw label(s) from binary stream.
Istream & operator>>(Istream &, directionInfo &)
IOstream &(* IOstreamManip)(IOstream &)
An IOstream manipulator.
Istream &(* IstreamManip)(Istream &)
An Istream manipulator.
A template class to specify if a data type is composed solely of Foam::label elements.
A template class to specify if a data type is composed solely of Foam::scalar elements.