MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / savePropertiesFile

Function savePropertiesFile

Tactility/Source/file/PropertiesFile.cpp:57–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57bool savePropertiesFile(const std::string& filePath, const std::map<std::string, std::string>& properties) {
58 bool result = false;
59 getLock(filePath)->withLock([&result, filePath, &properties] {
60 LOGGER.info("Saving properties file {}", filePath);
61
62 FILE* file = fopen(filePath.c_str(), "w");
63 if (file == nullptr) {
64 LOGGER.error("Failed to open {}", filePath);
65 return;
66 }
67
68 for (const auto& [key, value]: properties) { fprintf(file, "%s=%s\n", key.c_str(), value.c_str()); }
69
70 fclose(file);
71 result = true;
72 });
73 return result;
74}
75
76}

Callers 13

saveFunction · 0.85
saveFunction · 0.85
saveFunction · 0.85
saveFunction · 0.85
saveFunction · 0.85
loadFunction · 0.85
saveFunction · 0.85
saveSystemSettingsFunction · 0.85
saveFunction · 0.85
saveFunction · 0.85
saveFunction · 0.85
saveFunction · 0.85

Calls 4

getLockFunction · 0.85
withLockMethod · 0.80
infoMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected