MCPcopy Create free account
hub / github.com/axmolengine/axmol / writeBinaryToFile

Method writeBinaryToFile

core/platform/FileUtils.cpp:516–532  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

514}
515#endif
516bool 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
534bool FileUtils::init()
535{

Callers

nothing calls this directly

Calls 4

getInstanceFunction · 0.85
openFileStreamMethod · 0.80
emptyMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected