This wiki is archived and useful information is being migrated to the main bzflag.org website
bz APIStringList
BZFS API Documentation This page contains part of the BZFS API documentation for use by Plug-ins on the BZFS server. |
BZFS Class. This page documents a BZFS API class that is defined by the game server API. Plug-ins receive various classes in able to retrieve information about players and the game state from the server.
Contents
Declaration
class BZF_API bz_APIStringList { public: bz_APIStringList(); bz_APIStringList(const bz_APIStringList &r); bz_APIStringList(const std::vector<std::string> &r); ~bz_APIStringList(); void push_back ( const bz_ApiString &value ); void push_back ( const std::string &value ); bz_ApiString get ( unsigned int i ); const bz_ApiString& operator[] (unsigned int i) const; bz_APIStringList& operator= ( const bz_APIStringList &r ); bz_APIStringList& operator= ( const std::vector<std::string> &r ); unsigned int size ( void ); void clear ( void ); void tokenize ( const char* in, const char* delims, int maxTokens = 0, bool useQuotes = false); };
BZF_API bz_APIStringList* bz_newStringList ( void ); BZF_API void bz_deleteStringList( bz_APIStringList * l );
Description
Contains a list of strings. Comparable to std::vector<std::string>
Plugins generally should never create Bz_APIStringList objects, only copy the data out.
Member Access
bz_ApiString get ( unsigned int i );
const bz_ApiString& operator[] (unsigned int i) const;
Parameters
- unsigned int i
- bz_ApiString element to return
Functions
size
unsigned int size ( void );
Returns the number of elements on the list
clear
void clear ( void );
Removes all elements from the list
tokenize
void tokenize ( const char* in, const char* delims, int maxTokens = 0, bool useQuotes = false);
Appends a list generated from a tokenized string. Use of this function is discouraged, the tokenize() function available in plugin_utils is prefered.