x3dio::Reader Class ReferenceThe reader interface, implemented by any object which can read a stream and convert it in a tree of x3d nodes.
More...
#include <io.h>
Inheritance diagram for x3dio::Reader:
[legend]List of all members.
|
Public Member Functions |
virtual x3d::SFNodePtr | Load (Stream *stream, ErrorCallback *callback=0)=0 |
| Load an X3D file from stream and return an X3D node.
|
virtual | ~Reader () |
| The reader destructor needs to be defined since it is virtual.
|
Detailed Description
The reader interface, implemented by any object which can read a stream and convert it in a tree of x3d nodes.
The Reader interface is expected to be derived from a class which can implement the Load() function.
Note that it is wise to create a separate class for the Reader and the Writer. This is so because then a player can just and only link with the reader. There should also be no real reason why you would need to have both since they both do quite different things.
You can instantiate a reader yourself if you know the input stream format. Otherwise a function (which does not exist yet) will be called to create the proper reader for you.
Constructor & Destructor Documentation
x3dio::Reader::~Reader |
( |
|
) |
[virtual] |
|
|
The reader destructor needs to be defined since it is virtual.
Cleans up the reader class. Since this is just an interface, it does nothing. |
Member Function Documentation
x3d::SFNodePtr x3dio::Reader::Load |
( |
Stream * |
stream, |
|
|
ErrorCallback * |
callback = 0 |
|
) |
[pure virtual] |
|
|
Load an X3D file from stream and return an X3D node.
The Load() function is expected to read from the input stream and create nodes according to the data found in the file. The proper reader needs to be created for the given input file. This will be determined with a function call which will read a few bytes from the stream and decide which reader to use to read the entire input.
The user can specify an error callback object. In this case, any error generated in the reader will be reported to the caller. Please, see the reference about the x3dio::ErrorCallback for more information on how messages are forwarded.
- Todo:
- Implement that function which decides which reader to use (at this time we only support XML in text form so we're still fine...)
- Returns:
- A smart pointer to an X3D root node
- See also:
- x3dio::Writer::Write()
Implemented in x3dxml::XMLReader. |
The documentation for this class was generated from the following files:
|