MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / saveToFile

Method saveToFile

Source/Mogwai/AppData.cpp:120–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118 }
119
120 void AppData::saveToFile(const std::filesystem::path& path)
121 {
122 auto getPathArray = [](const std::vector<std::filesystem::path>& paths)
123 {
124 std::vector<std::string> strings;
125 std::transform(paths.begin(), paths.end(), std::back_inserter(strings), [](const std::filesystem::path& path) { return path.string(); });
126 return json(strings);
127 };
128
129 json j = json::object();
130 j[kRecentScripts] = getPathArray(mRecentScripts);
131 j[kRecentScenes] = getPathArray(mRecentScenes);
132
133 std::ofstream ofs(path);
134 if (!ofs.good()) return;
135
136 ofs << j.dump(4);
137 }
138}

Callers

nothing calls this directly

Calls 4

beginMethod · 0.45
endMethod · 0.45
stringMethod · 0.45
dumpMethod · 0.45

Tested by

no test coverage detected