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

#include <C4League.h>

Public Member Functions

 C4LeagueFBIDList ()
 
 ~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 ( )
inline

Definition at line 196 of file C4League.h.

196 : pFirst(nullptr) {}
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 238 of file C4League.cpp.

References RemoveFBIDByAccount().

Referenced by C4LeagueClient::GetAuthReply().

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

Here is the call graph for this function:

Here is the caller graph for this function:

void C4LeagueFBIDList::Clear ( )

Definition at line 198 of file C4League.cpp.

Referenced by ~C4LeagueFBIDList().

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

Here is the caller graph for this function:

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

Definition at line 208 of file C4League.cpp.

References StdStrBuf::Copy().

Referenced by DisconnectData::CompileFunc().

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

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 221 of file C4League.cpp.

Referenced by AddFBID().

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

Here is the caller graph for this function:


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