Lib/Support/Platform.cpp
/**
 * @brief read the entire contents of a file into a string
 *
 * @param filename name of file to read
 * @param out_str  output parameter; place to store the file contents
 *
 * @return true if all went well, false if file could not be read.
 */
@brief read the entire contents of a file into a string
@param filename name of file to read
@param out_str  output parameter; place to store the file contents

@return true if all went well, false if file could not be read.
@brief read the entire contents of a file into a string @param filename name of file to read @param out_str output parameter ; place to store the file contents @return true if all went well false if file could not be read .
bool loadFileInString(const char *filename, std::string & out_str) {
  std::ifstream t(filename);
  if (!t.is_open()) {
    return false;
  }
  std::string str((std::istreambuf_iterator<char>(t)),
                   std::istreambuf_iterator<char>());
  if (str.empty()) {
    return false;
  }
  out_str = str;
  return true;
}
bool loadFileInString ( const char * filename , std :: string & out_str ) { std :: ifstream t ( filename ) ; if ( ! t . is_open ( ) ) { return false ; } std :: string str ( ( std :: istreambuf_iterator < char > ( t ) ) , std :: istreambuf_iterator < char > ( ) ) ; if ( str . empty ( ) ) { return false ; } out_str = str ; return true ; }
@brief read the entire contents of a file into a string
 @param filename name of file to read
 @param out_str  output parameter; place to store the file contents
@brief read the entire contents of a file into a string @param filename name of file to read @param out_str output parameter ; place to store the file contents