MCPcopy Create free account
hub / github.com/devosoft/avida / ReadString

Method ReadString

avida-core/source/tools/cInitFile.cc:340–357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

338
339
340cString cInitFile::ReadString(const cString& name, cString def, bool warn_default) const
341{
342 // See if we definately can't find the keyword.
343 if (name == "") return def;
344
345 // Search for the keyword.
346 cString cur_line;
347 if (Find(cur_line, name, 0) == false) {
348 if (warn_default) {
349 m_feedback.Error("%s not in '%s', defaulting to: %s", (const char*)name, (const char*)m_filename, (const char*)def);
350 }
351 return def;
352 }
353
354 // Pop off the keyword, and return the remainder of the line.
355 cur_line.PopWord();
356 return cur_line;
357}
358
359
360cString cInitFile::ReadString(const Apto::Array<cString>& names, cString def, bool warn_default) const

Callers

nothing calls this directly

Calls 4

PopWordMethod · 0.80
ErrorMethod · 0.45
GetSizeMethod · 0.45
WarningMethod · 0.45

Tested by

no test coverage detected