Panda3D

configVariableList.h

00001 // Filename: configVariableList.h
00002 // Created by:  drose (20Oct04)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef CONFIGVARIABLELIST_H
00016 #define CONFIGVARIABLELIST_H
00017 
00018 #include "dtoolbase.h"
00019 #include "configVariableBase.h"
00020 
00021 ////////////////////////////////////////////////////////////////////
00022 //       Class : ConfigVariableList
00023 // Description : This class is similar to ConfigVariable, but it
00024 //               reports its value as a list of strings.  In this
00025 //               special case, all of the declarations of the variable
00026 //               are returned as the elements of this list, in order.
00027 //
00028 //               Note that this is different from a normal
00029 //               ConfigVariableString, which just returns its topmost
00030 //               value, which can optionally be treated as a number of
00031 //               discrete words by dividing it at the spaces.
00032 //
00033 //               A ConfigVariableList cannot be modified locally.
00034 ////////////////////////////////////////////////////////////////////
00035 class EXPCL_DTOOLCONFIG ConfigVariableList : public ConfigVariableBase {
00036 PUBLISHED:
00037   INLINE ConfigVariableList(const string &name,
00038                             const string &description = string(), 
00039                             int flags = 0);
00040   INLINE ~ConfigVariableList();
00041 
00042   INLINE int get_num_values() const;
00043   INLINE string get_string_value(int n) const;
00044 
00045   INLINE int get_num_unique_values() const;
00046   INLINE string get_unique_value(int n) const;
00047 
00048   INLINE int size() const;
00049   INLINE string operator [] (int n) const;
00050 
00051   void output(ostream &out) const;
00052   void write(ostream &out) const;
00053 };
00054 
00055 INLINE ostream &operator << (ostream &out, const ConfigVariableList &variable);
00056 
00057 #include "configVariableList.I"
00058 
00059 #endif
 All Classes Functions Variables Enumerations