From f973f5beb701d7436baf55d92d660f062a879057 Mon Sep 17 00:00:00 2001 From: Arkshine Date: Sat, 17 Jan 2015 00:40:25 +0100 Subject: [PATCH] Cvars: Convert CString to ke::AString in CCVar class --- amxmodx/cvars.h | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/amxmodx/cvars.h b/amxmodx/cvars.h index f267eae6..9d29bc9d 100644 --- a/amxmodx/cvars.h +++ b/amxmodx/cvars.h @@ -11,37 +11,45 @@ #define CVARS_H #include "cvardef.h" -#include "CString.h" +#include class CDetour; class CCVar { cvar_t cvar; - String name; - String plugin; + ke::AString name; + ke::AString plugin; public: CCVar(const char* pname, const char* pplugin, int pflags, float pvalue) : name(pname), plugin(pplugin) { - cvar.name = (char*)name.c_str(); - cvar.flags = pflags; + cvar.name = name.chars(); + cvar.flags = pflags; cvar.string = ""; - cvar.value = pvalue; + cvar.value = pvalue; } - inline cvar_t* getCvar() { + inline cvar_t* getCvar() + { return &cvar; } - inline const char* getPluginName() { - return plugin.c_str(); + + inline const char* getPluginName() + { + return plugin.chars(); } - inline const char* getName() { - return name.c_str(); + + inline const char* getName() + { + return name.chars(); } - inline bool operator == (const char* string) { - return (strcmp(name.c_str(), string) == 0); + + inline bool operator == (const char* string) + { + return name.compare(string) == 0; } + int plugin_id; };