From 31959bc355c471c573828bf63932850e46c4b5bc Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 9 Feb 2008 23:06:00 +0000 Subject: more entities --- src/core/cvar.h | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'src/core/cvar.h') diff --git a/src/core/cvar.h b/src/core/cvar.h index 205a416..9b23563 100644 --- a/src/core/cvar.h +++ b/src/core/cvar.h @@ -1,7 +1,7 @@ /* core/cvar.h - This file is part of the Osirion project and is distributed under - the terms of the GNU General Public License version 2 + This file is part of the Osirion project and is distributed under + the terms of the GNU General Public License version 2 */ #ifndef __INCLUDED_CORE_CVAR_H__ @@ -10,18 +10,21 @@ #include #include -namespace core { +namespace core +{ /// the cvar container class -class Cvar_t { +class Cvar_t +{ public: - Cvar_t(unsigned int cvflags = 0); + Cvar_t(unsigned int cvflags = 0); + Cvar_t &operator=(const char *other); Cvar_t &operator=(const std::string &other); Cvar_t &operator=(int other); Cvar_t &operator=(float other); - + unsigned int flags() const; float value() const; const std::string &text() const; @@ -36,30 +39,33 @@ private: typedef Cvar_t *Cvar; /// the cvar registry -namespace cvar +namespace cvar { +/// cvar flags +enum Flags {Archive=2, ReadOnly=4}; + /// get a cvar value from the registry /** If the a cvar with the given name already exists in the registry, - * its value will not be changed. If the cvar does not exist, + * its value will not be changed. If the cvar does not exist, * it will be created */ Cvar get(const char *name, const char *value, int flags=0); /// get a cvar value from the registry /** If the a cvar with the given name already exists in the registry, - * its value will not be changed. If the cvar does not exist, + * its value will not be changed. If the cvar does not exist, * it will be created */ Cvar get(const char *name, float value, int flags=0); /// set a cvar value /** If the a cvar with the given name already exists in the registry, - * its value will be replaced + * its value will be replaced */ Cvar set(const char *name, const char *value, int flags=0); /// set a cvar value /** If the a cvar with the given name already exists in the registry, - * its value will be replaced + * its value will be replaced */ Cvar set(const char *name, float value, int flags=0); -- cgit v1.2.3