MCPcopy Create free account
hub / github.com/dds-bridge/dds / parse_PAR

Function parse_PAR

library/tests/parse.cpp:375–422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

373
374
375bool parse_PAR(
376 const vector<string>& list,
377 ParResults * par)
378{
379 if (list.size() < 9)
380 {
381 cout << "PAR list does not have 9+ elements: " << list.size() << endl;
382 return false;
383 }
384
385 if (! get_head_element(list[0], "PAR"))
386 return false;
387
388 if (! strip_quotes(list[1] + " " + list[2], par->par_score[0],
389 "PAR score 0"))
390 return false;
391
392 if (! strip_quotes(list[3] + " " + list[4], par->par_score[1],
393 "PAR score 1"))
394 return false;
395
396 unsigned i = 5;
397 string st = "";
398 while (i < list.size())
399 {
400 st += " " + list[i++];
401 if (st.back() == '"')
402 break;
403 }
404
405 if (! strip_quotes(st.substr(1), par->par_contracts_string[0],
406 "PAR contract 0"))
407 return false;
408
409 st = "";
410 while (i < list.size())
411 {
412 st += " " + list[i++];
413 if (st.back() == '"')
414 break;
415 }
416
417 if (! strip_quotes(st.substr(1), par->par_contracts_string[1],
418 "PAR contract 1"))
419 return false;
420
421 return true;
422}
423
424
425bool parse_DEALERPAR(

Callers 1

read_fileFunction · 0.85

Calls 2

get_head_elementFunction · 0.85
strip_quotesFunction · 0.85

Tested by

no test coverage detected