22 INLINE ConfigVariable::
23 ConfigVariable(
const string &name, ConfigVariable::ValueType value_type) :
34 INLINE ConfigVariable::
35 ConfigVariable(
const string &name, ConfigVariable::ValueType value_type,
36 const string &description,
int flags) :
49 INLINE ConfigVariable::
50 ConfigVariable(
const string &name) :
61 INLINE ConfigVariable::
75 return _core->get_default_value();
86 nassertr(is_constructed(), *
new string());
101 nassertv(is_constructed());
102 _core->make_local_value()->set_string_value(string_value);
114 nassertv(is_constructed());
115 _core->clear_local_value();
127 nassertr(is_constructed(), 0);
142 nassertr(is_constructed(),
false);
155 nassertr(is_constructed(),
false);
168 nassertr(is_constructed(),
false);
181 nassertr(is_constructed(),
false);
194 nassertr(is_constructed(),
false);
208 nassertr(is_constructed(),
string());
222 nassertr(is_constructed(),
false);
236 nassertr(is_constructed(), 0);
250 nassertr(is_constructed(), 0);
264 nassertr(is_constructed(), 0.0);
277 nassertv(is_constructed());
278 _core->make_local_value()->set_string_word(n, value);
289 nassertv(is_constructed());
290 _core->make_local_value()->set_bool_word(n, value);
301 nassertv(is_constructed());
302 _core->make_local_value()->set_int_word(n, value);
313 nassertv(is_constructed());
314 _core->make_local_value()->set_int64_word(n, value);
325 nassertv(is_constructed());
326 _core->make_local_value()->set_double_word(n, value);
338 INLINE
bool ConfigVariable::
339 is_constructed()
const {
342 report_unconstructed();
bool has_string_word(int n) const
Returns true if the variable's value has a valid string value for the nth word.
void set_bool_word(int n, bool value)
Changes the nth word to the indicated value without affecting the other words.
bool has_bool_word(int n) const
Returns true if the declaration's value has a valid boolean value for the nth word.
The internal definition of a ConfigVariable.
bool has_bool_word(int n) const
Returns true if the variable's value has a valid boolean value for the nth word.
bool get_bool_word(int n) const
Returns the boolean value of the nth word of the declaration's value, or false if there is no nth val...
bool has_string_word(int n) const
Returns true if the declaration's value has a valid string value for the nth word.
string get_string_word(int n) const
Returns the string value of the nth word of the variable's value, or empty string if there is no nth ...
void set_double_word(int n, double value)
Changes the nth word to the indicated value without affecting the other words.
bool has_int_word(int n) const
Returns true if the declaration's value has a valid integer value for the nth word.
double get_double_word(int n) const
Returns the integer value of the nth word of the declaration's value, or 0 if there is no nth value...
const ConfigDeclaration * get_default_value() const
Returns the default variable specified for this variable.
PN_int64 get_int64_word(int n) const
Returns the int64 value of the nth word of the declaration's value, or 0 if there is no nth value...
bool has_double_word(int n) const
Returns true if the declaration's value has a valid integer value for the nth word.
double get_double_word(int n) const
Returns the integer value of the nth word of the variable's value, or 0 if there is no nth value...
void set_int64_word(int n, PN_int64 value)
Changes the nth word to the indicated value without affecting the other words.
bool has_int_word(int n) const
Returns true if the variable's value has a valid integer value for the nth word.
int get_int_word(int n) const
Returns the integer value of the nth word of the declaration's value, or 0 if there is no nth value...
void clear_value()
Removes the value assigned to this variable, and lets its original value (as read from the prc files)...
bool has_int64_word(int n) const
Returns true if the declaration's value has a valid int64 value for the nth word. ...
int get_num_words() const
Returns the number of words in the declaration's value.
int get_num_words() const
Returns the number of words in the variable's value.
int get_int_word(int n) const
Returns the integer value of the nth word of the variable's value, or 0 if there is no nth value...
void set_string_value(const string &value)
Changes the value assigned to this variable.
const string & get_string_value() const
Returns the toplevel value of the variable, formatted as a string.
This class is the base class for both ConfigVariableList and ConfigVariable (and hence for all of the...
bool get_bool_word(int n) const
Returns the boolean value of the nth word of the variable's value, or false if there is no nth value...
PN_int64 get_int64_word(int n) const
Returns the int64 value of the nth word of the variable's value, or 0 if there is no nth value...
bool has_double_word(int n) const
Returns true if the variable's value has a valid integer value for the nth word.
A single declaration of a config variable, typically defined as one line in a .prc file...
void set_int_word(int n, int value)
Changes the nth word to the indicated value without affecting the other words.
string get_string_word(int n) const
Returns the string value of the nth word of the declaration's value, or empty string if there is no n...
void set_string_word(int n, const string &value)
Changes the nth word to the indicated value without affecting the other words.
const string & get_string_value() const
Returns the value assigned to this variable.
bool has_int64_word(int n) const
Returns true if the variable's value has a valid 64-bit integer value for the nth word...