UFO: Alien Invasion
|
Info string handling. More...
Go to the source code of this file.
Functions | |
const char * | Info_ValueForKey (const char *s, const char *key) |
Searches the string for the given key and returns the associated value, or an empty string. More... | |
const char * | Info_BoolForKey (const char *s, const char *key) |
int | Info_IntegerForKey (const char *s, const char *key) |
void | Info_RemoveKey (char *s, const char *key) |
Searches through s for key and remove is. More... | |
bool | Info_Validate (const char *s) |
Some characters are illegal in info strings because they can mess up the server's parsing. More... | |
void | Info_SetValueForKeyAsInteger (char *s, const size_t size, const char *key, const int value) |
void | Info_SetValueForKey (char *s, const size_t size, const char *key, const char *value) |
Adds a new entry into string with given value. More... | |
void | Info_Print (const char *s) |
Prints info strings (like userinfo or serverinfo - CVAR_USERINFO, CVAR_SERVERINFO) More... | |
Info string handling.
Definition in file infostring.cpp.
const char* Info_BoolForKey | ( | const char * | s, |
const char * | key | ||
) |
Definition at line 76 of file infostring.cpp.
References Info_ValueForKey(), and Q_streq.
Referenced by GAME_MP_ParseServerInfoMessage().
int Info_IntegerForKey | ( | const char * | s, |
const char * | key | ||
) |
Definition at line 84 of file infostring.cpp.
References Info_ValueForKey().
Referenced by G_ClientGetTeamNumPref(), G_ClientUserinfoChanged(), GAME_MP_ParseTeamInfoMessage(), GAME_MP_ProcessPingReply(), and SV_UserinfoChanged().
void Info_Print | ( | const char * | s | ) |
Prints info strings (like userinfo or serverinfo - CVAR_USERINFO, CVAR_SERVERINFO)
Definition at line 209 of file infostring.cpp.
References Com_Printf(), and key.
Referenced by CL_UserInfo_f(), SV_Serverinfo_f(), SV_ShowServerinfo_f(), and SV_UserInfo_f().
void Info_RemoveKey | ( | char * | s, |
const char * | key | ||
) |
Searches through s for key and remove is.
[in] | s | String to search key in |
[in] | key | String to search for in s |
Definition at line 95 of file infostring.cpp.
Referenced by Info_SetValueForKey(), and TEST_F().
void Info_SetValueForKey | ( | char * | s, |
const size_t | size, | ||
const char * | key, | ||
const char * | value | ||
) |
Adds a new entry into string with given value.
[in,out] | s | The target info string |
[in] | size | The size of s |
[in] | key | The key to set |
[in] | value | The value to set for the given key |
Definition at line 169 of file infostring.cpp.
References Com_Printf(), Com_sprintf(), DOUBLEQUOTE, Info_RemoveKey(), MAX_INFO_KEY, MAX_INFO_STRING, MAX_INFO_VALUE, Q_strncpyz(), and Q_strnull().
Referenced by Cvar_BitInfo(), G_ClientConnect(), Info_SetValueForKeyAsInteger(), SVC_DirectConnect(), SVC_Info(), SVC_TeamInfo(), and TEST_F().
void Info_SetValueForKeyAsInteger | ( | char * | s, |
const size_t | size, | ||
const char * | key, | ||
const int | value | ||
) |
Definition at line 154 of file infostring.cpp.
References Info_SetValueForKey(), and va().
Referenced by G_SetTeamForPlayer(), SVC_Info(), and SVC_TeamInfo().
bool Info_Validate | ( | const char * | s | ) |
Some characters are illegal in info strings because they can mess up the server's parsing.
Definition at line 142 of file infostring.cpp.
Referenced by G_ClientUserinfoChanged().
const char* Info_ValueForKey | ( | const char * | s, |
const char * | key | ||
) |
Searches the string for the given key and returns the associated value, or an empty string.
[in] | s | The string you want to extract the keyvalue from |
[in] | key | The key you want to extract the value for |
Definition at line 39 of file infostring.cpp.
References Q_strcasecmp.
Referenced by G_ClientConnect(), G_ClientUserinfoChanged(), GAME_MP_ParseServerInfoMessage(), GAME_MP_ParseTeamInfoMessage(), GAME_MP_ProcessPingReply(), Info_BoolForKey(), Info_IntegerForKey(), SV_UserinfoChanged(), SVC_DirectConnect(), and TEST_F().