Nebula
Loading...
Searching...
No Matches
cvar.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
24//------------------------------------------------------------------------------
25namespace Core
26{
27
29struct CVar;
30
38
41{
42 const char* name = nullptr;
43 const char* defaultValue = nullptr;
45 const char* description = nullptr;
46};
47
51CVar* CVarCreate(CVarType type, const char* name, const char* defaultValue, const char* description = nullptr);
53CVar* CVarGet(const char* name);
55void CVarParseWrite(CVar*, const char* value);
57void CVarWriteFloat(CVar*, float value);
59void CVarWriteInt(CVar*, int value);
61void CVarWriteString(CVar*, const char* value);
63int const CVarReadInt(CVar*);
65float const CVarReadFloat(CVar*);
67const char* CVarReadString(CVar*);
69bool CVarModified(CVar*);
71void CVarSetModified(CVar*, bool);
75const char* CVarGetName(CVar*);
77const char* CVarGetDescription(CVar*);
79int CVarNum();
83CVar* CVarsEnd();
86
87} // namespace Core
Definition coreserver.cc:11
void CVarWriteFloat(CVar *cVar, float value)
Write float value to cvar.
Definition cvar.cc:116
bool CVarModified(CVar *cVar)
Check if a CVar has been modified.
Definition cvar.cc:215
float const CVarReadFloat(CVar *cVar)
Read float value from cvar.
Definition cvar.cc:185
const char * CVarGetName(CVar *cVar)
Get the cvars name.
Definition cvar.cc:242
int const CVarReadInt(CVar *cVar)
Read int value from cvar.
Definition cvar.cc:170
CVar * CVarCreate(CVarCreateInfo const &info)
Create or get a console variable.
Definition cvar.cc:40
void CVarWriteInt(CVar *cVar, int value)
Write int value to cvar.
Definition cvar.cc:133
CVar * CVarGet(const char *name)
Get a console variable.
Definition cvar.cc:78
const char * CVarGetDescription(CVar *cVar)
Get the cvars description.
Definition cvar.cc:251
CVar * CVarNext(CVar *cVar)
increment the iterator
Definition cvar.cc:287
void CVarParseWrite(CVar *cVar, const char *value)
Parse value from c string and assign to cvar.
Definition cvar.cc:94
const char * CVarReadString(CVar *cVar)
Read string value from cvar.
Definition cvar.cc:200
CVarType
Denotes the type of a Core::CVar.
Definition cvar.h:33
@ CVar_Float
Definition cvar.h:35
@ CVar_String
Definition cvar.h:36
@ CVar_Int
Definition cvar.h:34
void CVarSetModified(CVar *cVar, bool value)
Set the modified status of a cvar.
Definition cvar.cc:224
CVar * CVarsEnd()
Get a pointer to the address after the last valid cvar in the array.
Definition cvar.cc:278
int CVarNum()
Get the number of vars created.
Definition cvar.cc:260
void CVarWriteString(CVar *cVar, const char *value)
Write string value to cvar.
Definition cvar.cc:150
CVar * CVarsBegin()
Get a pointer to the first cvar in the array.
Definition cvar.cc:269
CVarType CVarGetType(CVar *cVar)
Get the type of a cvar.
Definition cvar.cc:233
Used to create a Core::CVar.
Definition cvar.h:41
const char * defaultValue
Definition cvar.h:43
CVarType type
Definition cvar.h:44
const char * description
Definition cvar.h:45
const char * name
Definition cvar.h:42
A console variable.
Definition cvar.cc:24