Fix crash
[ryzomcore.git] / snowballs2 / client / src / configuration.h
blob2f398e40256c05fa854451be677bf8f515c2351f
1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #ifndef SBCLIENT_CONFIGURATION_H
18 #define SBCLIENT_CONFIGURATION_H
19 #include <nel/misc/types_nl.h>
21 // STL includes
23 // NeL includes
24 #include <nel/misc/config_file.h>
25 #include <nel/misc/rgba.h>
26 #include <nel/misc/ucstring.h>
28 // Project includes
30 namespace SBCLIENT {
32 /**
33 * \brief CConfiguration
34 * \date 2008-11-06 16:25GMT
35 * \author Jan Boon (Kaetemi)
36 * CConfiguration
38 class CConfiguration
40 public:
41 static bool init();
42 static bool release();
44 static void updateUtilities();
46 static void setAndCallback(const std::string &varName, void (*cb)(NLMISC::CConfigFile::CVar &var));
47 static void dropCallback(const std::string &varName);
49 static float getValue(const std::string &varName, float defaultValue);
50 static double getValue(const std::string &varName, double defaultValue);
51 static int getValue(const std::string &varName, int defaultValue);
52 static std::string getValue(const std::string &varName, const std::string &defaultValue);
53 static ucstring getValue(const std::string &varName, const ucstring &defaultValue);
54 static bool getValue(const std::string &varName, bool defaultValue);
55 static NLMISC::CRGBA getValue(const std::string &varName, const NLMISC::CRGBA &defaultValue);
56 static NLMISC::CRGBA getValue(const NLMISC::CConfigFile::CVar &var, const NLMISC::CRGBA &defaultValue);
58 }; /* class CConfiguration */
60 } /* namespace SBCLIENT */
62 #endif /* #ifndef SBCLIENT_CONFIGURATION_H */
64 /* end of file */