Panda3D
dconfig.I
1 // Filename: dconfig.I
2 // Created by: cary (20Mar00)
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 
16 bool DConfig::
17 GetBool(const string &sym, bool def) {
18  ConfigVariableBool var(sym, def, "DConfig", ConfigFlags::F_dconfig);
19  return var.get_value();
20 }
21 
22 int DConfig::
23 GetInt(const string &sym, int def) {
24  ConfigVariableInt var(sym, def, "DConfig", ConfigFlags::F_dconfig);
25  return var.get_value();
26 }
27 
28 float DConfig::
29 GetFloat(const string &sym, float def) {
30  ConfigVariableDouble var(sym, def, "DConfig", ConfigFlags::F_dconfig);
31  return (float)var.get_value();
32 }
33 
34 double DConfig::
35 GetDouble(const string &sym, double def) {
36  ConfigVariableDouble var(sym, def, "DConfig", ConfigFlags::F_dconfig);
37  return var.get_value();
38 }
39 
40 string DConfig::
41 GetString(const string &sym, const string &def) {
42  ConfigVariableString var(sym, def, "DConfig", ConfigFlags::F_dconfig);
43  return var.get_value();
44 }
This is a convenience class to specialize ConfigVariable as a boolean type.
This is a convenience class to specialize ConfigVariable as a floating-point type.
This is a convenience class to specialize ConfigVariable as a string type.
This is a convenience class to specialize ConfigVariable as an integer type.