| 2929 | } |
| 2930 | |
| 2931 | int64_t fileSize(std::string const& filename) { |
| 2932 | #ifdef _WIN32 |
| 2933 | struct _stati64 file_status; |
| 2934 | if (_stati64(filename.c_str(), &file_status) != 0) |
| 2935 | return 0; |
| 2936 | else |
| 2937 | return file_status.st_size; |
| 2938 | #elif (defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)) |
| 2939 | struct stat file_status; |
| 2940 | if (stat(filename.c_str(), &file_status) != 0) |
| 2941 | return 0; |
| 2942 | else |
| 2943 | return file_status.st_size; |
| 2944 | #else |
| 2945 | #error Port me! |
| 2946 | #endif |
| 2947 | } |
| 2948 | |
| 2949 | size_t readFileBytes(std::string const& filename, uint8_t* buff, size_t len) { |
| 2950 | std::fstream ifs(filename, std::fstream::in | std::fstream::binary); |
no test coverage detected