MCPcopy Create free account
hub / github.com/OpenMW/openmw / loadAll

Function loadAll

components/lua/yamlloader.cpp:67–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65 namespace
66 {
67 sol::object loadAll(const std::vector<YAML::Node>& rootNodes, const sol::state_view& lua)
68 {
69 if (rootNodes.empty())
70 return sol::nil;
71
72 if (rootNodes.size() == 1)
73 return getNode(rootNodes[0], lua, 0);
74
75 sol::table documentsTable(lua, sol::create);
76 for (const auto& root : rootNodes)
77 {
78 documentsTable.add(getNode(root, lua, 1));
79 }
80
81 return documentsTable;
82 }
83
84 sol::object getNode(const YAML::Node& node, const sol::state_view& lua, uint64_t depth)
85 {

Callers 1

loadYamlFunction · 0.85

Calls 4

getNodeFunction · 0.85
emptyMethod · 0.45
sizeMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected