MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Get

Function Get

Source/ThirdParty/rapidjson/pointer.h:601–629  ·  view source on GitHub ↗

Query a value in a subtree. ! \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root. \param unresolvedTokenIndex If the pointer cannot resolve a token in the pointer, this parameter can obtain the index of unresolved token. \return Pointer to the value if it can be resolved. Otherwise null. \note There are onl

Source from the content-addressed store, hash-verified

599 Use unresolvedTokenIndex to retrieve the token index.
600 */
601 ValueType* Get(ValueType& root, size_t* unresolvedTokenIndex = 0) const {
602 RAPIDJSON_ASSERT(IsValid());
603 ValueType* v = &root;
604 for (const Token *t = tokens_; t != tokens_ + tokenCount_; ++t) {
605 switch (v->GetType()) {
606 case kObjectType:
607 {
608 typename ValueType::MemberIterator m = v->FindMember(GenericValue<EncodingType>(GenericStringRef<Ch>(t->name, t->length)));
609 if (m == v->MemberEnd())
610 break;
611 v = &m->value;
612 }
613 continue;
614 case kArrayType:
615 if (t->index == kPointerInvalidIndex || t->index >= v->Size())
616 break;
617 v = &((*v)[t->index]);
618 continue;
619 default:
620 break;
621 }
622
623 // Error: unresolved token
624 if (unresolvedTokenIndex)
625 *unresolvedTokenIndex = static_cast<size_t>(t - tokens_);
626 return 0;
627 }
628 return v;
629 }
630
631 //! Query a const value in a const subtree.
632 /*!

Callers

nothing calls this directly

Calls 5

FindMemberMethod · 0.80
MemberEndMethod · 0.80
IsValidFunction · 0.70
GetTypeMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected