OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4LeagueFBIDList Class Reference

#include <C4League.h>

Public Member Functions

 C4LeagueFBIDList ()=default
 
 ~C4LeagueFBIDList ()
 
void Clear ()
 
void RemoveFBIDByAccount (const char *szAccount)
 
bool FindFBIDByAccount (const char *szAccount, StdStrBuf *pFBIDOut)
 
void AddFBID (const char *szFBID, const char *szAccount)
 

Detailed Description

Definition at line 185 of file C4League.h.

Constructor & Destructor Documentation

C4LeagueFBIDList::C4LeagueFBIDList ( )
default
C4LeagueFBIDList::~C4LeagueFBIDList ( )
inline

Definition at line 197 of file C4League.h.

References Clear().

197 { Clear(); }

Here is the call graph for this function:

Member Function Documentation

void C4LeagueFBIDList::AddFBID ( const char *  szFBID,
const char *  szAccount 
)

Definition at line 237 of file C4League.cpp.

References RemoveFBIDByAccount().

Referenced by C4LeagueClient::GetAuthReply().

238 {
239  // add new FBID item to head of list
240  assert(szFBID); assert(szAccount);
241  // remove any existing FBIDs
242  RemoveFBIDByAccount(szAccount);
243  // add new entry
244  FBIDItem *pNewItem = new FBIDItem();
245  pNewItem->FBID.Copy(szFBID);
246  pNewItem->Account.Copy(szAccount);
247  pNewItem->pNext = pFirst;
248  pFirst = pNewItem;
249 }
void RemoveFBIDByAccount(const char *szAccount)
Definition: C4League.cpp:220

Here is the call graph for this function:

Here is the caller graph for this function:

void C4LeagueFBIDList::Clear ( )

Definition at line 197 of file C4League.cpp.

Referenced by ~C4LeagueFBIDList().

198 {
199  while (pFirst)
200  {
201  FBIDItem *pDel = pFirst;
202  pFirst = pDel->pNext;
203  delete pDel;
204  }
205 }

Here is the caller graph for this function:

bool C4LeagueFBIDList::FindFBIDByAccount ( const char *  szAccount,
StdStrBuf pFBIDOut 
)

Definition at line 207 of file C4League.cpp.

References StdStrBuf::Copy().

Referenced by DisconnectData::CompileFunc().

208 {
209  assert(szAccount);
210  if (!szAccount) return false;
211  for (FBIDItem *pItem = pFirst; pItem; pItem = pItem->pNext)
212  if (pItem->Account == szAccount)
213  {
214  if (pFBIDOut) pFBIDOut->Copy(pItem->FBID);
215  return true;
216  }
217  return false;
218 }
void Copy()
Definition: StdBuf.h:467

Here is the call graph for this function:

Here is the caller graph for this function:

void C4LeagueFBIDList::RemoveFBIDByAccount ( const char *  szAccount)

Definition at line 220 of file C4League.cpp.

Referenced by AddFBID().

221 {
222  FBIDItem *pPrev = nullptr, *pItem = pFirst;
223  while (pItem)
224  {
225  // Delete?
226  if (pItem->Account == szAccount)
227  {
228  (pPrev ? pPrev->pNext : pFirst) = pItem->pNext;
229  delete pItem;
230  return;
231  }
232  // Next
233  pPrev = pItem; pItem = pItem->pNext;
234  }
235 }

Here is the caller graph for this function:


The documentation for this class was generated from the following files: