MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / readClassMetadata

Function readClassMetadata

pj_scripting/src/luau_engine.cpp:366–377  ·  view source on GitHub ↗

Read metadata (NOT create) from the class table on top of `L` into a FilterClass. Leaves the stack as found. Returns an error string.

Source from the content-addressed store, hash-verified

364// Read metadata (NOT create) from the class table on top of `L` into a
365// FilterClass. Leaves the stack as found. Returns an error string.
366std::string readClassMetadata(lua_State* L, FilterClass& fc) {
367 const int idx = lua_gettop(L);
368 fc.id = stringField(L, idx, "id");
369 fc.name = stringField(L, idx, "name", fc.id);
370 if (fc.id.empty()) {
371 return "filter class is missing its `id`";
372 }
373 fc.description = stringField(L, idx, "description");
374 fc.version = stringField(L, idx, "version");
375 fc.output_kind = stringField(L, idx, "output", "double");
376 return readParameters(L, idx, fc.parameters);
377}
378
379// Bind an instance method (`calculate`/`reset`) by name WITHOUT triggering any
380// metamethod: first a raw field on the instance, else a raw lookup through a

Callers 1

inspectModuleMethod · 0.85

Calls 3

stringFieldFunction · 0.85
readParametersFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected