|
UFO: Alien Invasion
|
Info string handling. More...


Go to the source code of this file.
Macros | |
| #define | MAX_INFO_KEY 64 |
| #define | MAX_INFO_VALUE 64 |
| #define | MAX_INFO_STRING 512 |
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. | |
| 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. | |
| void | Info_SetValueForKey (char *s, const size_t size, const char *key, const char *value) |
| Adds a new entry into string with given value. | |
| void | Info_SetValueForKeyAsInteger (char *s, const size_t size, const char *key, const int value) |
| void | Info_Print (const char *s) |
| Prints info strings (like userinfo or serverinfo - CVAR_USERINFO, CVAR_SERVERINFO). | |
| bool | Info_Validate (const char *s) |
| Some characters are illegal in info strings because they can mess up the server's parsing. | |
Info string handling.
Definition in file infostring.h.
| #define MAX_INFO_KEY 64 |
Definition at line 34 of file infostring.h.
Referenced by Info_SetValueForKey().
| #define MAX_INFO_STRING 512 |
Definition at line 36 of file infostring.h.
Referenced by CL_Connect(), CL_SendChangedUserinfos(), CL_UserInfo_f(), GAME_MP_ParseServerInfoMessage(), Info_SetValueForKey(), SV_Serverinfo_f(), SV_ShowServerinfo_f(), SVC_DirectConnect(), SVC_Info(), SVC_Status(), SVC_TeamInfo(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
| #define MAX_INFO_VALUE 64 |
Definition at line 35 of file infostring.h.
Referenced by Info_SetValueForKey().
| const char * Info_BoolForKey | ( | const char * | s, |
| const char * | key ) |
Definition at line 76 of file infostring.cpp.
References Info_ValueForKey(), key, 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(), and key.
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.
References key.
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(), key, 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(), TEST_F(), 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(), key, 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 key, and 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().