Skip to content
JsonData

HasParent

bool HasParent() const

Returns whether or not this JsonData has a direct parent.

What does this mean? In this example, j1 does not have a direct parent, but j2 does:

std::string jsonCode = 
    "{"
    "   \"foo\": 5",
    "}";

Json j1;
j1.Parse(jsonCode);

j2 = j1["foo"];

In fact, the parent of j2 is j1.