diff options
author | Stijn Buys <ingar@osirion.org> | 2009-10-04 09:12:25 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2009-10-04 09:12:25 +0000 |
commit | 9e6f1cc494a329d32d0d8f0ca0acd563b3acaf7f (patch) | |
tree | 96897c0ffe4a6027261c7c0a29c283af595266f5 /src/core/cvar.h | |
parent | 0362ba4c084e8bd22f476ea6086bbc47323175bf (diff) |
minor core cleanups
Diffstat (limited to 'src/core/cvar.h')
-rw-r--r-- | src/core/cvar.h | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/src/core/cvar.h b/src/core/cvar.h index 3d7b246..21491fd 100644 --- a/src/core/cvar.h +++ b/src/core/cvar.h @@ -65,14 +65,34 @@ public: /// set the info string void set_info(const char* info); - /// char * assignment operator - Cvar &operator=(const char* other); + /// std::string assignment + void assign(const std::string& other); + + /// char * assignment + void assign(const char* other); + + /// float assignment + void assign(const float other); /// std::string assignment operator - Cvar &operator=(const std::string& other); + inline Cvar & operator=(const std::string& other) + { + assign(other); + return (*this); + } + /// char * assignment operator + inline Cvar & operator=(const char* other) + { + assign(other); + return (*this); + } /// float assignment operator - Cvar &operator=(const float other); + inline Cvar & operator=(const float other) + { + assign(other); + return (*this); + } /* ---- Static functions for the Cvar registry -------------------- */ @@ -107,7 +127,7 @@ public: * If the a cvar with the given name already exists in the registry, * its value will be replaced */ - static Cvar* set(const char* name, float value, const unsigned int flags = 0); + static Cvar* set(const char* name, const float value, const unsigned int flags = 0); /// search for a named cvar, returns 0 if not found static Cvar* find(const std::string& name); |