src/utils/file.cpp
/**
   * Gets the contents of the given file
   */
Gets the contents of the given file
Gets the contents of the given file
string contents(const string& filename) {
    try {
      string contents;
      string line;
      std::ifstream in(filename, std::ifstream::in);
      while (std::getline(in, line)) {
        contents += line + '\n';
      }
      return contents;
    } catch (const std::ifstream::failure& e) {
      return "";
    }
  }
string contents ( const string & filename ) { try { string contents ; string line ; std :: ifstream in ( filename , std :: ifstream :: in ) ; while ( std :: getline ( in , line ) ) { contents += line + ' \n ' ; } return contents ; } catch ( const std :: ifstream :: failure & e ) { return " " ; } }
Gets the contents of the given file
Gets the contents of the given file