| 514 | } |
| 515 | #endif |
| 516 | bool FileUtils::writeBinaryToFile(const void* data, size_t dataSize, std::string_view fullPath) |
| 517 | { |
| 518 | AXASSERT(!fullPath.empty() && dataSize > 0, "Invalid parameters."); |
| 519 | |
| 520 | auto* fileUtils = FileUtils::getInstance(); |
| 521 | do |
| 522 | { |
| 523 | auto fileStream = fileUtils->openFileStream(fullPath, IFileStream::Mode::WRITE); |
| 524 | // Read the file from hardware |
| 525 | AX_BREAK_IF(!fileStream); |
| 526 | |
| 527 | bool ok = fileStream->write(data, static_cast<unsigned int>(dataSize)) == dataSize; |
| 528 | return ok; |
| 529 | } while (0); |
| 530 | |
| 531 | return false; |
| 532 | } |
| 533 | |
| 534 | bool FileUtils::init() |
| 535 | { |
nothing calls this directly
no test coverage detected