15 #include "xFileDataObjectArray.h"
16 #include "string_utils.h"
43 _nested_elements.push_back(element);
54 write_data(ostream &out,
int indent_level,
const char *separator)
const {
55 if (!_nested_elements.empty()) {
56 bool indented =
false;
57 for (
size_t i = 0;
i < _nested_elements.size() - 1;
i++) {
60 _nested_elements.size() > 16) {
67 object->write_data(out, indent_level,
",");
72 indent(out, indent_level);
75 out << *
object <<
", ";
86 object->write_data(out, indent_level, separator);
90 indent(out, indent_level);
92 out << *
object << separator <<
"\n";
104 int XFileDataObjectArray::
105 get_num_elements()
const {
106 return _nested_elements.size();
117 nassertr(n >= 0 && n < (
int)_nested_elements.size(), NULL);
118 return _nested_elements[n];
virtual bool add_element(XFileDataObject *element)
Adds the indicated element as a nested data element, if this data object type supports it...
virtual void write_data(ostream &out, int indent_level, const char *separator) const
Writes a suitable representation of this node to an .x file in text mode.
virtual bool is_complex_object() const
Returns true if this kind of data object is a complex object that can hold nested data elements...
TypeHandle is the identifier used to differentiate C++ class types.
virtual bool is_complex_object() const
Returns true if this kind of data object is a complex object that can hold nested data elements...
The abstract base class for a number of different types of data elements that may be stored in the X ...
int i() const
Unambiguously returns the object's representation as an integer, or 0 if the object has no integer re...