64 #ifndef Foam_UIListStream_H 65 #define Foam_UIListStream_H 85 virtual public std::ios,
99 inline void reset(
char *buffer,
size_t nbytes)
107 this->pubseekpos(0, std::ios_base::in);
121 class UIListStreamAllocator
149 inline void reset(
char* buffer,
size_t nbytes)
176 inline label
size()
const 182 std::streampos
tellg()
const 190 buf_.pubseekpos(0, std::ios_base::in);
221 allocator_type(const_cast<char*>(buffer), nbytes),
251 std::streampos
pos()
const 264 virtual void print(Ostream&
os)
const;
279 #ifdef Foam_IOstream_extras 307 const UList<char>& buf,
An input streambuf for memory access.
void size(const label n)
Older name for setAddressableSize.
stream_type stream_
The stream.
Istream & operator()() const
A non-const reference to const Istream.
virtual void print(Ostream &os) const
Print stream description to Ostream.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
void printBufInfo(Ostream &os) const
Some information about the input buffer position/capacity.
A simple container for options an IOstream can normally have.
Similar to std::istringstream, but with an externally managed input buffer.
label size() const
The list size.
constexpr IOstreamOption(streamFormat fmt=streamFormat::ASCII, compressionType comp=compressionType::UNCOMPRESSED) noexcept
Default construct (ASCII, UNCOMPRESSED, currentVersion) or construct with format, compression...
void printBufInfo(Ostream &os) const
virtual void rewind()
Rewind the stream, clearing any old errors.
const UList< char > list() const
Const UList access to the input characters (shallow copy).
std::streamsize tellg() const
The buffer get position.
An stream/stream-buffer input allocator for a externally allocated list.
std::streampos tellg() const
Position of the get buffer.
memorybuf::in buf_
The stream buffer.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Similar to IStringStream but using an externally managed buffer for its input. This allows the input ...
void resetg(char *s, std::streamsize n)
Reset for character array (can be nullptr) and number of bytes.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
uiliststream(const char *buffer, size_t nbytes)
Construct for character array and number of bytes.
OBJstream os(runTime.globalPath()/outputName)
void rewind()
Rewind the stream, clearing any old errors.
Generic input stream using a standard (STL) stream.
UIListStreamAllocator(char *buffer, size_t nbytes)
Construct for character array and number of bytes.
versionNumber version() const noexcept
Get the stream version.
streamFormat
Data format (ascii | binary)
const T * cdata() const noexcept
Return pointer to the underlying array serving as data storage.
void setGood() noexcept
Set stream state to be good.
std::streampos pos() const
Return the current get position in the buffer.
void reset(char *buffer, size_t nbytes)
Reset buffer pointers.
void rewind()
Move to buffer start, clear errors.
const UList< char > list() const
Const UList access to the input characters (shallow copy).
streamFormat format() const noexcept
Get the current stream format.
void reset(char *buffer, size_t nbytes)
Reset buffer pointers.
std::streamsize capacity() const
The buffer capacity.
UIListStream(const char *buffer, size_t nbytes, IOstreamOption streamOpt=IOstreamOption())
Construct using specified buffer and number of bytes.