output statements for ConfigVariableList

This commit is contained in:
David Rose 2004-11-16 19:31:22 +00:00
parent 87e38e9ff1
commit 62d58d924e
3 changed files with 34 additions and 0 deletions

View File

@ -96,3 +96,9 @@ INLINE string ConfigVariableList::
operator [] (int n) const {
return get_unique_value(n);
}
INLINE ostream &
operator << (ostream &out, const ConfigVariableList &variable) {
variable.output(out);
return out;
}

View File

@ -36,3 +36,26 @@ ConfigVariableList(const string &name,
}
_core->set_used();
}
////////////////////////////////////////////////////////////////////
// Function: ConfigVariableList::output
// Access: Published
// Description:
////////////////////////////////////////////////////////////////////
void ConfigVariableList::
output(ostream &out) const {
out << get_num_values() << " values.";
}
////////////////////////////////////////////////////////////////////
// Function: ConfigVariableList::write
// Access: Published
// Description:
////////////////////////////////////////////////////////////////////
void ConfigVariableList::
write(ostream &out) const {
int num_values = get_num_values();
for (int i = 0; i < num_values; ++i) {
out << get_string_value(i) << "\n";
}
}

View File

@ -50,8 +50,13 @@ PUBLISHED:
INLINE int size() const;
INLINE string operator [] (int n) const;
void output(ostream &out) const;
void write(ostream &out) const;
};
INLINE ostream &operator << (ostream &out, const ConfigVariableList &variable);
#include "configVariableList.I"
#endif