MCPcopy Create free account
hub / github.com/ddnet/ddnet / ParseStart

Method ParseStart

src/engine/shared/console.cpp:158–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156// the maximum number of tokens occurs in a string of length CONSOLE_MAX_STR_LENGTH with tokens size 1 separated by single spaces
157
158int CConsole::ParseStart(CResult *pResult, const char *pString, int Length)
159{
160 char *pStr;
161 int Len = sizeof(pResult->m_aStringStorage);
162 if(Length < Len)
163 Len = Length;
164
165 str_copy(pResult->m_aStringStorage, pString, Len);
166 pStr = pResult->m_aStringStorage;
167
168 // get command
169 pStr = str_skip_whitespaces(pStr);
170 pResult->m_pCommand = pStr;
171 pStr = str_skip_to_whitespace(pStr);
172
173 if(*pStr)
174 {
175 pStr[0] = 0;
176 pStr++;
177 }
178
179 pResult->m_pArgsStart = pStr;
180 return 0;
181}
182
183int CConsole::ParseArgs(CResult *pResult, const char *pFormat)
184{

Callers

nothing calls this directly

Calls 3

str_skip_whitespacesFunction · 0.85
str_skip_to_whitespaceFunction · 0.85
str_copyFunction · 0.50

Tested by

no test coverage detected