39 #ifndef Foam_ISstream_H 40 #define Foam_ISstream_H 74 virtual bool readCompoundToken(
token& tok,
const word& compoundType);
77 void operator=(
const ISstream&) =
delete;
89 const string& streamName,
97 const string& streamName,
109 const string& streamName,
129 virtual const fileName&
name()
const override {
return name_; }
132 virtual fileName&
name() {
return name_; }
138 virtual const std::istream&
stdStream()
const {
return is_; }
147 virtual ios_base::fmtflags
flags()
const override 153 virtual ios_base::fmtflags
flags(
const ios_base::fmtflags
f)
override 180 const bool stripComments =
true 200 inline std::streamsize
getLine(std::nullptr_t,
char delim =
'\n');
242 std::streamsize
count 252 virtual void rewind()
override;
**return False if stream exhausted before finding the comment end *bool seekCommentEnd_Cstyle()
Discard until end of C-style comment '.
virtual Istream & readRaw(char *data, std::streamsize count) override
Low-level raw binary read (without possible block delimiters). Reading into a null pointer behaves li...
A class for handling file names.
virtual void rewind() override
Rewind the stream so that it may be read again.
compressionType
Compression treatment (UNCOMPRESSED | COMPRESSED)
ISstream & putback(const char c)
Raw, low-level putback character function.
virtual const std::istream & stdStream() const
Const access to underlying std::istream.
void setState(std::ios_base::iostate state) noexcept
Set stream state.
virtual ios_base::fmtflags flags() const override
Return flags of output stream.
ISstream(std::istream &is, const string &streamName, IOstreamOption streamOpt=IOstreamOption())
Construct wrapper around std::istream, set stream status.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
A token holds an item read from Istream.
void syncState()
Set stream state to match that of the std::istream.
bool continueReadUntilRightBrace(std::string &str, const bool stripComments=true)
Raw, low-level get into a string. Continues reading after an initial left-brace until it finds the ma...
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...
virtual bool endRawRead() override
End of low-level raw binary read.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
virtual ~ISstream()=default
Destructor.
A class for handling words, derived from Foam::string.
int peek()
Raw, low-level peek function.
virtual bool beginRawRead() override
Start of low-level raw binary read.
virtual const fileName & name() const override
The name of the input serial stream. (eg, the name of the Fstream file name)
Representation of a major/minor version number.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
ISstream & getLine(std::string &str, char delim='\n')
Raw, low-level getline (until delimiter) into a string.
OBJstream os(runTime.globalPath()/outputName)
virtual Istream & read(token &t) override
Return next token from stream.
Generic input stream using a standard (STL) stream.
const dimensionedScalar c
Speed of light in a vacuum.
streamFormat
Data format (ascii | binary)
virtual void print(Ostream &os) const override
Print stream description to Ostream.