Cvars: Convert CString to ke::AString in CCVar class

This commit is contained in:
Arkshine 2015-01-17 00:40:25 +01:00
parent 6619176a76
commit f973f5beb7

View File

@ -11,37 +11,45 @@
#define CVARS_H
#include "cvardef.h"
#include "CString.h"
#include <am-string.h>
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;
};