MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / readToken

Method readToken

json/jsoncpp.cpp:492–561  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

490}
491
492bool Reader::readToken(Token& token) {
493 skipSpaces();
494 token.start_ = current_;
495 Char c = getNextChar();
496 bool ok = true;
497 switch (c) {
498 case '{':
499 token.type_ = tokenObjectBegin;
500 break;
501 case '}':
502 token.type_ = tokenObjectEnd;
503 break;
504 case '[':
505 token.type_ = tokenArrayBegin;
506 break;
507 case ']':
508 token.type_ = tokenArrayEnd;
509 break;
510 case '"':
511 token.type_ = tokenString;
512 ok = readString();
513 break;
514 case '/':
515 token.type_ = tokenComment;
516 ok = readComment();
517 break;
518 case '0':
519 case '1':
520 case '2':
521 case '3':
522 case '4':
523 case '5':
524 case '6':
525 case '7':
526 case '8':
527 case '9':
528 case '-':
529 token.type_ = tokenNumber;
530 readNumber();
531 break;
532 case 't':
533 token.type_ = tokenTrue;
534 ok = match("rue", 3);
535 break;
536 case 'f':
537 token.type_ = tokenFalse;
538 ok = match("alse", 4);
539 break;
540 case 'n':
541 token.type_ = tokenNull;
542 ok = match("ull", 3);
543 break;
544 case ',':
545 token.type_ = tokenArraySeparator;
546 break;
547 case ':':
548 token.type_ = tokenMemberSeparator;
549 break;

Callers

nothing calls this directly

Calls 1

matchClass · 0.85

Tested by

no test coverage detected