17 FILE* file = fopen(filepath,
"r");
21 std::cerr <<
"ERROR::FILE::Cannot read the file - Please check the file path or permissions " <<
'\n';
24 fseek(file, 0, SEEK_END);
25 unsigned long length = ftell(file);
26 char* data =
new char[length + 1];
27 memset(data, 0, length + 1);
28 fseek(file, 0, SEEK_SET);
29 fread(data, 1, length, file);
32 std::string result(data);
Definition: audioclip.cpp:3
static std::string read_file(const char *filepath)
Reads the contents of the file and converts into stream of bytes.
Definition: fileutils.h:15
A utility class to load various types of files.
Definition: fileutils.h:9