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

Method readArray

json/jsoncpp.cpp:755–791  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

753}
754
755bool Reader::readArray(Token& tokenStart) {
756 Value init(arrayValue);
757 currentValue().swapPayload(init);
758 currentValue().setOffsetStart(tokenStart.start_ - begin_);
759 skipSpaces();
760 if (current_ != end_ && *current_ == ']') // empty array
761 {
762 Token endArray;
763 readToken(endArray);
764 return true;
765 }
766 int index = 0;
767 for (;;) {
768 Value& value = currentValue()[index++];
769 nodes_.push(&value);
770 bool ok = readValue();
771 nodes_.pop();
772 if (!ok) // error already set
773 return recoverFromError(tokenArrayEnd);
774
775 Token token;
776 // Accept Comment after last item in the array.
777 ok = readToken(token);
778 while (token.type_ == tokenComment && ok) {
779 ok = readToken(token);
780 }
781 bool badTokenType =
782 (token.type_ != tokenArraySeparator && token.type_ != tokenArrayEnd);
783 if (!ok || badTokenType) {
784 return addErrorAndRecover("Missing ',' or ']' in array declaration",
785 token, tokenArrayEnd);
786 }
787 if (token.type_ == tokenArrayEnd)
788 break;
789 }
790 return true;
791}
792
793bool Reader::decodeNumber(Token& token) {
794 Value decoded;

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected