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 "game/C4Application.h"
#include "config/C4Config.h"
#include "C4Version.h"
#include "network/C4InteractiveThread.h"
#include "gui/C4Gui.h"
#include <cctype>
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 29 of file C4Network2IRC.cpp.

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

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

Here is the call graph for this function: