From 62d58d924ede784686125dcc62fe9a3c9c2a2a1e Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 16 Nov 2004 19:31:22 +0000 Subject: [PATCH] output statements for ConfigVariableList --- dtool/src/prc/configVariableList.I | 6 ++++++ dtool/src/prc/configVariableList.cxx | 23 +++++++++++++++++++++++ dtool/src/prc/configVariableList.h | 5 +++++ 3 files changed, 34 insertions(+) diff --git a/dtool/src/prc/configVariableList.I b/dtool/src/prc/configVariableList.I index 9e63947ad6..f95619c644 100644 --- a/dtool/src/prc/configVariableList.I +++ b/dtool/src/prc/configVariableList.I @@ -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; +} diff --git a/dtool/src/prc/configVariableList.cxx b/dtool/src/prc/configVariableList.cxx index 627d452285..2ee2f2c8fe 100644 --- a/dtool/src/prc/configVariableList.cxx +++ b/dtool/src/prc/configVariableList.cxx @@ -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"; + } +} diff --git a/dtool/src/prc/configVariableList.h b/dtool/src/prc/configVariableList.h index 99a4857618..944d53901b 100644 --- a/dtool/src/prc/configVariableList.h +++ b/dtool/src/prc/configVariableList.h @@ -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