MCPcopy Create free account
hub / github.com/CompPhysVienna/n2p2 / readFile

Method readFile

src/libnnp/Settings.cpp:249–272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

247}
248
249void Settings::readFile()
250{
251 ifstream file;
252 string line;
253
254 log.push_back(strpr("Settings file name: %s\n", fileName.c_str()));
255 file.open(fileName.c_str());
256 if (!file.is_open())
257 {
258 throw runtime_error("ERROR: Could not open file: \"" + fileName
259 + "\".\n");
260 }
261
262 while (getline(file, line))
263 {
264 lines.push_back(line);
265 }
266
267 file.close();
268
269 log.push_back(strpr("Read %zu lines.\n", lines.size()));
270
271 return;
272}
273
274void Settings::writeSettingsFile(ofstream* const& file,
275 map<size_t, string> const& replacements) const

Callers

nothing calls this directly

Calls 2

strprFunction · 0.85
sizeMethod · 0.80

Tested by

no test coverage detected