#include <GenericValues.h>
Inheritance diagram for GenericValues:
Public Methods | |
GenericValues (char *strName, int iMaxValues) | |
virtual | ~GenericValues () |
char * | getClassName () |
int | getValuesTotal () |
bool | addSetting (const char *strName, void *vAddress, GenericValueKind t) |
virtual char * | getValue (const char *strName, char *strValue) |
virtual bool | setValue (const char *strName, const char *strValue) |
virtual bool | readValues (const char *strFile, const char *strSeparator=0) |
virtual bool | saveValues (const char *strFile, const char *strSeparator=0, bool bAppend=true) |
virtual void | show (ostream &out, const char *strSeparator) |
Private Methods | |
GenericValueT * | getValuePtr (const char *strName) |
Private Attributes | |
char * | m_strClassName |
GenericValueT ** | m_values |
int | m_iValuesTotal |
int | m_iMaxGenericValues |
Definition at line 124 of file GenericValues.h.
|
Constructor for the GenericValues class. It creates a GenericValues object.
Definition at line 243 of file GenericValues.cpp. References m_iMaxGenericValues, m_iValuesTotal, m_strClassName, and m_values. |
|
Destructor for the GenericValues class. It destroys a GenericValues object by freeing all memory allocated to it. Definition at line 258 of file GenericValues.cpp. References getValuesTotal(), m_strClassName, and m_values. |
|
This method adds a new generic value to the collection and provides a connection between a string name and the variable name of the generic value.
Definition at line 297 of file GenericValues.cpp. References GenericValueKind, getValuePtr(), m_iMaxGenericValues, m_iValuesTotal, m_strClassName, and m_values. Referenced by PlayerSettings::PlayerSettings(), and ServerSettings::ServerSettings(). |
|
Get method for the 'm_strClassName' member variable.
Definition at line 271 of file GenericValues.cpp. |
|
This method determines the value of the variable of which the name associated with it matches the first argument to the method. The value is converted to a string which is put into the second argument (note that enough memory must be allocated for this char*). This same string is also returned by the method. This enables you to use the method as an argument to a function such as 'strcpy'.
Definition at line 360 of file GenericValues.cpp. References GenericValueT::getValue(), and getValuePtr(). |
|
This (private) method returns a pointer to the GenericValueT object of which the name associated with the variable matches the argument passed to the method.
Definition at line 329 of file GenericValues.cpp. References getValuesTotal(), and m_values. Referenced by addSetting(), getValue(), and setValue(). |
|
Get method for the 'm_iValuesTotal' member variable.
Definition at line 278 of file GenericValues.cpp. Referenced by getValuePtr(), show(), and ~GenericValues(). |
|
This method reads generic values from a file indicated by the first argument to the method and stores them in the collection. In this file the names associated with each value must be listed first followed by a separator and then the value. The names associated with each value should match the string names with which the corresponding generic value is added using 'addSetting'.
Reimplemented in ServerSettings. Definition at line 412 of file GenericValues.cpp. References setValue(). Referenced by main(), and ServerSettings::readValues(). |
|
This method writes the generic values in the current collection to a file indicated by the first argument to the method. The string name associated with the value and the value itself are separated by a separator which is specified as the second argument.
Definition at line 478 of file GenericValues.cpp. References show(). |
|
This method sets the variable of which the name associated with it matches the first argument to the method to the value indicated by the second argument. The value is always supplied as a string which is then converted into the right type for the generic value in question.
Reimplemented in ServerSettings. Definition at line 387 of file GenericValues.cpp. References getValuePtr(), and GenericValueT::setValue(). Referenced by readValues(), and ServerSettings::setValue(). |
|
This display method writes all the generic values in the current collection to the output stream indicated by the first argument to the method. The name associated with each value and the value itself are separated by a separator which is specified as the second argument.
Definition at line 509 of file GenericValues.cpp. References getValuesTotal(), m_values, and GenericValueT::show(). Referenced by Player::executeStringCommand(), and saveValues(). |
|
the number of generic values in the current collection, i.e. the maximum number of values that can be stored Definition at line 136 of file GenericValues.h. Referenced by addSetting(), and GenericValues(). |
|
the total number of generic values stored in the collection so far Definition at line 134 of file GenericValues.h. Referenced by addSetting(), and GenericValues(). |
|
the name associated with this group of generic values; this is usually the name of the subclass which contains the actual variables Definition at line 129 of file GenericValues.h. Referenced by addSetting(), GenericValues(), and ~GenericValues(). |
|
a pointer to an array containing all generic value pointers (GenericValueT objects) Definition at line 132 of file GenericValues.h. Referenced by addSetting(), GenericValues(), getValuePtr(), show(), and ~GenericValues(). |