Move computeSlowForces into stepWork
[alexxy/gromacs.git] / src / gromacs / fileio / readinp.cpp
index 10797d31e79af884ba1e09ded56f919f888c25fb..5d497b8cd740c9a518dda0eb1eff25bbfb12770e 100644 (file)
@@ -554,8 +554,11 @@ void printStringNoNewline(std::vector<t_inpfile>* inp, const char* line)
     tmp.append(line);
     get_estr(inp, tmp.c_str(), nullptr);
 }
+
 void setStringEntry(std::vector<t_inpfile>* inp, const char* name, char* newName, const char* def)
 {
+    GMX_RELEASE_ASSERT(newName != nullptr, "Need a valid char buffer");
+
     const char* found = nullptr;
     found             = get_estr(inp, name, def);
     if (found != nullptr)
@@ -563,3 +566,10 @@ void setStringEntry(std::vector<t_inpfile>* inp, const char* name, char* newName
         std::strcpy(newName, found);
     }
 }
+
+std::string setStringEntry(std::vector<t_inpfile>* inp, const std::string& name, const std::string& def)
+{
+    GMX_RELEASE_ASSERT(!name.empty(), "Need a valid string");
+
+    return get_estr(inp, name.c_str(), def.c_str());
+}