34 XFile(
bool keep_names=
false);
40 bool read(std::istream &in,
const std::string &filename = std::string());
43 bool write(std::ostream &out)
const;
54 virtual void write_text(std::ostream &out,
int indent_level)
const;
67 bool read_header(std::istream &in);
68 bool write_header(std::ostream &out)
const;
70 static const XFile *get_standard_templates();
72 int _major_version, _minor_version;
73 FormatType _format_type;
74 FloatSize _float_size;
80 static PT(
XFile) _standard_templates;
86 static void init_type() {
87 XFileNode::init_type();
89 XFileNode::get_class_type());
92 return get_class_type();
94 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
The name of a file, such as a texture file or an Egg file.
TypeHandle is the identifier used to differentiate C++ class types.
This is an implementation of the Windows GUID object, used everywhere as a world-unique identifier fo...
This is a node which contains all of the data elements defined by a template.
A single node of an X file.
A template definition in the X file.
This represents the complete contents of an X file (file.x) in memory.
bool read(Filename filename)
Opens and reads the indicated .x file by name.
static XFileTemplate * find_standard_template(const std::string &name)
Returns the standard template associated with the indicated name, if any, or NULL if none.
XFileTemplate * find_template(const std::string &name) const
Returns the template associated with the indicated name, if any, or NULL if none.
virtual void clear()
Removes all of the classes defined within the XFile and prepares it for reading a new file.
virtual void write_text(std::ostream &out, int indent_level) const
Writes a suitable representation of this node to an .x file in text mode.
XFileDataNodeTemplate * find_data_object(const std::string &name) const
Returns the data object associated with the indicated name, if any, or NULL if none.
bool write(Filename filename) const
Opens the indicated filename for output and writes a parseable description of all the known distribut...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.