MCPcopy Create free account
hub / github.com/bblanchon/ArduinoJson / addMember

Method addMember

src/ArduinoJson/Object/ObjectImpl.hpp:53–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51
52template <typename TAdaptedString>
53inline VariantData* ObjectData::addMember(TAdaptedString key,
54 ResourceManager* resources) {
55 auto keySlot = resources->allocVariant();
56 if (!keySlot)
57 return nullptr;
58
59 auto valueSlot = resources->allocVariant();
60 if (!valueSlot)
61 return nullptr;
62
63 if (!keySlot->setString(key, resources))
64 return nullptr;
65
66 CollectionData::appendPair(keySlot, valueSlot, resources);
67
68 return valueSlot.ptr();
69}
70
71inline VariantData* ObjectData::addPair(VariantData** value,
72 ResourceManager* resources) {

Callers

nothing calls this directly

Calls 3

allocVariantMethod · 0.80
ptrMethod · 0.80
setStringMethod · 0.45

Tested by

no test coverage detected