SoInput()~SoInput()
Constructor and destructor. The default SoInput reads from stdin. The destructor closes any files
opened by the SoInput.
staticvoidaddDirectoryFirst(constchar*dirName)staticvoidaddDirectoryLast(constchar*dirName)staticvoidaddEnvDirectoriesFirst(constchar*envVarName)staticvoidaddEnvDirectoriesLast(constchar*envVarName)
The SoInput class maintains a global list of directories that is searched to find files when opening
them. Directories are searched in order. Each of these routines adds directories to the list, either
at the beginning ("First") or the end ("Last"). The last two routines add directories named in the
value of the given environment variable. Directories may be separated by colons or whitespace in the
variable's value.
staticvoidremoveDirectory(constchar*dirName)
Removes named directory from the list.
staticvoidclearDirectories()
Clears the list of directories (including the current directory).
staticconstSbStringList&getDirectories()
Returns the list of directories as an SbStringList.
voidsetFilePointer(FILE*newFP)
Sets file pointer to read from. Clears the stack of input files if necessary.
SbBoolopenFile(constchar*fileName,SbBoolokIfNotFound=FALSE)
Opens named file, sets file pointer to result. Clears the stack of input files if necessary. This
returns FALSE on error; if okIfNotFound is FALSE (the default), this prints an error message if the
file could not be found.
SbBoolpushFile(constchar*fileName)
Opens named file, pushing the resulting file pointer onto the stack. Returns FALSE on error.
closeFile()
Closes all files on stack opened with openFile() or pushFile().
SbBoolisValidFile()
Returns TRUE if the currently open file is a valid Inventor file; that is, it begins with a valid
Inventor header, or one that has been registered with SoDB::registerHeader.
FILE*getCurFile()const
Returns a pointer to the current file, or NULL if reading from a buffer.
constchar*getCurFileName()const
Returns full name (including directory path) of current file, or NULL if reading from a buffer.
voidsetBuffer(void*bufPointer,size_tbufSize)
Sets an in-memory buffer to read from, along with its size.
SbStringgetHeader()
Returns the header of the file being read.
floatgetIVVersion()
Returns the Inventor file version of the file being read (e.g. 2.1). If the file has a header
registered through SoDB::registerHeader(), the returned version is the Inventor version registered
with the header.