#include <UT_IStream.h>

Public Types | |
| enum | { UT_SEEK_BEG = 0, UT_SEEK_CUR = 1, UT_SEEK_END = 2 } |
| enum | FileSystemType { UT_FSYSTEM_UNKNOWN, UT_FSYSTEM_LOCAL, UT_FSYSTEM_NETWORK } |
| Return whether the stream refers to a local drive or a network path. More... | |
Public Member Functions | |
| UT_IStream (FILE *fp, UT_ISTREAM_READTYPE binary=UT_ISTREAM_BINARY) | |
| UT_IStream (istream &is, UT_ISTREAM_READTYPE binary=UT_ISTREAM_BINARY) | |
| UT_IStream (const char *buffer, size_t bufsize, UT_ISTREAM_READTYPE binary) | |
| UT_IStream (const UT_WorkBuffer &buffer, UT_ISTREAM_READTYPE binary=UT_ISTREAM_ASCII) | |
| virtual | ~UT_IStream () |
| bool | isRandomAccessFile (UT_WorkBuffer &filename) const |
| FileSystemType | getFileSystemType () const |
| bool | isEof () const |
| bool | isError () const |
| void | setError (bool is_error) |
| bool | isAscii () const |
| bool | isBinary () const |
| void | setVersion (int version) |
| int | getVersion () const |
| void | setLabel (const char *label) |
| const char * | getLabel () const |
| void | pushBinary (UT_ISTREAM_READTYPE binary) |
| void | popBinary () |
| void | pushOperation (const char *operation) |
| void | popOperation () |
| UT_IStreamBuf * | getStreamBuffer () |
| UT_IStream * | getSubStream (int64 start, int64 nbytes) |
| UT_IStream * | getZlibStream () |
| UT_IStream * | getGzipStream () |
| bool | getLine (UT_WorkBuffer &buffer, int end='\n') |
| bool | skipLine (int end='\n') |
| bool | getWord (UT_WorkBuffer &buffer) |
| bool | getString (UT_WorkBuffer &buffer) |
| bool | skipLeadingWhitespace () |
| bool | getJSONWord (UT_WorkBuffer &buffer, bool &real) |
| bool | getAll (UT_WorkBuffer &buffer) |
| bool | getAllAscii (UT_WorkBuffer &buffer) |
| bool | getNonCommentWord (UT_WorkBuffer &buffer, int comment='#') |
| int | getNonCommentLine (UT_WorkBuffer &buffer, int comment='#', bool strip_inline_comments=true) |
| bool | checkNonCommentToken (const char *expected, int comment='#') |
| bool | checkToken (const char *expected) |
| int | getc () |
| int | peek () |
| int | ungetc () |
| int | unwind (int amount) |
| int | read (int16 *array, int sz=1) |
| int | read (uint16 *array, int sz=1) |
| int | read (int32 *array, int sz=1) |
| int | read (uint32 *array, int sz=1) |
| int | read (int64 *array, int sz=1) |
| int | read (uint64 *array, int sz=1) |
| int | read (fpreal32 *array, int sz=1) |
| int | read (fpreal64 *array, int sz=1) |
| bool | read (UT_String &string) |
| bool | read (std::string &bytes) |
| template<typename SOURCE_TYPE , typename T > | |
| int | read (T *array, int sz, int max_elem) |
| bool | readBinaryString (UT_String &str, UT_ISTREAM_RLE_IO startbits) |
| char * | readBinaryData (int64 &size, UT_ISTREAM_RLE_IO startbits, bool add_null=false) |
| bool | readBool (bool &result) |
| bool | readChar (char &result) |
| bool | areadChar (char &result) |
| int | bread (char *buffer, int asize=1) |
| int | bread (unsigned char *buffer, int asize=1) |
| int | bread (signed char *buffer, int asize=1) |
| int | bread (int16 *buffer, int asize=1) |
| int | bread (uint16 *buffer, int asize=1) |
| int | bread (int32 *buffer, int asize=1) |
| int | bread (uint32 *buffer, int asize=1) |
| int | bread (int64 *buffer, int asize=1) |
| int | bread (uint64 *buffer, int asize=1) |
| int | bread (fpreal32 *buffer, int asize=1) |
| int | bread (fpreal64 *buffer, int asize=1) |
| bool | bread (UT_String &str) |
| bool | bread (std::string &bytes) |
| int | aread (int16 *buffer, int asize=1) |
| int | aread (uint16 *buffer, int asize=1) |
| int | aread (int32 *buffer, int asize=1) |
| int | aread (uint32 *buffer, int asize=1) |
| int | aread (int64 *buffer, int asize=1) |
| int | aread (uint64 *buffer, int asize=1) |
| int | aread (fpreal32 *buffer, int asize=1) |
| int | aread (fpreal64 *buffer, int asize=1) |
| bool | aread (UT_String &str) |
| bool | aread (std::string &bytes) |
| int64 | tellg () const |
| bool | seekg (int64 pos, int seekdir=UT_SEEK_BEG) |
| template<typename SOURCE_TYPE > | |
| bool | breadFloat (fpreal32 *val) |
| template<typename SOURCE_TYPE > | |
| bool | breadFloat (fpreal64 *val) |
| template<typename SOURCE_TYPE > | |
| int | read (int32 *val, int sz=1) |
| template<typename SOURCE_TYPE > | |
| int | read (int64 *val, int sz=1) |
| template<typename SOURCE_TYPE > | |
| int | read (fpreal32 *val, int sz=1) |
| template<typename SOURCE_TYPE > | |
| int | read (fpreal64 *val, int sz=1) |
| template<typename SOURCE_TYPE > | |
| int | bread (int32 *buffer, int asize=1) |
| template<typename SOURCE_TYPE > | |
| int | bread (int64 *buffer, int asize=1) |
| template<typename SOURCE_TYPE > | |
| int | bread (fpreal32 *buffer, int asize=1) |
| template<typename SOURCE_TYPE > | |
| int | bread (fpreal64 *buffer, int asize=1) |
Static Public Member Functions | |
| static void | setStdinCompatible (bool state) |
Protected Member Functions | |
| UT_IStream (const char *filename, const UT_Options *open_options) | |
| UT_IStream (UT_IStreamBuf *sbuf, UT_ISTREAM_READTYPE binary) | |
| void | initCommon (UT_ISTREAM_READTYPE binary) |
| bool | readString (UT_String &str, bool binary) |
| bool | readStdString (std::string &bytes, bool binary) |
| void | setError () |
| void | clearError () |
Protected Attributes | |
| UT_IntArray | myBinaryStack |
| UT_PtrArray< const char * > | myOperationStack |
| UT_IStreamBuf * | myStream |
| char * | myLabel |
| int | myVersion |
| bool | myBinary |
| bool | myEof |
| bool | myError |
CHOP/CHOP_Spring.C, SIM/SNOW_Solver.C, SIM/SNOW_Solver.h, SOP/SOP_BlindData.C, SOP/SOP_BlindData.h, SOP/SOP_CustomBrush.C, SOP/SOP_CustomBrush.h, and standalone/geo2voxel.C.
Definition at line 60 of file UT_IStream.h.
| anonymous enum |
Return whether the stream refers to a local drive or a network path.
Definition at line 98 of file UT_IStream.h.
| UT_IStream::UT_IStream | ( | FILE * | fp, | |
| UT_ISTREAM_READTYPE | binary = UT_ISTREAM_BINARY | |||
| ) |
| UT_IStream::UT_IStream | ( | istream & | is, | |
| UT_ISTREAM_READTYPE | binary = UT_ISTREAM_BINARY | |||
| ) |
| UT_IStream::UT_IStream | ( | const char * | buffer, | |
| size_t | bufsize, | |||
| UT_ISTREAM_READTYPE | binary | |||
| ) |
| UT_IStream::UT_IStream | ( | const UT_WorkBuffer & | buffer, | |
| UT_ISTREAM_READTYPE | binary = UT_ISTREAM_ASCII | |||
| ) |
| virtual UT_IStream::~UT_IStream | ( | ) | [virtual] |
| UT_IStream::UT_IStream | ( | const char * | filename, | |
| const UT_Options * | open_options | |||
| ) | [protected] |
| UT_IStream::UT_IStream | ( | UT_IStreamBuf * | sbuf, | |
| UT_ISTREAM_READTYPE | binary | |||
| ) | [protected] |
| bool UT_IStream::aread | ( | std::string & | bytes | ) | [inline] |
Definition at line 403 of file UT_IStream.h.
| bool UT_IStream::aread | ( | UT_String & | str | ) | [inline] |
Definition at line 402 of file UT_IStream.h.
| int UT_IStream::aread | ( | fpreal64 * | buffer, | |
| int | asize = 1 | |||
| ) |
| int UT_IStream::aread | ( | fpreal32 * | buffer, | |
| int | asize = 1 | |||
| ) |
| int UT_IStream::aread | ( | uint64 * | buffer, | |
| int | asize = 1 | |||
| ) |
| int UT_IStream::aread | ( | int64 * | buffer, | |
| int | asize = 1 | |||
| ) |
| int UT_IStream::aread | ( | uint32 * | buffer, | |
| int | asize = 1 | |||
| ) |
| int UT_IStream::aread | ( | int32 * | buffer, | |
| int | asize = 1 | |||
| ) |
| int UT_IStream::aread | ( | uint16 * | buffer, | |
| int | asize = 1 | |||
| ) |
| int UT_IStream::aread | ( | int16 * | buffer, | |
| int | asize = 1 | |||
| ) |
| bool UT_IStream::areadChar | ( | char & | result | ) | [inline] |
Definition at line 327 of file UT_IStream.h.
| bool UT_IStream::bread | ( | std::string & | bytes | ) | [inline] |
Definition at line 377 of file UT_IStream.h.
| bool UT_IStream::bread | ( | UT_String & | str | ) | [inline] |
Definition at line 376 of file UT_IStream.h.
| int UT_IStream::bread | ( | fpreal64 * | buffer, | |
| int | asize = 1 | |||
| ) |
| int UT_IStream::bread | ( | fpreal32 * | buffer, | |
| int | asize = 1 | |||
| ) |
| int UT_IStream::bread | ( | uint64 * | buffer, | |
| int | asize = 1 | |||
| ) | [inline] |
Definition at line 372 of file UT_IStream.h.
| int UT_IStream::bread | ( | int64 * | buffer, | |
| int | asize = 1 | |||
| ) |
| int UT_IStream::bread | ( | uint32 * | buffer, | |
| int | asize = 1 | |||
| ) | [inline] |
Definition at line 369 of file UT_IStream.h.
| int UT_IStream::bread | ( | int32 * | buffer, | |
| int | asize = 1 | |||
| ) |
| int UT_IStream::bread | ( | uint16 * | buffer, | |
| int | asize = 1 | |||
| ) | [inline] |
Definition at line 366 of file UT_IStream.h.
| int UT_IStream::bread | ( | int16 * | buffer, | |
| int | asize = 1 | |||
| ) |
| int UT_IStream::bread | ( | signed char * | buffer, | |
| int | asize = 1 | |||
| ) | [inline] |
Definition at line 363 of file UT_IStream.h.
| int UT_IStream::bread | ( | unsigned char * | buffer, | |
| int | asize = 1 | |||
| ) | [inline] |
Definition at line 361 of file UT_IStream.h.
| int UT_IStream::bread | ( | char * | buffer, | |
| int | asize = 1 | |||
| ) |
| int UT_IStream::bread | ( | fpreal64 * | buffer, | |
| int | asize = 1 | |||
| ) | [inline] |
Read a floating point value of the specified source type into the given destination variable, performing a conversion as necessary. The two accepted forms are:
| int UT_IStream::bread | ( | fpreal32 * | buffer, | |
| int | asize = 1 | |||
| ) | [inline] |
Read a floating point value of the specified source type into the given destination variable, performing a conversion as necessary. The two accepted forms are:
| int UT_IStream::bread | ( | int64 * | buffer, | |
| int | asize = 1 | |||
| ) | [inline] |
Read a floating point value of the specified source type into the given destination variable, performing a conversion as necessary. The two accepted forms are:
| int UT_IStream::bread | ( | int32 * | buffer, | |
| int | asize = 1 | |||
| ) | [inline] |
Read a floating point value of the specified source type into the given destination variable, performing a conversion as necessary. The two accepted forms are:
| bool UT_IStream::breadFloat | ( | fpreal64 * | val | ) | [inline] |
Read a floating point value of the specified source type into the given destination variable, performing a conversion as necessary. The two accepted forms are:
| bool UT_IStream::breadFloat | ( | fpreal32 * | val | ) | [inline] |
Read a floating point value of the specified source type into the given destination variable, performing a conversion as necessary. The two accepted forms are:
| bool UT_IStream::checkNonCommentToken | ( | const char * | expected, | |
| int | comment = '#' | |||
| ) | [inline] |
Reads in the next token (skipping comments) and compares it to the expected value. Returns true if the tokens match, and false otherwise.
Definition at line 199 of file UT_IStream.h.
| bool UT_IStream::checkToken | ( | const char * | expected | ) | [inline] |
Reads in the next token and compares it to the expected value. Returns true if the tokens match, and false otherwise.
Definition at line 209 of file UT_IStream.h.
| void UT_IStream::clearError | ( | ) | [protected] |
| bool UT_IStream::getAll | ( | UT_WorkBuffer & | buffer | ) |
Reads in the entire stream from the current position to the end. Returns true if anything was read in, false otherwise. Use isError() to test error state.
| bool UT_IStream::getAllAscii | ( | UT_WorkBuffer & | buffer | ) |
Does the same as getAll, except any carriage return-newline (
) sequences are converted into newlines (
).
| int UT_IStream::getc | ( | ) |
| FileSystemType UT_IStream::getFileSystemType | ( | ) | const |
| UT_IStream* UT_IStream::getGzipStream | ( | ) |
| bool UT_IStream::getJSONWord | ( | UT_WorkBuffer & | buffer, | |
| bool & | real | |||
| ) |
Read a JSON token. This assumes that leading white space has been trimmed and will read all characters until:
| const char* UT_IStream::getLabel | ( | ) | const [inline] |
Definition at line 127 of file UT_IStream.h.
| bool UT_IStream::getLine | ( | UT_WorkBuffer & | buffer, | |
| int | end = '\n' | |||
| ) |
| int UT_IStream::getNonCommentLine | ( | UT_WorkBuffer & | buffer, | |
| int | comment = '#', |
|||
| bool | strip_inline_comments = true | |||
| ) |
Skips all the comment lines and reads the next line in the stream. Returns the number of lines read. Note that the resulting line will be stripped of leading white space as well. The strip_inline_comments argument determines whether or not the resulting line should have comments at the end, if any, stripped.
| bool UT_IStream::getNonCommentWord | ( | UT_WorkBuffer & | buffer, | |
| int | comment = '#' | |||
| ) |
Skips all the comment lines and reads the next token in the stream. Returns true if successful and false otherwise.
| UT_IStreamBuf* UT_IStream::getStreamBuffer | ( | ) | [inline] |
Definition at line 148 of file UT_IStream.h.
| bool UT_IStream::getString | ( | UT_WorkBuffer & | buffer | ) |
| UT_IStream* UT_IStream::getSubStream | ( | int64 | start, | |
| int64 | nbytes | |||
| ) |
| int UT_IStream::getVersion | ( | void | ) | const [inline] |
Definition at line 121 of file UT_IStream.h.
| bool UT_IStream::getWord | ( | UT_WorkBuffer & | buffer | ) |
| UT_IStream* UT_IStream::getZlibStream | ( | ) |
| void UT_IStream::initCommon | ( | UT_ISTREAM_READTYPE | binary | ) | [protected] |
| bool UT_IStream::isAscii | ( | ) | const [inline] |
Definition at line 113 of file UT_IStream.h.
| bool UT_IStream::isBinary | ( | ) | const [inline] |
Definition at line 114 of file UT_IStream.h.
| bool UT_IStream::isEof | ( | ) | const |
| bool UT_IStream::isError | ( | ) | const [inline] |
Definition at line 110 of file UT_IStream.h.
| bool UT_IStream::isRandomAccessFile | ( | UT_WorkBuffer & | filename | ) | const |
Check whether the stream refers to a filename and whether the file supports random seeks.
| int UT_IStream::peek | ( | ) |
| void UT_IStream::popBinary | ( | ) |
| void UT_IStream::popOperation | ( | ) |
| void UT_IStream::pushBinary | ( | UT_ISTREAM_READTYPE | binary | ) |
The read() methods use the binary state of the stream to determine whether to read ASCII or binary values. Rather than calling this method directly, it would be better to create a UT_IStreamAutoBinary, which will automatically pop the state on its destruction.
| void UT_IStream::pushOperation | ( | const char * | operation | ) |
For error handling. If an error occurs on the stream, the operation will be added to the error message (i.e. "loading image"). Rather than calling this method directly, it would probably be better to use UT_IStreamAutoOp which automatically pops the operation.
| int UT_IStream::read | ( | fpreal64 * | val, | |
| int | sz = 1 | |||
| ) | [inline] |
Read a floating point value of the specified source type into the given destination variable, performing a conversion as necessary. The two accepted forms are:
Definition at line 349 of file UT_IStream.h.
| int UT_IStream::read | ( | fpreal32 * | val, | |
| int | sz = 1 | |||
| ) | [inline] |
Read a floating point value of the specified source type into the given destination variable, performing a conversion as necessary. The two accepted forms are:
Definition at line 347 of file UT_IStream.h.
| int UT_IStream::read | ( | int64 * | val, | |
| int | sz = 1 | |||
| ) | [inline] |
Read a floating point value of the specified source type into the given destination variable, performing a conversion as necessary. The two accepted forms are:
Definition at line 345 of file UT_IStream.h.
| int UT_IStream::read | ( | int32 * | val, | |
| int | sz = 1 | |||
| ) | [inline] |
Read a floating point value of the specified source type into the given destination variable, performing a conversion as necessary. The two accepted forms are:
Definition at line 343 of file UT_IStream.h.
| int UT_IStream::read | ( | T * | array, | |
| int | sz, | |||
| int | max_elem | |||
| ) | [inline] |
Definition at line 279 of file UT_IStream.h.
| bool UT_IStream::read | ( | std::string & | bytes | ) | [inline] |
Definition at line 271 of file UT_IStream.h.
| bool UT_IStream::read | ( | UT_String & | string | ) | [inline] |
Definition at line 267 of file UT_IStream.h.
| int UT_IStream::read | ( | fpreal64 * | array, | |
| int | sz = 1 | |||
| ) | [inline] |
Definition at line 263 of file UT_IStream.h.
| int UT_IStream::read | ( | fpreal32 * | array, | |
| int | sz = 1 | |||
| ) | [inline] |
Definition at line 259 of file UT_IStream.h.
| int UT_IStream::read | ( | uint64 * | array, | |
| int | sz = 1 | |||
| ) | [inline] |
Definition at line 255 of file UT_IStream.h.
| int UT_IStream::read | ( | int64 * | array, | |
| int | sz = 1 | |||
| ) | [inline] |
Definition at line 251 of file UT_IStream.h.
| int UT_IStream::read | ( | uint32 * | array, | |
| int | sz = 1 | |||
| ) | [inline] |
Definition at line 247 of file UT_IStream.h.
| int UT_IStream::read | ( | int32 * | array, | |
| int | sz = 1 | |||
| ) | [inline] |
Definition at line 243 of file UT_IStream.h.
| int UT_IStream::read | ( | uint16 * | array, | |
| int | sz = 1 | |||
| ) | [inline] |
Definition at line 239 of file UT_IStream.h.
| int UT_IStream::read | ( | int16 * | array, | |
| int | sz = 1 | |||
| ) | [inline] |
Definition at line 235 of file UT_IStream.h.
| char* UT_IStream::readBinaryData | ( | int64 & | size, | |
| UT_ISTREAM_RLE_IO | startbits, | |||
| bool | add_null = false | |||
| ) |
| bool UT_IStream::readBinaryString | ( | UT_String & | str, | |
| UT_ISTREAM_RLE_IO | startbits | |||
| ) |
| bool UT_IStream::readBool | ( | bool & | result | ) | [inline] |
Definition at line 311 of file UT_IStream.h.
| bool UT_IStream::readChar | ( | char & | result | ) | [inline] |
Definition at line 321 of file UT_IStream.h.
| bool UT_IStream::readStdString | ( | std::string & | bytes, | |
| bool | binary | |||
| ) | [protected] |
| bool UT_IStream::readString | ( | UT_String & | str, | |
| bool | binary | |||
| ) | [protected] |
| bool UT_IStream::seekg | ( | int64 | pos, | |
| int | seekdir = UT_SEEK_BEG | |||
| ) |
Query or seek to a position in the stream. Please see documentation for standard istreams for further information.
| void UT_IStream::setError | ( | ) | [protected] |
| void UT_IStream::setError | ( | bool | is_error | ) | [inline] |
Definition at line 111 of file UT_IStream.h.
| void UT_IStream::setLabel | ( | const char * | label | ) |
The label methods provide a way to give the stream a label which is used to identify the stream in error messages. For example, UT_IFStream sets the label to the filename.
| static void UT_IStream::setStdinCompatible | ( | bool | state | ) | [static] |
| void UT_IStream::setVersion | ( | int | version | ) | [inline] |
The version information can be used to stash version information with the stream itself rather than having to pass the version information through to all other loading methods. This is used primarily in geometry loading.
Definition at line 120 of file UT_IStream.h.
| bool UT_IStream::skipLeadingWhitespace | ( | ) |
| bool UT_IStream::skipLine | ( | int | end = '\n' |
) |
| int64 UT_IStream::tellg | ( | ) | const |
Query or seek to a position in the stream. Please see documentation for standard istreams for further information.
| int UT_IStream::ungetc | ( | ) | [inline] |
Definition at line 225 of file UT_IStream.h.
| int UT_IStream::unwind | ( | int | amount | ) |
bool UT_IStream::myBinary [protected] |
Definition at line 425 of file UT_IStream.h.
UT_IntArray UT_IStream::myBinaryStack [protected] |
Definition at line 420 of file UT_IStream.h.
bool UT_IStream::myEof [protected] |
Definition at line 425 of file UT_IStream.h.
bool UT_IStream::myError [protected] |
Definition at line 425 of file UT_IStream.h.
char* UT_IStream::myLabel [protected] |
Definition at line 423 of file UT_IStream.h.
UT_PtrArray<const char *> UT_IStream::myOperationStack [protected] |
Definition at line 421 of file UT_IStream.h.
UT_IStreamBuf* UT_IStream::myStream [protected] |
Definition at line 422 of file UT_IStream.h.
int UT_IStream::myVersion [protected] |
Definition at line 424 of file UT_IStream.h.
1.5.9