'\"! tbl | mmdoc '\"macro stdmacro .ie n \{\ . ds Cr \fB . ds Cb \fB .\} .el \{\ . ds Cr \f7 . ds Cb \f8 .\} .TH SoInput(3IV) .SH NAME SoInput \(em used to read Inventor data files .SH INHERITS FROM SoInput .SH SYNOPSIS .ps -1 \*(Cr#include .sp .in 1i \f1Methods from class SoInput: .in 0.5i .sp .ta 29m .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(Cr .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbSoInput\*(Cr() .br .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(Cr .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cb~SoInput\*(Cr() .br .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbaddDirectoryFirst\*(Cr(const char *dirName) .br .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbaddDirectoryLast\*(Cr(const char *dirName) .br .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbaddEnvDirectoriesFirst\*(Cr(const char *envVarName) .br .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbaddEnvDirectoriesLast\*(Cr(const char *envVarName) .br .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbremoveDirectory\*(Cr(const char *dirName) .br .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbclearDirectories\*(Cr() .br .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(Crstatic const SbStringList & .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetDirectories\*(Cr() .br .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetFilePointer\*(Cr(FILE *newFP) .br .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbopenFile\*(Cr(const char *fileName, SbBool okIfNotFound = FALSE) .br .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbpushFile\*(Cr(const char *fileName) .br .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(Cr .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbcloseFile\*(Cr() .br .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbisValidFile\*(Cr() .br .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(CrFILE * .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetCurFile\*(Cr() const .br .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(Crconst char * .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetCurFileName\*(Cr() const .br .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetBuffer\*(Cr(void *bufPointer, size_t bufSize) .br .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(CrSbString .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetHeader\*(Cr() .br .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(Crfloat .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetIVVersion\*(Cr() .sp .SH DESCRIPTION This class is used by the \*(CbSoDB\f1 reading routines when reading Inventor data files. It supports both ASCII (default) and binary Inventor formats. Users can also register additional valid file headers. When \&reading, \*(CbSoInput\f1 skips over Inventor comments (from '#' to end of line) and can stack input files. When EOF is reached, the stack is popped. This class can also be used to read from a buffer in memory. .SH METHODS .ta 29m .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(Cr .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbSoInput\*(Cr() .br .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(Cr .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cb~SoInput\*(Cr() .br .in 1i \f1Constructor and destructor. The default \*(CbSoInput\f1 reads from \f3stdin\f1. The destructor closes any files opened by the \*(CbSoInput\f1. .sp .in 0.5i .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbaddDirectoryFirst\*(Cr(const char *dirName) .br .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbaddDirectoryLast\*(Cr(const char *dirName) .br .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbaddEnvDirectoriesFirst\*(Cr(const char *envVarName) .br .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbaddEnvDirectoriesLast\*(Cr(const char *envVarName) .br .in 1i \f1The \*(CbSoInput\f1 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. .sp .in 0.5i .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbremoveDirectory\*(Cr(const char *dirName) .br .in 1i \f1Removes named directory from the list. .sp .in 0.5i .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbclearDirectories\*(Cr() .br .in 1i \f1Clears the list of directories (including the current directory). .sp .in 0.5i .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(Crstatic const SbStringList & .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetDirectories\*(Cr() .br .in 1i \f1Returns the list of directories as an \*(CbSbStringList\f1. .sp .in 0.5i .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetFilePointer\*(Cr(FILE *newFP) .br .in 1i \f1Sets file pointer to read from. Clears the stack of input files if necessary. .sp .in 0.5i .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbopenFile\*(Cr(const char *fileName, SbBool okIfNotFound = FALSE) .br .in 1i \f1Opens named file, sets file pointer to result. Clears the stack of input files if necessary. This returns FALSE on error; if \*(CrokIfNotFound\f1 is FALSE (the default), this prints an error message if the file could not be \&found. .sp .in 0.5i .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbpushFile\*(Cr(const char *fileName) .br .in 1i \f1Opens named file, pushing the resulting file pointer onto the stack. Returns FALSE on error. .sp .in 0.5i .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(Cr .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbcloseFile\*(Cr() .br .in 1i \f1Closes all files on stack opened with \*(CbopenFile()\f1 or \*(CbpushFile()\f1. .sp .in 0.5i .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbisValidFile\*(Cr() .br .in 1i \f1Returns 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 \*(CbSoDB::registerHeader\f1. .sp .in 0.5i .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(CrFILE * .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetCurFile\*(Cr() const .br .in 1i \f1Returns a pointer to the current file, or NULL if reading from a buffer. .sp .in 0.5i .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(Crconst char * .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetCurFileName\*(Cr() const .br .in 1i \f1Returns full name (including directory path) of current file, or NULL if reading from a buffer. .sp .in 0.5i .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetBuffer\*(Cr(void *bufPointer, size_t bufSize) .br .in 1i \f1Sets an in-memory buffer to read from, along with its size. .sp .in 0.5i .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(CrSbString .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetHeader\*(Cr() .br .in 1i \f1Returns the header of the file being read. .sp .in 0.5i .in 1i+29n .ti 0.5i .ta 29m .ds Pt \*(Crfloat .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetIVVersion\*(Cr() .br .in 1i \f1Returns the Inventor file version of the file being read (e.g. 2.1). If the file has a header registered through \*(CbSoDB::registerHeader()\f1, the returned version is the Inventor version registered with the header. .sp .in 0.5i .SH SEE ALSO \*(CbSoDB, SoOutput, SoTranReceiver