MCPcopy Create free account
hub / github.com/Kitware/VTK / readArray

Method readArray

ThirdParty/jsoncpp/vtkjsoncpp/jsoncpp.cpp:728–761  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

726}
727
728bool Reader::readArray(Token& token) {
729 Value init(arrayValue);
730 currentValue().swapPayload(init);
731 currentValue().setOffsetStart(token.start_ - begin_);
732 skipSpaces();
733 if (current_ != end_ && *current_ == ']') // empty array
734 {
735 Token endArray;
736 readToken(endArray);
737 return true;
738 }
739 int index = 0;
740 for (;;) {
741 Value& value = currentValue()[index++];
742 nodes_.push(&value);
743 bool ok = readValue();
744 nodes_.pop();
745 if (!ok) // error already set
746 return recoverFromError(tokenArrayEnd);
747
748 Token currentToken;
749 // Accept Comment after last item in the array.
750 ok = readTokenSkippingComments(currentToken);
751 bool badTokenType = (currentToken.type_ != tokenArraySeparator &&
752 currentToken.type_ != tokenArrayEnd);
753 if (!ok || badTokenType) {
754 return addErrorAndRecover("Missing ',' or ']' in array declaration",
755 currentToken, tokenArrayEnd);
756 }
757 if (currentToken.type_ == tokenArrayEnd)
758 break;
759 }
760 return true;
761}
762
763bool Reader::decodeNumber(Token& token) {
764 Value decoded;

Callers

nothing calls this directly

Calls 4

swapPayloadMethod · 0.80
setOffsetStartMethod · 0.80
popMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected