18 #include "pandatoolbase.h" 19 #include "xFileNode.h" 20 #include "xFileDataNode.h" 21 #include "windowsGuid.h" 24 #include "pointerTo.h" 37 XFile(
bool keep_names=
false);
43 bool read(istream &in,
const string &filename =
string());
46 bool write(ostream &out)
const;
57 virtual void write_text(ostream &out,
int indent_level)
const;
70 bool read_header(istream &in);
71 bool write_header(ostream &out)
const;
73 static const XFile *get_standard_templates();
75 int _major_version, _minor_version;
76 FormatType _format_type;
77 FloatSize _float_size;
81 NodesByGuid _nodes_by_guid;
83 static PT(
XFile) _standard_templates;
89 static void init_type() {
90 XFileNode::init_type();
91 register_type(_type_handle,
"XFile",
92 XFileNode::get_class_type());
95 return get_class_type();
97 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
virtual void clear()
Removes all of the classes defined within the XFile and prepares it for reading a new file...
This is an implementation of the Windows GUID object, used everywhere as a world-unique identifier fo...
static XFileTemplate * find_standard_template(const string &name)
Returns the standard template associated with the indicated name, if any, or NULL if none...
This is a node which contains all of the data elements defined by a template.
A single node of an X file.
bool write(Filename filename) const
Opens the indicated filename for output and writes a parseable description of all the known distribut...
The name of a file, such as a texture file or an Egg file.
bool read(Filename filename)
Opens and reads the indicated .x file by name.
XFileDataNodeTemplate * find_data_object(const string &name) const
Returns the data object associated with the indicated name, if any, or NULL if none.
virtual void write_text(ostream &out, int indent_level) const
Writes a suitable representation of this node to an .x file in text mode.
This represents the complete contents of an X file (file.x) in memory.
XFileTemplate * find_template(const string &name) const
Returns the template associated with the indicated name, if any, or NULL if none. ...
A template definition in the X file.
TypeHandle is the identifier used to differentiate C++ class types.