MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / createSettingsFile

Function createSettingsFile

test/Settings.cpp:201–214  ·  view source on GitHub ↗

Creates the file in the given version folder, with the full path as file contents. Returns the full path.

Source from the content-addressed store, hash-verified

199
200// Creates the file in the given version folder, with the full path as file contents. Returns the full path.
201inline std::string createSettingsFile(const IApplicationContext& context, const std::string& versionFolder, const std::string& filename)
202{
203 auto settingsFolder = os::standardPathWithSlash(context.getSettingsPath() + versionFolder);
204 os::makeDirectory(settingsFolder);
205 auto fullPath = settingsFolder + filename;
206
207 std::ofstream stream(fullPath);
208
209 stream << fullPath;
210 stream.flush();
211 stream.close();
212
213 return fullPath;
214}
215
216inline std::string loadSettingsFile(const IApplicationContext& context, const std::string& applicationVersion, const std::string& relativeFilePath)
217{

Callers 1

TESTFunction · 0.85

Calls 5

makeDirectoryFunction · 0.85
standardPathWithSlashFunction · 0.50
getSettingsPathMethod · 0.45
flushMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected