35#ifndef Foam_ensightReadFile_H
36#define Foam_ensightReadFile_H
60 int64_t timeStepFooterBegin_;
71 void readString(std::string& value);
76 void init(
bool detectFormat);
79 ensightReadFile(
const ensightReadFile&) =
delete;
82 void operator=(
const ensightReadFile&) =
delete;
95 explicit ensightReadFile
130 virtual Istream&
read(
char* buf, std::streamsize count)
override;
169 void skip(label
n = 1)
185 return timeStepFooterBegin_;
192 return timeStepOffsets_.size();
199 return timeStepOffsets_;
215 ensightReadFile reader(pathname);
IFstream(const fileName &pathname, IOstreamOption streamOpt=IOstreamOption())
Construct from pathname, default or specified stream options.
A simple container for options an IOstream can normally have.
streamFormat format() const noexcept
Get the current stream format.
streamFormat
Data format (ascii | binary | coherent).
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
virtual Istream & read(token &)=0
Return next token from stream.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
bool seekTime(const label timeIndex)
Transient single-file: seek to the file position corresponding to the given time index.
~ensightReadFile()=default
Destructor.
void skip(label n=1)
Read and discard specified number of elements.
static IOstreamOption::streamFormat detectBinaryHeader(const fileName &pathname)
Detect if the file is binary by testing for initial "(C|Fortran) Binary".
void readPoints(const label nPoints, List< floatVector > &points)
Component-wise reading of points/coordinates. Read all x components, y components and z components.
int64_t timeStepFooterBegin() const noexcept
Transient single-file: the position of the FILE_INDEX footer.
static int64_t getTimeStepFooter(IFstream &is, List< int64_t > &offsets)
Extract time step footer information (if any).
label nTimes() const noexcept
Transient single-file: the number of time steps within the file.
const UList< int64_t > & timeStepOffets() const noexcept
Transient single-file: the file-offsets for time steps within the file.
static int debug
Debug switch.
Istream & readKeyword(string &key)
Read element keyword. Currently the same as read(string).
virtual Istream & read(char *buf, std::streamsize count) override
Binary read.
A class for handling file names.
#define FOAM_DEPRECATED_FOR(since, replacement)