Enhancement - edit command

- Mere beginnings of the edit command.  No functionality yet.
This commit is contained in:
Paul Beckingham 2009-05-10 01:54:43 -04:00
parent de4194479a
commit 407ef39c54
5 changed files with 91 additions and 0 deletions

View file

@ -430,3 +430,16 @@ bool slurp (
}
////////////////////////////////////////////////////////////////////////////////
void spit (const std::string& file, const std::string& contents)
{
std::ofstream out (file.c_str ());
if (out.good ())
{
out << contents;
out.close ();
}
else
throw std::string ("Could not write file '") + file + "'";
}
////////////////////////////////////////////////////////////////////////////////