| 120 | } |
| 121 | |
| 122 | void OHDFilesystemUtil::write_file(const std::string &path, |
| 123 | const std::string &content) { |
| 124 | try { |
| 125 | std::ofstream t(path); |
| 126 | if (!t.good()) { |
| 127 | openhd::log::get_default()->warn("Cannot open file [{}]", path); |
| 128 | } |
| 129 | t << content; |
| 130 | t.close(); |
| 131 | if (!t.good()) { |
| 132 | openhd::log::get_default()->warn("Cannot write file [{}]", path); |
| 133 | } |
| 134 | } catch (std::exception &e) { |
| 135 | openhd::log::get_default()->warn("Cannot write file [{}] {}", path, |
| 136 | e.what()); |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | std::optional<std::string> OHDFilesystemUtil::opt_read_file( |
| 141 | const std::string &filename, bool log_debug) { |
nothing calls this directly
no outgoing calls
no test coverage detected