MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / JSONValueGetMembers

Function JSONValueGetMembers

Source/Scripting/angelscript/asfuncs.cpp:6087–6101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6085}
6086
6087static CScriptArray* JSONValueGetMembers(Json::Value* self) {
6088 asIScriptContext* ctx = asGetActiveContext();
6089 asIScriptEngine* engine = ctx->GetEngine();
6090 asITypeInfo* arrayType = engine->GetTypeInfoById(engine->GetTypeIdByDecl("array<string>"));
6091 CScriptArray* array = CScriptArray::Create(arrayType, (asUINT)0);
6092
6093 std::vector<std::string> members = self->getMemberNames();
6094
6095 array->Reserve(members.size());
6096
6097 for (const auto& member : members) {
6098 array->InsertLast((void*)(&member));
6099 }
6100 return array;
6101}
6102
6103static std::string JSONValueTypeName(Json::Value* self) {
6104 switch (self->type()) {

Callers

nothing calls this directly

Calls 8

GetTypeInfoByIdMethod · 0.80
CreateFunction · 0.50
GetEngineMethod · 0.45
GetTypeIdByDeclMethod · 0.45
getMemberNamesMethod · 0.45
ReserveMethod · 0.45
sizeMethod · 0.45
InsertLastMethod · 0.45

Tested by

no test coverage detected