Код: Выделить всё
std::ifstream file(filePath, std::ios::in | std::ios::binary | std::ios::ate);
if (!file.is_open() || file.bad())
return StatusCode::fileOpenError;
std::streampos fileSize = file.tellg();
constexpr std::streamoff maxSupportedFileSize = std::numeric_limits::max();
if (fileSize > maxSupportedFileSize)
return StatusCode::unsupportedFileSize;
Подробнее здесь: https://stackoverflow.com/questions/794 ... dstreampos
Мобильная версия