MCPcopy Create free account
hub / github.com/Samsung/ONE / readArray

Method readArray

runtime/3rdparty/jsoncpp/jsoncpp.cpp:800–840  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

798}
799
800bool Reader::readArray(Token &token)
801{
802 Value init(arrayValue);
803 currentValue().swapPayload(init);
804 currentValue().setOffsetStart(token.start_ - begin_);
805 skipSpaces();
806 if (current_ != end_ && *current_ == ']') // empty array
807 {
808 Token endArray;
809 readToken(endArray);
810 return true;
811 }
812 int index = 0;
813 for (;;)
814 {
815 Value &value = currentValue()[index++];
816 nodes_.push(&value);
817 bool ok = readValue();
818 nodes_.pop();
819 if (!ok) // error already set
820 return recoverFromError(tokenArrayEnd);
821
822 Token currentToken;
823 // Accept Comment after last item in the array.
824 ok = readToken(currentToken);
825 while (currentToken.type_ == tokenComment && ok)
826 {
827 ok = readToken(currentToken);
828 }
829 bool badTokenType =
830 (currentToken.type_ != tokenArraySeparator && currentToken.type_ != tokenArrayEnd);
831 if (!ok || badTokenType)
832 {
833 return addErrorAndRecover("Missing ',' or ']' in array declaration", currentToken,
834 tokenArrayEnd);
835 }
836 if (currentToken.type_ == tokenArrayEnd)
837 break;
838 }
839 return true;
840}
841
842bool Reader::decodeNumber(Token &token)
843{

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