1SoInput(3IV)()                                                  SoInput(3IV)()
2
3
4

NAME

6       SoInput — used to read Inventor data files
7

INHERITS FROM

9       SoInput
10

SYNOPSIS

12       #include <Inventor/SoInput.h>
13
14          Methods from class SoInput:
15
16                                  SoInput()
17                                  ~SoInput()
18     static void                  addDirectoryFirst(const char *dirName)
19     static void                  addDirectoryLast(const char *dirName)
20     static  void                  addEnvDirectoriesFirst(const  char *envVar‐
21                                       Name)
22     static  void                  addEnvDirectoriesLast(const  char  *envVar‐
23                                       Name)
24     static void                  removeDirectory(const char *dirName)
25     static void                  clearDirectories()
26     static const SbStringList &  getDirectories()
27     void                         setFilePointer(FILE *newFP)
28     SbBool                       openFile(const    char   *fileName,   SbBool
29                                       okIfNotFound = FALSE)
30     SbBool                       pushFile(const char *fileName)
31                                  closeFile()
32     SbBool                       isValidFile()
33     FILE *                       getCurFile() const
34     const char *                 getCurFileName() const
35     void                         setBuffer(void *bufPointer, size_t bufSize)
36     SbString                     getHeader()
37     float                        getIVVersion()
38
39

DESCRIPTION

41       This class is used by the SoDB reading routines when  reading  Inventor
42       data  files.  It supports both ASCII (default) and binary Inventor for‐
43       mats. Users can also register additional valid file headers. When read‐
44       ing, SoInput skips over Inventor comments (from '#' to end of line) and
45       can stack input files. When EOF is reached, the stack is  popped.  This
46       class can also be used to read from a buffer in memory.
47

METHODS

49                                  SoInput()
50                                  ~SoInput()
51          Constructor  and  destructor.  The default SoInput reads from stdin.
52          The destructor closes any files opened by the SoInput.
53
54     static void                  addDirectoryFirst(const char *dirName)
55     static void                  addDirectoryLast(const char *dirName)
56     static void                  addEnvDirectoriesFirst(const  char  *envVar‐
57                                       Name)
58     static  void                  addEnvDirectoriesLast(const  char  *envVar‐
59                                       Name)
60          The SoInput class maintains a global list  of  directories  that  is
61          searched  to  find files when opening them. Directories are searched
62          in order. Each of these  routines  adds  directories  to  the  list,
63          either  at the beginning ("First") or the end ("Last"). The last two
64          routines add directories named in the value of the given environment
65          variable.  Directories  may  be separated by colons or whitespace in
66          the variable's value.
67
68     static void                  removeDirectory(const char *dirName)
69          Removes named directory from the list.
70
71     static void                  clearDirectories()
72          Clears the list of directories (including the current directory).
73
74     static const SbStringList &  getDirectories()
75          Returns the list of directories as an SbStringList.
76
77     void                         setFilePointer(FILE *newFP)
78          Sets file pointer to read from. Clears the stack of input  files  if
79          necessary.
80
81     SbBool                       openFile(const    char   *fileName,   SbBool
82                                       okIfNotFound = FALSE)
83          Opens named file, sets file pointer to result. Clears the  stack  of
84          input  files  if necessary. This returns FALSE on error; if okIfNot‐
85          Found is FALSE (the default), this prints an error  message  if  the
86          file could not be found.
87
88     SbBool                       pushFile(const char *fileName)
89          Opens named file, pushing the resulting file pointer onto the stack.
90          Returns FALSE on error.
91
92                                  closeFile()
93          Closes all files on stack opened with openFile() or pushFile().
94
95     SbBool                       isValidFile()
96          Returns TRUE if the currently open file is a  valid  Inventor  file;
97          that  is,  it  begins  with a valid Inventor header, or one that has
98          been registered with SoDB::registerHeader.
99
100     FILE *                       getCurFile() const
101          Returns a pointer to the current file, or NULL  if  reading  from  a
102          buffer.
103
104     const char *                 getCurFileName() const
105          Returns  full  name  (including  directory path) of current file, or
106          NULL if reading from a buffer.
107
108     void                         setBuffer(void *bufPointer, size_t bufSize)
109          Sets an in-memory buffer to read from, along with its size.
110
111     SbString                     getHeader()
112          Returns the header of the file being read.
113
114     float                        getIVVersion()
115          Returns the Inventor file version of the file being read (e.g. 2.1).
116          If  the file has a header registered through SoDB::registerHeader(),
117          the returned version is the Inventor  version  registered  with  the
118          header.
119
120

SEE ALSO

122       SoDB, SoOutput, SoTranReceiver
123
124
125
126
127                                                                SoInput(3IV)()
Impressum