MCPcopy Create free account
hub / github.com/bytedance/sonic-cpp / AddMember

Function AddMember

include/sonic/dom/genericnode.h:784–788  ·  view source on GitHub ↗

* @brief Add a new member for this object. * @param key new member's name, must be string * @param value rvalue of the added value node * @param copyKey copy the key's string when creating the key node if copyKey * is true. * @return NodeType& Reference of the added member. * @note value will be moved. */

Source from the content-addressed store, hash-verified

782 * @note value will be moved.
783 */
784 MemberIterator AddMember(StringView key, NodeType&& value, alloc_type& alloc,
785 bool copyKey = true) {
786 sonic_assert(this->IsObject());
787 return downCast()->addMemberImpl(key, value, alloc, copyKey);
788 }
789
790 /**
791 * @brief Reserve object capacity if NodeType support. Otherwise do nothing.

Callers

nothing calls this directly

Calls 3

downCastFunction · 0.85
IsObjectMethod · 0.80
addMemberImplMethod · 0.80

Tested by

no test coverage detected