46 #ifndef Foam_Istream_H 47 #define Foam_Istream_H 177 virtual
void rewind() = 0;
188 bool readEnd(const
char* funcName);
238 if (is_contiguous_label<T>::value)
243 reinterpret_cast<label*>(data),
244 byteCount/
sizeof(label)
247 else if (is_contiguous_scalar<T>::value)
252 reinterpret_cast<scalar*>(data),
253 byteCount/
sizeof(scalar)
258 is.readRaw(data, byteCount);
const token & peekBack() const noexcept
Examine putback token without removing it.
bool getBack(token &tok)
Get the put-back token if there is one.
virtual void rewind()=0
Rewind the stream so that it may be read again.
compressionType
Compression treatment (UNCOMPRESSED | COMPRESSED)
bool readBegin(const char *funcName)
Begin read of data chunk, starts with '('.
char readEndList(const char *funcName)
End read of list data, ends with ')' or '}'.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
A token holds an item read from Istream.
Istream(IOstreamOption streamOpt=IOstreamOption())
Default construct (ASCII, uncompressed), construct with specified stream option.
virtual bool endRawRead()=0
End of low-level raw binary read.
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...
void putBack(const token &tok)
Put back a token. Only a single put back is permitted.
virtual Istream & read(token &)=0
Return next token from stream.
A class for handling words, derived from Foam::string.
Istream & operator>>(Istream &, directionInfo &)
char readBeginList(const char *funcName)
Begin read of list data, starts with '(' or '{'.
bool readEnd(const char *funcName)
End read of data chunk, ends with ')'.
virtual Istream & readRaw(char *, std::streamsize)=0
Low-level raw binary read.
Istream &(* IstreamManip)(Istream &)
An Istream manipulator.
label readRawLabel(Istream &is)
Read raw label from binary stream.
An IOstream is an abstract base class for all input/output systems; be they streams, files, token lists etc.
virtual bool beginRawRead()=0
Start of low-level raw binary read.
bool hasPutback() const noexcept
True if putback token is in use.
streamFormat
Data format (ascii | binary)
void readContiguous(Istream &is, char *data, std::streamsize byteCount)
Read binary block of contiguous data, possibly with conversion.
virtual ~Istream()=default
Destructor.
IOstream &(* IOstreamManip)(IOstream &)
An IOstream manipulator.
Istream(const Istream &)=default
Copy construct.