Similar to IStringStream but using an externally managed buffer for its input. This allows the input buffer to be filled (and refilled) from various sources. More...
Public Member Functions | |
UIListStream (const char *buffer, size_t nbytes, IOstreamOption streamOpt=IOstreamOption()) | |
UIListStream (const UList< char > &buffer, size_t nbytes, IOstreamOption streamOpt=IOstreamOption()) | |
UIListStream (const UList< char > &buffer, IOstreamOption streamOpt=IOstreamOption()) | |
std::streampos | pos () const |
virtual void | rewind () |
virtual void | print (Ostream &os) const |
Istream & | operator() () const |
![]() | |
const UList< char > | list () const |
UList< char > | list () |
label | size () const |
std::streampos | tellg () const |
void | rewind () |
![]() | |
ISstream (std::istream &is, const string &streamName, IOstreamOption streamOpt=IOstreamOption()) | |
ISstream (std::istream &is, const string &streamName, IOstreamOption::streamFormat fmt, IOstreamOption::versionNumber ver=IOstreamOption::currentVersion, IOstreamOption::compressionType cmp=IOstreamOption::UNCOMPRESSED) | |
virtual | ~ISstream ()=default |
virtual const fileName & | name () const |
virtual fileName & | name () |
virtual ios_base::fmtflags | flags () const |
bool | seekCommentEnd_Cstyle () |
bool | continueReadUntilRightBrace (std::string &str, const bool stripComments=true) |
ISstream & | get (char &c) |
int | peek () |
ISstream & | getLine (std::string &str, char delim='\n') |
std::streamsize | getLine (std::nullptr_t, char delim='\n') |
ISstream & | putback (const char c) |
virtual Istream & | read (token &t) |
virtual Istream & | read (char &c) |
virtual Istream & | read (word &str) |
virtual Istream & | read (string &str) |
virtual Istream & | read (label &val) |
virtual Istream & | read (floatScalar &val) |
virtual Istream & | read (doubleScalar &val) |
virtual Istream & | read (char *buf, std::streamsize count) |
virtual Istream & | readRaw (char *data, std::streamsize count) |
virtual bool | beginRawRead () |
virtual bool | endRawRead () |
virtual ios_base::fmtflags | flags (const ios_base::fmtflags flags) |
virtual std::istream & | stdStream () |
virtual const std::istream & | stdStream () const |
![]() | |
Istream (const Istream &)=default | |
virtual | ~Istream ()=default |
Istream (IOstreamOption streamOpt=IOstreamOption()) | |
Istream (IOstreamOption::streamFormat fmt, IOstreamOption::versionNumber ver=IOstreamOption::currentVersion, IOstreamOption::compressionType cmp=IOstreamOption::UNCOMPRESSED) | |
const token & | peekBack () const noexcept |
bool | peekBack (token &tok) |
void | putBack (const token &tok) |
bool | getBack (token &tok) |
bool | readBegin (const char *funcName) |
bool | readEnd (const char *funcName) |
char | readBeginList (const char *funcName) |
char | readEndList (const char *funcName) |
Istream & | operator() () const |
![]() | |
IOstream (const IOstream &)=default | |
virtual | ~IOstream ()=default |
IOstream (IOstreamOption streamOpt=IOstreamOption()) | |
IOstream (IOstreamOption::streamFormat fmt, IOstreamOption::versionNumber ver, IOstreamOption::compressionType cmp=IOstreamOption::UNCOMPRESSED) | |
fileName | relativeName () const |
virtual bool | check (const char *operation) const |
bool | fatalCheck (const char *operation) const |
bool | opened () const noexcept |
bool | closed () const noexcept |
bool | good () const noexcept |
bool | eof () const noexcept |
bool | fail () const noexcept |
bool | bad () const noexcept |
operator bool () const noexcept | |
bool | operator! () const noexcept |
unsigned | labelByteSize () const noexcept |
unsigned | scalarByteSize () const noexcept |
void | setLabelByteSize (unsigned nbytes) noexcept |
void | setScalarByteSize (unsigned nbytes) noexcept |
template<class T = label> | |
std::enable_if< std::is_integral< T >::value, bool >::type | checkLabelSize () const noexcept |
template<class T = scalar> | |
std::enable_if< std::is_floating_point< T >::value, bool >::type | checkScalarSize () const noexcept |
label | lineNumber () const noexcept |
label & | lineNumber () noexcept |
label | lineNumber (const label num) noexcept |
void | setEof () noexcept |
void | setFail () noexcept |
void | setBad () |
ios_base::fmtflags | setf (const ios_base::fmtflags f) |
ios_base::fmtflags | setf (const ios_base::fmtflags f, const ios_base::fmtflags mask) |
void | unsetf (const ios_base::fmtflags f) |
void | print (Ostream &os, const int streamState) const |
InfoProxy< IOstream > | info () const |
![]() | |
constexpr | IOstreamOption (streamFormat fmt=streamFormat::ASCII, compressionType comp=compressionType::UNCOMPRESSED) noexcept |
constexpr | IOstreamOption (streamFormat fmt, compressionType comp, versionNumber ver) noexcept |
constexpr | IOstreamOption (streamFormat fmt, versionNumber ver, compressionType comp=compressionType::UNCOMPRESSED) noexcept |
IOstreamOption (const IOstreamOption &opt, streamFormat fmt) noexcept | |
streamFormat | format () const noexcept |
streamFormat | format (const streamFormat fmt) noexcept |
streamFormat | format (const word &formatName) |
compressionType | compression () const noexcept |
compressionType | compression (const compressionType comp) noexcept |
compressionType | compression (const word &compName) |
versionNumber | version () const noexcept |
versionNumber | version (const versionNumber ver) noexcept |
versionNumber | version (const token &tok) |
Additional Inherited Members | |
![]() | |
enum | streamAccess : char { CLOSED = 0, OPENED } |
![]() | |
enum | streamFormat : char { ASCII = 0, BINARY } |
enum | compressionType : char { UNCOMPRESSED = 0, COMPRESSED } |
![]() | |
static unsigned int | defaultPrecision () noexcept |
static unsigned int | defaultPrecision (unsigned int prec) noexcept |
![]() | |
static streamFormat | formatEnum (const word &formatName, const streamFormat deflt=streamFormat::ASCII) |
static streamFormat | formatEnum (const word &key, const dictionary &dict, const streamFormat deflt=streamFormat::ASCII) |
static compressionType | compressionEnum (const word &compName, const compressionType deflt=compressionType::UNCOMPRESSED) |
static compressionType | compressionEnum (const word &key, const dictionary &dict, const compressionType deflt=compressionType::UNCOMPRESSED) |
![]() | |
static unsigned int | precision_ |
![]() | |
static const Enum< streamFormat > | formatNames |
static const versionNumber | currentVersion |
![]() | |
typedef std::istream | stream_type |
![]() | |
UIListStreamAllocator (char *buffer, size_t nbytes) | |
void | reset (char *buffer, size_t nbytes) |
void | printBufInfo (Ostream &os) const |
![]() | |
bool | hasPutback () const noexcept |
![]() | |
void | setOpened () noexcept |
void | setClosed () noexcept |
void | setState (std::ios_base::iostate state) noexcept |
void | setGood () noexcept |
![]() | |
memorybuf::in | buf_ |
stream_type | stream_ |
![]() | |
std::ios_base::iostate | ioState_ |
streamAccess | openClosed_ |
unsigned char | sizeofLabel_ |
unsigned char | sizeofScalar_ |
label | lineNumber_ |
![]() | |
static fileName | staticName_ |
Similar to IStringStream but using an externally managed buffer for its input. This allows the input buffer to be filled (and refilled) from various sources.
Note that this stream will normally be used as a "one-shot" reader. Caution must be exercised that the referenced buffer remains valid and without any intermediate resizing for the duration of the stream's use.
An example of possible use:
Definition at line 200 of file UIListStream.H.
|
inline |
Definition at line 213 of file UIListStream.H.
|
inline |
Definition at line 225 of file UIListStream.H.
|
inlineexplicit |
Definition at line 237 of file UIListStream.H.
|
inline |
Definition at line 249 of file UIListStream.H.
References UIListStreamAllocator::tellg().
|
inlinevirtual |
Reimplemented from ISstream.
Definition at line 255 of file UIListStream.H.
References UIListStreamAllocator::rewind(), and IOstream::setGood().
|
virtual |
Reimplemented from ISstream.
Definition at line 35 of file ListStream.C.
References Foam::endl(), and os().
|
inline |
Definition at line 269 of file UIListStream.H.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.