#include #include #include namespace sp { namespace file { std::vector read(const std::string& path) { std::vector buf; FILE *fd = fopen(path.c_str(), "rb"); if (fd) { fseek(fd, 0, SEEK_END); buf.resize(ftell(fd)); rewind(fd); fread(&buf[0], 1, buf.size(), fd); fclose(fd); } return buf; } } } // namespace sp::file