MCPcopy Create free account
hub / github.com/Illumina/hap.py / readToken

Method readToken

external/jsoncpp/jsoncpp.cpp:421–490  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

419}
420
421bool Reader::readToken(Token &token) {
422 skipSpaces();
423 token.start_ = current_;
424 Char c = getNextChar();
425 bool ok = true;
426 switch (c) {
427 case '{':
428 token.type_ = tokenObjectBegin;
429 break;
430 case '}':
431 token.type_ = tokenObjectEnd;
432 break;
433 case '[':
434 token.type_ = tokenArrayBegin;
435 break;
436 case ']':
437 token.type_ = tokenArrayEnd;
438 break;
439 case '"':
440 token.type_ = tokenString;
441 ok = readString();
442 break;
443 case '/':
444 token.type_ = tokenComment;
445 ok = readComment();
446 break;
447 case '0':
448 case '1':
449 case '2':
450 case '3':
451 case '4':
452 case '5':
453 case '6':
454 case '7':
455 case '8':
456 case '9':
457 case '-':
458 token.type_ = tokenNumber;
459 readNumber();
460 break;
461 case 't':
462 token.type_ = tokenTrue;
463 ok = match("rue", 3);
464 break;
465 case 'f':
466 token.type_ = tokenFalse;
467 ok = match("alse", 4);
468 break;
469 case 'n':
470 token.type_ = tokenNull;
471 ok = match("ull", 3);
472 break;
473 case ',':
474 token.type_ = tokenArraySeparator;
475 break;
476 case ':':
477 token.type_ = tokenMemberSeparator;
478 break;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected