OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4Network2IRC.cpp File Reference
#include "C4Include.h"
#include "network/C4Network2IRC.h"
#include "C4Version.h"
#include "game/C4Application.h"
#include "gui/C4Gui.h"
#include "network/C4InteractiveThread.h"
Include dependency graph for C4Network2IRC.cpp:

Go to the source code of this file.

Functions

StdStrBuf ircExtractPar (const char **ppPar)
 

Function Documentation

StdStrBuf ircExtractPar ( const char **  ppPar)

Definition at line 26 of file C4Network2IRC.cpp.

References StdStrBuf::CopyUntil(), StdStrBuf::getLength(), and StdStrBuf::Ref().

27 {
28  // No parameter left?
29  if (!ppPar || !*ppPar || !**ppPar)
30  return StdStrBuf("");
31  // Last parameter?
32  StdStrBuf Result;
33  if (**ppPar == ':')
34  {
35  // Reference everything after the double-colon
36  Result.Ref(*ppPar + 1);
37  *ppPar = nullptr;
38  }
39  else
40  {
41  // Copy until next space (or end of string)
42  Result.CopyUntil(*ppPar, ' ');
43  // Go over parameters
44  *ppPar += Result.getLength();
45  if (**ppPar == ' ')
46  (*ppPar)++;
47  else
48  *ppPar = nullptr;
49  }
50  // Done
51  return Result;
52 }
void CopyUntil(const char *szString, char cUntil)
Definition: StdBuf.h:613
void Ref(const char *pnData)
Definition: StdBuf.h:455
size_t getLength() const
Definition: StdBuf.h:445

Here is the call graph for this function: