MercuryDPM  0.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
writeToFile.h File Reference

Go to the source code of this file.

Functions

bool writeToFile (std::string filename, std::string filecontent)
 

Function Documentation

bool writeToFile ( std::string  filename,
std::string  filecontent 
)

Definition at line 29 of file writeToFile.h.

30 {
31  std::fstream file;
32  file.open(filename.c_str(),std::ios::out);
33  if (file.fail())
34  {
35  std::cerr << "Error in writeToFile: file could not be opened" << std::endl;
36  return false;
37  }
38  file << filecontent;
39  file.close();
40  return true;
41 }