Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-02-09 23:06:00 +0000
committerStijn Buys <ingar@osirion.org>2008-02-09 23:06:00 +0000
commit31959bc355c471c573828bf63932850e46c4b5bc (patch)
treecc473901e88926e36c89775a7fc97a51da948498 /src/core/cvar.h
parentd281384f727583b39b8e97ffea58b278ecc8dd47 (diff)
more entities
Diffstat (limited to 'src/core/cvar.h')
-rw-r--r--src/core/cvar.h28
1 files changed, 17 insertions, 11 deletions
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 <string>
#include <map>
-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);