MCPcopy Create free account
hub / github.com/cuberite/cuberite / Finish

Method Finish

src/HTTPServer/NameValueParser.cpp:362–409  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

360
361
362bool cNameValueParser::Finish(void)
363{
364 switch (m_State)
365 {
366 case psInvalid:
367 {
368 return false;
369 }
370 case psFinished:
371 {
372 return true;
373 }
374 case psKey:
375 case psEqualSpace:
376 case psEqual:
377 {
378 if ((m_AllowsKeyOnly) && !m_CurrentKey.empty())
379 {
380 (*this)[m_CurrentKey] = "";
381 m_State = psFinished;
382 return true;
383 }
384 m_State = psInvalid;
385 return false;
386 }
387 case psValueRaw:
388 {
389 (*this)[m_CurrentKey] = m_CurrentValue;
390 m_State = psFinished;
391 return true;
392 }
393 case psValueInDQuotes:
394 case psValueInSQuotes:
395 {
396 // Missing the terminating quotes, this is an error
397 m_State = psInvalid;
398 return false;
399 }
400 case psKeySpace:
401 case psAfterValue:
402 {
403 m_State = psFinished;
404 return true;
405 }
406 }
407 ASSERT(!"Unhandled parser state!");
408 return false;
409}
410
411
412

Callers 1

cNameValueParserTestMethod · 0.45

Calls 1

emptyMethod · 0.80

Tested by

no test coverage detected