Panda3D
 All Classes Functions Variables Enumerations
configVariableList.h
1 // Filename: configVariableList.h
2 // Created by: drose (20Oct04)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef CONFIGVARIABLELIST_H
16 #define CONFIGVARIABLELIST_H
17 
18 #include "dtoolbase.h"
19 #include "configVariableBase.h"
20 
21 ////////////////////////////////////////////////////////////////////
22 // Class : ConfigVariableList
23 // Description : This class is similar to ConfigVariable, but it
24 // reports its value as a list of strings. In this
25 // special case, all of the declarations of the variable
26 // are returned as the elements of this list, in order.
27 //
28 // Note that this is different from a normal
29 // ConfigVariableString, which just returns its topmost
30 // value, which can optionally be treated as a number of
31 // discrete words by dividing it at the spaces.
32 //
33 // A ConfigVariableList cannot be modified locally.
34 ////////////////////////////////////////////////////////////////////
35 class EXPCL_DTOOLCONFIG ConfigVariableList : public ConfigVariableBase {
36 PUBLISHED:
37  INLINE ConfigVariableList(const string &name,
38  const string &description = string(),
39  int flags = 0);
40  INLINE ~ConfigVariableList();
41 
42  INLINE int get_num_values() const;
43  INLINE string get_string_value(int n) const;
44 
45  INLINE int get_num_unique_values() const;
46  INLINE string get_unique_value(int n) const;
47 
48  INLINE int size() const;
49  INLINE string operator [] (int n) const;
50 
51  void output(ostream &out) const;
52  void write(ostream &out) const;
53 };
54 
55 INLINE ostream &operator << (ostream &out, const ConfigVariableList &variable);
56 
57 #include "configVariableList.I"
58 
59 #endif
This class is similar to ConfigVariable, but it reports its value as a list of strings.
This class is the base class for both ConfigVariableList and ConfigVariable (and hence for all of the...