|
|
|
This represents the complete contents of an X file (file.x) in memory.
More...
#include "xFile.h"
List of all members.
Public Types |
| enum | FloatSize { FS_32,
FS_64
} |
| enum | FormatType { FT_text,
FT_binary,
FT_compressed
} |
Public Member Functions |
|
| XFile (bool keep_names=false) |
| virtual void | clear () |
| | Removes all of the classes defined within the XFile and prepares it for reading a new file.
|
| XFileDataNodeTemplate * | find_data_object (const string &name) const |
| | Returns the data object associated with the indicated name, if any, or NULL if none.
|
| XFileDataNodeTemplate * | find_data_object (const WindowsGuid &guid) const |
| | Returns the data object associated with the indicated GUID, if any, or NULL if none.
|
| XFileTemplate * | find_template (const string &name) const |
| | Returns the template associated with the indicated name, if any, or NULL if none.
|
| XFileTemplate * | find_template (const WindowsGuid &guid) const |
| | Returns the template associated with the indicated GUID, if any, or NULL if none.
|
|
virtual TypeHandle | force_init_type () |
|
virtual TypeHandle | get_type () const |
| bool | read (Filename filename) |
| | Opens and reads the indicated .x file by name.
|
| bool | read (istream &in, const string &filename=string()) |
| | Parses the already-opened input stream for distributed class descriptions.
|
| bool | write (ostream &out) const |
| | Writes a parseable description of all the known nodes and templates to the stream.
|
| bool | write (Filename filename) const |
| | Opens the indicated filename for output and writes a parseable description of all the known distributed classes to the file.
|
| virtual void | write_text (ostream &out, int indent_level) const |
| | Writes a suitable representation of this node to an .x file in text mode.
|
Static Public Member Functions |
| static XFileTemplate * | find_standard_template (const string &name) |
| | Returns the standard template associated with the indicated name, if any, or NULL if none.
|
| static XFileTemplate * | find_standard_template (const WindowsGuid &guid) |
| | Returns the template associated with the indicated GUID, if any, or NULL if none.
|
|
static TypeHandle | get_class_type () |
| static void | init_type () |
| | This function is declared non-inline to work around a compiler bug in g++ 2.96.
|
Friends |
|
class | XFileNode |
Detailed Description
This represents the complete contents of an X file (file.x) in memory.
It may be read or written from or to a disk file.
Definition at line 35 of file xFile.h.
Member Function Documentation
| void XFile::clear |
( |
void |
| ) |
[virtual] |
Removes all of the classes defined within the XFile and prepares it for reading a new file.
Reimplemented from XFileNode.
Definition at line 60 of file xFile.cxx.
Returns the data object associated with the indicated GUID, if any, or NULL if none.
Definition at line 303 of file xFile.cxx.
Returns the template associated with the indicated GUID, if any, or NULL if none.
Definition at line 274 of file xFile.cxx.
References find_template().
| XFileTemplate * XFile::find_standard_template |
( |
const string & |
name | ) |
[static] |
Returns the standard template associated with the indicated name, if any, or NULL if none.
Definition at line 262 of file xFile.cxx.
References find_template().
Referenced by XFileDataObject::add_Coords2d(), XFileNode::add_Frame(), XFileNode::add_FrameTransformMatrix(), XFileDataObject::add_IndexedColor(), XFileNode::add_Material(), XFileNode::add_Mesh(), XFileDataObject::add_MeshFace(), XFileNode::add_MeshMaterialList(), XFileNode::add_MeshNormals(), XFileNode::add_MeshTextureCoords(), XFileNode::add_MeshVertexColors(), XFileNode::add_TextureFilename(), and XFileDataObject::add_Vector().
| XFileTemplate * XFile::find_template |
( |
const string & |
name | ) |
const |
| static void XFile::init_type |
( |
| ) |
[inline, static] |
This function is declared non-inline to work around a compiler bug in g++ 2.96.
Making it inline seems to cause problems in the optimizer.
Reimplemented from XFileNode.
Definition at line 89 of file xFile.h.
| bool XFile::read |
( |
istream & |
in, |
|
|
const string & |
filename = string() |
|
) |
| |
Parses the already-opened input stream for distributed class descriptions.
The filename parameter is optional and is only used when reporting errors.
The distributed classes defined in the file will be appended to the set of distributed classes already recorded, if any.
Returns true if the file is successfully read, false if there was an error (in which case the file might have been partially read).
Definition at line 110 of file xFile.cxx.
| bool XFile::write |
( |
Filename |
filename | ) |
const |
| bool XFile::write |
( |
ostream & |
out | ) |
const |
Writes a parseable description of all the known nodes and templates to the stream.
Returns true if the description is successfully written, false otherwise.
Definition at line 182 of file xFile.cxx.
References write_text().
| void XFile::write_text |
( |
ostream & |
out, |
|
|
int |
indent_level |
|
) |
| const [virtual] |
Writes a suitable representation of this node to an .x file in text mode.
Reimplemented from XFileNode.
Definition at line 321 of file xFile.cxx.
Referenced by write().
The documentation for this class was generated from the following files:
| | |